فهرست منبع

fixbug: gettimeofday timezone

ithewei 6 سال پیش
والد
کامیت
682b3f3d9c
1فایلهای تغییر یافته به همراه15 افزوده شده و 1 حذف شده
  1. 15 1
      base/htime.h

+ 15 - 1
base/htime.h

@@ -35,7 +35,21 @@ static inline void usleep(unsigned int us) {
 }
 
 #include <sys/timeb.h>
-static inline int gettimeofday(struct timeval *tv, struct timeval *tz) {
+
+/* @see winsock2.h
+// Structure used in select() call, taken from the BSD file sys/time.h
+struct timeval {
+    long    tv_sec;
+    long    tv_usec;
+};
+*/
+
+struct timezone {
+    int tz_minuteswest; /* of Greenwich */
+    int tz_dsttime;     /* type of dst correction to apply */
+};
+
+static inline int gettimeofday(struct timeval *tv, struct timezone *tz) {
     struct _timeb tb;
 
     _ftime(&tb);