From: Paolo Carlini Date: Tue, 9 Sep 2008 21:33:46 +0000 (+0000) Subject: cinttypes: Restore __STDC_FORMAT_MACRO after inclusion of . X-Git-Tag: releases/gcc-4.4.0~2532 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=802841eb8c993791522e6dadc4aa64fac3badec4;p=thirdparty%2Fgcc.git cinttypes: Restore __STDC_FORMAT_MACRO after inclusion of . 2008-09-09 Paolo Carlini * include/tr1_impl/cinttypes: Restore __STDC_FORMAT_MACRO after inclusion of . * include/tr1_impl/cstdint: Likewise for __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS after . * include/bits/postypes.h: Likewise. From-SVN: r140174 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d8f8b949e2fe..3adbedc0e1af 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2008-09-09 Paolo Carlini + + * include/tr1_impl/cinttypes: Restore __STDC_FORMAT_MACRO after + inclusion of . + * include/tr1_impl/cstdint: Likewise for __STDC_LIMIT_MACROS and + __STDC_CONSTANT_MACROS after . + * include/bits/postypes.h: Likewise. + 2008-09-09 Andreas Schwab * acinclude.m4 (GLIBCXX_CHECK_STANDARD_LAYOUT): Fix compile check diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h index 6d57a24701e0..c18628572064 100644 --- a/libstdc++-v3/include/bits/postypes.h +++ b/libstdc++-v3/include/bits/postypes.h @@ -46,18 +46,30 @@ #include // For mbstate_t -// XXX If is really needed, make sure to define the macros, -// in order not to break (and in C++0x). -// Reconsider all this as soon as possible... +// XXX If is really needed, make sure to define the macros +// before including it, in order not to break (and +// 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 // 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) diff --git a/libstdc++-v3/include/tr1_impl/cinttypes b/libstdc++-v3/include/tr1_impl/cinttypes index 2dfafa824f90..a6b74355483c 100644 --- a/libstdc++-v3/include/tr1_impl/cinttypes +++ b/libstdc++-v3/include/tr1_impl/cinttypes @@ -36,9 +36,16 @@ #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 +#ifdef _UNDEF__STDC_FORMAT_MACROS +# undef __STDC_FORMAT_MACROS +# undef _UNDEF__STDC_FORMAT_MACROS +#endif namespace std { diff --git a/libstdc++-v3/include/tr1_impl/cstdint b/libstdc++-v3/include/tr1_impl/cstdint index 93edf7c4fcdf..7ba2fa0eb71a 100644 --- a/libstdc++-v3/include/tr1_impl/cstdint +++ b/libstdc++-v3/include/tr1_impl/cstdint @@ -38,12 +38,22 @@ // 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 +#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 {