]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cinttypes: Restore __STDC_FORMAT_MACRO after inclusion of <inttypes.h>.
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 9 Sep 2008 21:33:46 +0000 (21:33 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 9 Sep 2008 21:33:46 +0000 (21:33 +0000)
2008-09-09  Paolo Carlini  <paolo.carlini@oracle.com>

* include/tr1_impl/cinttypes: Restore __STDC_FORMAT_MACRO after
inclusion of <inttypes.h>.
* include/tr1_impl/cstdint: Likewise for __STDC_LIMIT_MACROS and
__STDC_CONSTANT_MACROS after <stdint.h>.
* include/bits/postypes.h: Likewise.

From-SVN: r140174

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/postypes.h
libstdc++-v3/include/tr1_impl/cinttypes
libstdc++-v3/include/tr1_impl/cstdint

index d8f8b949e2fe60d6e695c881fd0574297b59cf0e..3adbedc0e1afe56bb9de9af04855c1b313a22f71 100644 (file)
@@ -1,3 +1,11 @@
+2008-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/tr1_impl/cinttypes: Restore __STDC_FORMAT_MACRO after
+       inclusion of <inttypes.h>.
+       * include/tr1_impl/cstdint: Likewise for __STDC_LIMIT_MACROS and
+       __STDC_CONSTANT_MACROS after <stdint.h>.
+       * include/bits/postypes.h: Likewise.
+
 2008-09-09  Andreas Schwab  <schwab@suse.de>
 
        * acinclude.m4 (GLIBCXX_CHECK_STANDARD_LAYOUT): Fix compile check
index 6d57a24701e0c9dc83e11a20afb01f49c8d9b82c..c1862857206467a0709a14c962c37f642f9793d4 100644 (file)
 
 #include <cwchar> // For mbstate_t
 
-// XXX If <stdint.h> is really needed, make sure to define the macros,
-// in order not to break <tr1/cstdint> (and <cstdint> in C++0x).
-// Reconsider all this as soon as possible...
+// XXX If <stdint.h> is really needed, make sure to define the macros
+// before including it, in order not to break <tr1/cstdint> (and <cstdint>
+// in C++0x).  Reconsider all this as soon as possible...
 #if (defined(_GLIBCXX_HAVE_INT64_T) && !defined(_GLIBCXX_HAVE_INT64_T_LONG) \
      && !defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG))
+
 #ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
 # define __STDC_LIMIT_MACROS
 #endif
 #ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
 # define __STDC_CONSTANT_MACROS
 #endif
 #include <stdint.h> // For int64_t
+#ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+#endif
+#ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+#endif
+
 #endif
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
index 2dfafa824f9060d3fb1b5293df3ef8a6a89b8d69..a6b74355483c91a4a659c6af4bb758256e38e597 100644 (file)
 
 #if _GLIBCXX_USE_C99_INTTYPES_TR1
 
-// For 8.11.1/1 (see C99, Note 184) 
-#define __STDC_FORMAT_MACROS
+// For 8.11.1/1 (see C99, Note 184)
+#ifndef __STDC_FORMAT_MACROS
+# define _UNDEF__STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS
+#endif
 #include_next <inttypes.h>
+#ifdef _UNDEF__STDC_FORMAT_MACROS
+# undef __STDC_FORMAT_MACROS
+# undef _UNDEF__STDC_FORMAT_MACROS
+#endif
 
 namespace std
 {
index 93edf7c4fcdff5cf690e772f168380dd2f54d423..7ba2fa0eb71ac15fc577c548d6fc71dd729dd92a 100644 (file)
 
 // For 8.22.1/1 (see C99, Notes 219, 220, 222)
 #ifndef __STDC_LIMIT_MACROS
+# define _UNDEF__STDC_LIMIT_MACROS
 # define __STDC_LIMIT_MACROS
 #endif
 #ifndef __STDC_CONSTANT_MACROS
+# define _UNDEF__STDC_CONSTANT_MACROS
 # define __STDC_CONSTANT_MACROS
 #endif
 #include_next <stdint.h>
+#ifdef _UNDEF__STDC_LIMIT_MACROS
+# undef __STDC_LIMIT_MACROS
+# undef _UNDEF__STDC_LIMIT_MACROS
+#endif
+#ifdef _UNDEF__STDC_CONSTANT_MACROS
+# undef __STDC_CONSTANT_MACROS
+# undef _UNDEF__STDC_CONSTANT_MACROS
+#endif
 
 namespace std
 {