summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-12-29 07:48:36 -0500
committerBernard Xiong <[email protected]>2021-12-30 01:27:25 +0800
commit85276f453578e0ea74f39cfcc609f867f919f059 (patch)
treef286594c3ce9f954903281f305e0538dde45d02f /components/libc/compilers/common
parentc8dcf7cc6805bcf5380d524d7a5c44e2ff366128 (diff)
[libc] 删除compiler_private.c文件
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/compiler_private.c13
-rw-r--r--components/libc/compilers/common/compiler_private.h4
-rw-r--r--components/libc/compilers/common/time.c16
3 files changed, 10 insertions, 23 deletions
diff --git a/components/libc/compilers/common/compiler_private.c b/components/libc/compilers/common/compiler_private.c
deleted file mode 100644
index 6e9a6001f0..0000000000
--- a/components/libc/compilers/common/compiler_private.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2021-12-26 Meco Man First Version
- */
-#include "compiler_private.h"
-
-const char *warning_without_fs = "Please enable RT_USING_POSIX_FS";
-const char *warning_without_devio = "Please enable RT_USING_POSIX_FS and RT_USING_POSIX_DEVIO";
diff --git a/components/libc/compilers/common/compiler_private.h b/components/libc/compilers/common/compiler_private.h
index 79bac3b787..ed29b8c333 100644
--- a/components/libc/compilers/common/compiler_private.h
+++ b/components/libc/compilers/common/compiler_private.h
@@ -12,7 +12,7 @@
#include <rtconfig.h>
-extern const char *warning_without_fs;
-extern const char *warning_without_devio;
+#define _WARNING_WITHOUT_FS "Please enable RT_USING_POSIX_FS"
+#define _WARNING_WITHOUT_DEVIO "Please enable RT_USING_POSIX_FS and RT_USING_POSIX_DEVIO"
#endif /* __COMPILER_PRIVATE_H__ */
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c
index 1fe11561f7..8890a3e830 100644
--- a/components/libc/compilers/common/time.c
+++ b/components/libc/compilers/common/time.c
@@ -33,7 +33,7 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
-#define WARNING_NO_RTC "Cannot find a RTC device!"
+#define _WARNING_NO_RTC "Cannot find a RTC device!"
/* seconds per day */
#define SPD 24*60*60
@@ -110,7 +110,7 @@ static rt_err_t get_timeval(struct timeval *tv)
else
{
/* LOG_W will cause a recursive printing if ulog timestamp function is enabled */
- rt_kprintf(WARNING_NO_RTC);
+ rt_kprintf(_WARNING_NO_RTC);
return -RT_ENOSYS;
}
@@ -118,7 +118,7 @@ static rt_err_t get_timeval(struct timeval *tv)
#else
/* LOG_W will cause a recursive printing if ulog timestamp function is enabled */
- rt_kprintf(WARNING_NO_RTC);
+ rt_kprintf(_WARNING_NO_RTC);
return -RT_ENOSYS;
#endif /* RT_USING_RTC */
}
@@ -155,14 +155,14 @@ static int set_timeval(struct timeval *tv)
}
else
{
- LOG_W(WARNING_NO_RTC);
+ LOG_W(_WARNING_NO_RTC);
return -RT_ENOSYS;
}
return rst;
#else
- LOG_W(WARNING_NO_RTC);
+ LOG_W(_WARNING_NO_RTC);
return -RT_ENOSYS;
#endif /* RT_USING_RTC */
}
@@ -527,7 +527,7 @@ INIT_COMPONENT_EXPORT(_rt_clock_time_system_init);
int clock_getres(clockid_t clockid, struct timespec *res)
{
#ifndef RT_USING_RTC
- LOG_W(WARNING_NO_RTC);
+ LOG_W(_WARNING_NO_RTC);
return -1;
#else
int ret = 0;
@@ -566,7 +566,7 @@ RTM_EXPORT(clock_getres);
int clock_gettime(clockid_t clockid, struct timespec *tp)
{
#ifndef RT_USING_RTC
- LOG_W(WARNING_NO_RTC);
+ LOG_W(_WARNING_NO_RTC);
return -1;
#else
int ret = 0;
@@ -630,7 +630,7 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, s
int clock_settime(clockid_t clockid, const struct timespec *tp)
{
#ifndef RT_USING_RTC
- LOG_W(WARNING_NO_RTC);
+ LOG_W(_WARNING_NO_RTC);
return -1;
#else
register rt_base_t level;