aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2008-08-04 12:05:41 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-08-04 12:05:41 +0000
commitd27653b8a3ac605f2b034e0ddda40e5a1eaceb0c (patch)
treecfa3bed915b4c68e64748c2e9161fc876df70878 /libstdc++-v3
parent382dbcb228d2dcd9c663a46f063266f1698a7061 (diff)
downloadgcc-d27653b8a3ac605f2b034e0ddda40e5a1eaceb0c.zip
gcc-d27653b8a3ac605f2b034e0ddda40e5a1eaceb0c.tar.gz
gcc-d27653b8a3ac605f2b034e0ddda40e5a1eaceb0c.tar.bz2
postypes.h: Reinstate inclusion of <stdint.h>; also define the __STDC_* macros.
2008-08-04 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/postypes.h: Reinstate inclusion of <stdint.h>; also define the __STDC_* macros. (streamoff): Adjust. * include/tr1_impl/cstdint: Check that the __STDC_* macros are not defined before defining. From-SVN: r138608
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/include/bits/postypes.h19
-rw-r--r--libstdc++-v3/include/tr1_impl/cstdint12
3 files changed, 31 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index be83405..9e8a6e6 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2008-08-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/postypes.h: Reinstate inclusion of <stdint.h>;
+ 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 <bonzini@gnu.org>
Chris Fairles <chris.fairles@gmail.com>
diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h
index 5ead488..cdcafe2 100644
--- a/libstdc++-v3/include/bits/postypes.h
+++ b/libstdc++-v3/include/bits/postypes.h
@@ -46,6 +46,19 @@
#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...
+#ifdef _GLIBCXX_HAVE_INT64_T
+#ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+#endif
+#ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS
+#endif
+#include <stdint.h> // 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 6df74c7..93edf7c 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 <stdint.h>
namespace std