diff options
| author | Meco Man <[email protected]> | 2023-08-12 00:44:36 -0400 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2023-08-13 22:51:58 -0400 |
| commit | 432c2f38fce3eacc5925d79c81f7792929ad6832 (patch) | |
| tree | 2bcfe9f34d07856440abd0acb38c8356ad5ef6fe /components/libc/compilers/common/include | |
| parent | a6959a9ef8a8b3233a2d0b395d43f07711bf765c (diff) | |
[libc][timezone] implement lightweith timezone configuration
Diffstat (limited to 'components/libc/compilers/common/include')
| -rw-r--r-- | components/libc/compilers/common/include/sys/time.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h index f1d8585383..c9968a9f29 100644 --- a/components/libc/compilers/common/include/sys/time.h +++ b/components/libc/compilers/common/include/sys/time.h @@ -28,19 +28,8 @@ extern "C" { #define CLOCKS_PER_SEC RT_TICK_PER_SECOND /* timezone */ +/* this method of representing timezones has been abandoned */ #define DST_NONE 0 /* not on dst */ -#define DST_USA 1 /* USA style dst */ -#define DST_AUST 2 /* Australian style dst */ -#define DST_WET 3 /* Western European dst */ -#define DST_MET 4 /* Middle European dst */ -#define DST_EET 5 /* Eastern European dst */ -#define DST_CAN 6 /* Canada */ -#define DST_GB 7 /* Great Britain and Eire */ -#define DST_RUM 8 /* Rumania */ -#define DST_TUR 9 /* Turkey */ -#define DST_AUSTALT 10 /* Australian style with shift in 1986 */ - -struct itimerspec; struct timezone { @@ -48,6 +37,15 @@ struct timezone int tz_dsttime; /* type of dst correction */ }; +/* lightweight timezone and daylight saving time */ +#ifdef RT_LIBC_USING_LIGHT_TZ_DST +void rt_tz_set(int32_t offset_sec); +int32_t rt_tz_get(void); +int8_t rt_tz_is_dst(void); +#endif /* RT_LIBC_USING_LIGHT_TZ_DST */ + +struct itimerspec; + #if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) /* linux x86 platform gcc use! */ #define _TIMEVAL_DEFINED @@ -218,11 +216,6 @@ int timer_gettime(timer_t timerid, struct itimerspec *its); int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); #endif /* RT_USING_POSIX_TIMER */ -/* timezone */ -void tz_set(int8_t tz); -int8_t tz_get(void); -int8_t tz_is_dst(void); - #ifdef __cplusplus } #endif /* __cplusplus */ |
