From d27653b8a3ac605f2b034e0ddda40e5a1eaceb0c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 4 Aug 2008 12:05:41 +0000 Subject: [PATCH] postypes.h: Reinstate inclusion of ; also define the __STDC_* macros. 2008-08-04 Paolo Carlini * include/bits/postypes.h: Reinstate inclusion of ; also define the __STDC_* macros. (streamoff): Adjust. * include/tr1_impl/cstdint: Check that the __STDC_* macros are not defined before defining. From-SVN: r138608 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/bits/postypes.h | 19 ++++++++++++++----- libstdc++-v3/include/tr1_impl/cstdint | 12 ++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index be834051e0d..9e8a6e6700f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2008-08-04 Paolo Carlini + + * include/bits/postypes.h: Reinstate inclusion of ; + also define the __STDC_* macros. + (streamoff): Adjust. + + * include/tr1_impl/cstdint: Check that the __STDC_* macros are + not defined before defining. + 2008-08-01 Paolo Bonzini Chris Fairles diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h index 5ead488fa48..cdcafe2051f 100644 --- a/libstdc++-v3/include/bits/postypes.h +++ b/libstdc++-v3/include/bits/postypes.h @@ -46,6 +46,19 @@ #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... +#ifdef _GLIBCXX_HAVE_INT64_T +#ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif +#include // For int64_t +#endif + _GLIBCXX_BEGIN_NAMESPACE(std) // The types streamoff, streampos and wstreampos and the class @@ -64,11 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * was typedef long. */ #ifdef _GLIBCXX_HAVE_INT64_T -# if (__CHAR_BIT__ * __SIZEOF_LONG__ == 64) - typedef long streamoff; -# else - typedef long long streamoff; -# endif + typedef int64_t streamoff; #else typedef long long streamoff; #endif diff --git a/libstdc++-v3/include/tr1_impl/cstdint b/libstdc++-v3/include/tr1_impl/cstdint index 6df74c761cb..93edf7c4fcd 100644 --- a/libstdc++-v3/include/tr1_impl/cstdint +++ b/libstdc++-v3/include/tr1_impl/cstdint @@ -1,6 +1,6 @@ // TR1 cstdint -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -36,9 +36,13 @@ #if _GLIBCXX_USE_C99_STDINT_TR1 -// For 8.22.1/1 (see C99, Notes 219, 220, 222) -#define __STDC_LIMIT_MACROS -#define __STDC_CONSTANT_MACROS +// For 8.22.1/1 (see C99, Notes 219, 220, 222) +#ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif #include_next namespace std -- 2.30.2