summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorShell <[email protected]>2024-02-23 17:49:15 +0800
committerGitHub <[email protected]>2024-02-23 17:49:15 +0800
commit71560bafb5735220696ca24a42ba4a668b55949b (patch)
tree236df5973a1fd5b6f0cc9f6c6b6a2d71fd069203 /components/libc/compilers/common
parent6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff)
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]> Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/include/sys/time.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h
index c9968a9f29..817fe78676 100644
--- a/components/libc/compilers/common/include/sys/time.h
+++ b/components/libc/compilers/common/include/sys/time.h
@@ -46,7 +46,17 @@ int8_t rt_tz_is_dst(void);
struct itimerspec;
-#if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__))
+/* 'struct timeval' is defined on __x86_64__ toolchain */
+#if !defined(__x86_64__) && !defined(_TIMEVAL_DEFINED)
+#define _TIMEVAL_DEFINED
+struct timeval
+{
+ time_t tv_sec; /* seconds */
+ suseconds_t tv_usec; /* and microseconds */
+};
+#endif /* _TIMEVAL_DEFINED */
+
+#if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__) || defined(RT_USING_SMART))
/* linux x86 platform gcc use! */
#define _TIMEVAL_DEFINED
/* Values for the first argument to `getitimer' and `setitimer'. */
@@ -71,16 +81,7 @@ struct itimerval
/* Time to the next timer expiration. */
struct timeval it_value;
};
-#endif /* defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) */
-
-#ifndef _TIMEVAL_DEFINED
-#define _TIMEVAL_DEFINED
-struct timeval
-{
- time_t tv_sec; /* seconds */
- suseconds_t tv_usec; /* and microseconds */
-};
-#endif /* _TIMEVAL_DEFINED */
+#endif /* defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) || defined(RT_USING_SMART) */
#if defined(__ARMCC_VERSION) || defined(_WIN32) || (defined(__ICCARM__) && (__VER__ < 8010001))
struct timespec