lib/iec_std_lib.h
changeset 709 bca119630cf6
parent 707 e666763ac743
child 711 8a1ba3db05b2
--- a/lib/iec_std_lib.h	Fri Nov 16 01:02:54 2012 +0100
+++ b/lib/iec_std_lib.h	Wed Nov 28 11:52:03 2012 +0900
@@ -224,6 +224,12 @@
   return ts;
 }
 
+#ifdef __MINGW32__
+#define TIMEGM mktime
+#else
+#define TIMEGM timegm
+#endif
+
 static inline IEC_TIMESPEC __date_to_timespec(int day, int month, int year) {
   IEC_TIMESPEC ts;
   struct tm broken_down_time;
@@ -237,7 +243,7 @@
   broken_down_time.tm_year = year - 1900;  /* number of years since 1900 */
   broken_down_time.tm_isdst = -1; /* disable daylight savings time */
   
-  epoch_seconds = timegm(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
+  epoch_seconds = TIMEGM(&broken_down_time); /* determine number of seconds since the epoch, i.e. Jan 1st 1970 */
 
   if ((time_t)(-1) == epoch_seconds)
     __iec_error();