]> granicus.if.org Git - icu/commitdiff
ICU-8535 Fix tzset error in MinGW build
authorMichael Ow <mow@svn.icu-project.org>
Tue, 28 Jun 2011 23:34:49 +0000 (23:34 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Tue, 28 Jun 2011 23:34:49 +0000 (23:34 +0000)
X-SVN-Rev: 30249

icu4c/source/common/putil.cpp

index 5feca1b127286c44c7febaf7498e110d5e18e909..fbc863fbce99defa8b78fa656b63f36588f04fd1 100644 (file)
@@ -86,9 +86,6 @@ Cleanly installed Solaris can use this #define.
 #   define NOMCX
 #   include <windows.h>
 #   include "wintz.h"
-#elif defined(U_CYGWIN) && defined(__STRICT_ANSI__)
-/* tzset isn't defined in strict ANSI on Cygwin. */
-#   undef __STRICT_ANSI__
 #elif defined(OS400)
 #   include <float.h>
 #   include <qusec.h>       /* error code structure */
@@ -104,20 +101,25 @@ Cleanly installed Solaris can use this #define.
 #   include <TextUtils.h>
 #   define ICU_NO_USER_DATA_OVERRIDE 1
 #elif defined(OS390)
-#include "unicode/ucnv.h"   /* Needed for UCNV_SWAP_LFNL_OPTION_STRING */
+#   include "unicode/ucnv.h"   /* Needed for UCNV_SWAP_LFNL_OPTION_STRING */
 #elif defined(U_DARWIN) || defined(U_LINUX) || defined(U_BSD)
-#include <limits.h>
-#include <unistd.h>
+#   include <limits.h>
+#   include <unistd.h>
 #elif defined(U_QNX)
-#include <sys/neutrino.h>
+#   include <sys/neutrino.h>
 #elif defined(U_SOLARIS)
-# ifndef _XPG4_2
-#  define _XPG4_2
-# endif
+#   ifndef _XPG4_2
+#       define _XPG4_2
+#   endif
+#endif
+
+#if (defined(U_CYGWIN) || defined(__MINGW32__)) && defined(__STRICT_ANSI__)
+/* tzset isn't defined in strict ANSI on Cygwin. */
+#undef __STRICT_ANSI__
 #endif
 
 /*
- * Cygwin with GCC requires inclusion of time.h after the above disabling strict asci mode statement.
+ * Cygwin and MinGW with GCC requires inclusion of time.h after the above disabling strict asci mode statement.
  */
 #include <time.h>
 
@@ -613,7 +615,7 @@ uprv_maximumPtr(void * base)
 U_CAPI void U_EXPORT2
 uprv_tzset()
 {
-#if defined(U_TZSET) && !defined(__MINGW32__)
+#if defined(U_TZSET)
     U_TZSET();
 #else
     /* no initialization*/