Changeset 535
- Timestamp:
- 02/06/09 01:21:32 (3 years ago)
- Location:
- interpreter/trunk
- Files:
-
- 2 edited
-
modules/System/date/hires.c (modified) (1 diff)
-
windows/libkite.vcproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
interpreter/trunk/modules/System/date/hires.c
r531 r535 4 4 #ifndef WIN32 5 5 #include <unistd.h> 6 #include <sys/time.h> 7 #else 8 #include <time.h> 9 #include <Winsock2.h> 6 10 #endif /* WIN32 */ 7 11 #include <errno.h> 8 12 #define __USE_XOPEN 9 #include <sys/time.h> 13 14 #ifdef WIN32 15 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) 16 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 17 #else 18 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL 19 #endif 20 21 struct timezone 22 { 23 int tz_minuteswest; /* minutes W of Greenwich */ 24 int tz_dsttime; /* type of dst correction */ 25 }; 26 27 int gettimeofday(struct timeval *tv, struct timezone *tz) 28 { 29 FILETIME ft; 30 unsigned __int64 tmpres = 0; 31 static int tzflag; 32 33 if (NULL != tv) 34 { 35 GetSystemTimeAsFileTime(&ft); 36 37 tmpres |= ft.dwHighDateTime; 38 tmpres <<= 32; 39 tmpres |= ft.dwLowDateTime; 40 41 /*converting file time to unix epoch*/ 42 tmpres /= 10; /*convert into microseconds*/ 43 tmpres -= DELTA_EPOCH_IN_MICROSECS; 44 tv->tv_sec = (long)(tmpres / 1000000UL); 45 tv->tv_usec = (long)(tmpres % 1000000UL); 46 } 47 48 if (NULL != tz) 49 { 50 if (!tzflag) 51 { 52 _tzset(); 53 tzflag++; 54 } 55 tz->tz_minuteswest = _timezone / 60; 56 tz->tz_dsttime = _daylight; 57 } 58 59 return 0; 60 } 61 #endif /* WIN32 */ 10 62 11 63 #include "kite_object.h" -
interpreter/trunk/windows/libkite.vcproj
r527 r535 473 473 </File> 474 474 </Filter> 475 <Filter 476 Name="collections" 477 > 478 <File 479 RelativePath="..\modules\System\collections\array.c" 480 > 481 </File> 482 </Filter> 475 483 </Filter> 476 484 <Filter
Note: See TracChangeset
for help on using the changeset viewer.
