+2008-12-26 Bruno Haible <bruno@clisp.org>
+
+ * lib/stdint.in.h: Move the include of <wchar.h> down until after all
+ the types are defined. Also conditionalize it on __STDC_LIMIT_MACROS,
+ not __STDC_CONSTANT_MACROS.
+ Reported by Nelson H. F. Beebe <beebe@math.utah.edu> via Eric Blake.
+
2008-12-25 Bruno Haible <bruno@clisp.org>
Add support for universal builds to vasnprintf.
# 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.
#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 \