emulate gmtime_r/localtime_r by gmtime_s/localtime_s on Windows

This commit is contained in:
Yukihiro Matsumoto
2012-05-13 19:46:57 +09:00
parent 69c1b9b797
commit 50a1d30291
+3 -2
View File
@@ -26,8 +26,9 @@
/* #define NO_GMTIME_R */
#ifdef _WIN32
/* unfortunately Win32 platform do not provide gmtime_r/localtime_r */
#define NO_GMTIME_R
/* Win32 platform do not provide gmtime_r/localtime_r; emulate them using gmtime_s/localtime_s */
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tp) : NULL)
#define localtime_r(tp, tm) ((localtime_s((tm), (tp)) == 0) ? (tp) : NULL)
#endif
/* timegm(3) */