1919extern "C" {
2020#endif
2121
22+ /* timezone */
2223#define DST_NONE 0 /* not on dst */
2324#define DST_USA 1 /* USA style dst */
2425#define DST_AUST 2 /* Australian style dst */
@@ -31,12 +32,21 @@ extern "C" {
3132#define DST_TUR 9 /* Turkey */
3233#define DST_AUSTALT 10 /* Australian style with shift in 1986 */
3334
34- #ifndef _TIMEVAL_DEFINED
35- #define _TIMEVAL_DEFINED
35+ struct timezone {
36+ int tz_minuteswest ; /* minutes west of Greenwich */
37+ int tz_dsttime ; /* type of dst correction */
38+ };
39+
40+ void rt_tz_set (rt_int8_t tz );
41+ rt_int8_t rt_tz_get (void );
42+ rt_int8_t rt_tz_is_dst (void );
43+
3644/*
3745 * Structure returned by gettimeofday(2) system call,
3846 * and used in other calls.
3947 */
48+ #ifndef _TIMEVAL_DEFINED
49+ #define _TIMEVAL_DEFINED
4050#if !(defined(_WIN32 ))
4151struct timeval {
4252 long tv_sec ; /* seconds */
@@ -45,18 +55,6 @@ struct timeval {
4555#endif
4656#endif /* _TIMEVAL_DEFINED */
4757
48- #if !(defined(__GNUC__ ) && !defined(__ARMCC_VERSION )/*GCC*/ ) && !(defined(__ICCARM__ ) && (__VER__ >= 8010001 )) && !defined(_WIN32 )
49- struct timespec {
50- time_t tv_sec ; /* seconds */
51- long tv_nsec ; /* and nanoseconds */
52- };
53- #endif
54-
55- struct timezone {
56- int tz_minuteswest ; /* minutes west of Greenwich */
57- int tz_dsttime ; /* type of dst correction */
58- };
59-
6058int stime (const time_t * t );
6159time_t timegm (struct tm * const t );
6260int gettimeofday (struct timeval * tv , struct timezone * tz );
@@ -67,6 +65,14 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r);
6765
6866#ifdef RT_USING_POSIX
6967#include <sys/types.h>
68+
69+ #if !(defined(__GNUC__ ) && !defined(__ARMCC_VERSION )/*GCC*/ ) && !(defined(__ICCARM__ ) && (__VER__ >= 8010001 )) && !defined(_WIN32 )
70+ struct timespec {
71+ time_t tv_sec ; /* seconds */
72+ long tv_nsec ; /* and nanoseconds */
73+ };
74+ #endif
75+
7076/* posix clock and timer */
7177#define MILLISECOND_PER_SECOND 1000UL
7278#define MICROSECOND_PER_SECOND 1000000UL
@@ -96,15 +102,9 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r);
96102int clock_getres (clockid_t clockid , struct timespec * res );
97103int clock_gettime (clockid_t clockid , struct timespec * tp );
98104int clock_settime (clockid_t clockid , const struct timespec * tp );
99- int clock_time_to_tick (const struct timespec * time );
105+ int rt_timespec_to_tick (const struct timespec * time );
100106#endif /* RT_USING_POSIX */
101107
102-
103- /* timezone APIs (Not standard LIBC APIs) */
104- void rt_tz_set (rt_int8_t tz );
105- rt_int8_t rt_tz_get (void );
106- rt_int8_t rt_tz_is_dst (void );
107-
108108#ifdef __cplusplus
109109}
110110#endif
0 commit comments