浏览代码

增加tz_dsttime类型定义

Meco Man 4 年之前
父节点
当前提交
8ec1a63b23

+ 1 - 1
components/libc/compilers/common/sys/mman.h

@@ -16,7 +16,7 @@ extern "C" {
 #endif
 
 #include <sys/types.h>
-    
+
 #define MAP_FAILED     ((void *) -1)
 
 #define MAP_SHARED     0x01

+ 13 - 0
components/libc/compilers/common/sys/time.h

@@ -20,6 +20,19 @@ extern "C" {
 
 #ifndef _TIMEVAL_DEFINED
 #define _TIMEVAL_DEFINED
+
+#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 */
+
 /*
  * Structure returned by gettimeofday(2) system call,
  * and used in other calls.

+ 1 - 1
components/libc/compilers/common/time.c

@@ -424,7 +424,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
      */
     if(tz != RT_NULL)
     {
-        tz->tz_dsttime = 0;
+        tz->tz_dsttime = DST_NONE;
         tz->tz_minuteswest = -(RT_LIBC_FIXED_TIMEZONE * 60);
     }