Include <wchar.h> after defining the types, not before.
[pspp] / lib / stdint.in.h
index d43fc1c1e45ac9b42aa4ce1d6b1c178a1143dec2..a335fd07febf4fb872a671d943ae405898ed9ee9 100644 (file)
 # include <sys/bitypes.h>
 #endif
 
-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
-/* Get WCHAR_MIN, WCHAR_MAX.  */
-# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
-#  include <wchar.h>
-# endif
-
-#endif
-
 #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
 /* Minimum and maximum values for a integer type under the usual assumption.
@@ -482,6 +473,13 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 #endif
 
 /* wchar_t limits */
+/* Get WCHAR_MIN, WCHAR_MAX.
+   This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
+   includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+   <stdint.h> and assumes its types are already defined.  */
+#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# include <wchar.h>
+#endif
 #undef WCHAR_MIN
 #undef WCHAR_MAX
 #define WCHAR_MIN  \