This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] c_compatiblity includes for non-c++0x
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 26 Mar 2007 12:45:53 +0200
- Subject: [v3] c_compatiblity includes for non-c++0x
Consistent fixups for the issue that Richard Guenther found on Friday.
tested x86/linux
best,
benjamin
2007-03-26 Benjamin Kosnik <bkoz@redhat.com>
* include/c_compatibility/complex.h: Without
__GXX_EXPERIMENTAL_CXX0X__ include_next complex.h.
* include/c_compatibility/fenv.h: Same.
* include/c_compatibility/inttypes.h: Same.
* include/c_compatibility/stdbool.h: Same.
* include/c_compatibility/stdint.h: Same.
* include/c_compatibility/tgmath.h: Same.
* include/tr1/cinttypes: Use include_next.
* include/tr1/cstdint: Same.
* include/tr1/cstdbool: Same.
* acinclude.m4 (GLIBCXX_ENABLE_C99): Add check for tgmath.h
* configure: Regenerate.
* config.h.in: Same.
Index: include/tr1/cinttypes
===================================================================
--- include/tr1/cinttypes (revision 123210)
+++ include/tr1/cinttypes (working copy)
@@ -1,6 +1,6 @@
// TR1 cinttypes -*- C++ -*-
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -41,7 +41,7 @@
// For 8.11.1/1 (see C99, Note 184)
#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
+#include_next <inttypes.h>
// namespace std::tr1
namespace std
Index: include/tr1/cstdint
===================================================================
--- include/tr1/cstdint (revision 123210)
+++ include/tr1/cstdint (working copy)
@@ -1,6 +1,6 @@
// TR1 cstdint -*- C++ -*-
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -41,7 +41,7 @@
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
-#include <stdint.h>
+#include_next <stdint.h>
// namespace std::tr1
namespace std
Index: include/tr1/cstdbool
===================================================================
--- include/tr1/cstdbool (revision 123210)
+++ include/tr1/cstdbool (working copy)
@@ -1,6 +1,6 @@
// TR1 cstdbool -*- C++ -*-
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 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
@@ -37,7 +37,7 @@
#include <bits/c++config.h>
#if _GLIBCXX_HAVE_STDBOOL_H
-#include <stdbool.h>
+#include_next <stdbool.h>
#endif
#endif
Index: include/c_compatibility/fenv.h
===================================================================
--- include/c_compatibility/fenv.h (revision 123210)
+++ include/c_compatibility/fenv.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <cfenv>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <cfenv>
+#else
+# if _GLIBCXX_HAVE_FENV_H
+# include_next <fenv.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_FENV_H
#define _GLIBCXX_FENV_H 1
Index: include/c_compatibility/stdint.h
===================================================================
--- include/c_compatibility/stdint.h (revision 123210)
+++ include/c_compatibility/stdint.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <cstdint>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <cstdint>
+#else
+# if _GLIBCXX_HAVE_STDINT_H
+# include_next <stdint.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_STDINT_H
#define _GLIBCXX_STDINT_H 1
Index: include/c_compatibility/stdbool.h
===================================================================
--- include/c_compatibility/stdbool.h (revision 123210)
+++ include/c_compatibility/stdbool.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <cstdbool>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <cstdbool>
+#else
+# if _GLIBCXX_HAVE_STDBOOL_H
+# include_next <stdbool.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_STDBOOL_H
#define _GLIBCXX_STDBOOL_H 1
Index: include/c_compatibility/complex.h
===================================================================
--- include/c_compatibility/complex.h (revision 123210)
+++ include/c_compatibility/complex.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <ccomplex>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ccomplex>
+#else
+# if _GLIBCXX_HAVE_COMPLEX_H
+# include_next <complex.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_COMPLEX_H
#define _GLIBCXX_COMPLEX_H 1
Index: include/c_compatibility/inttypes.h
===================================================================
--- include/c_compatibility/inttypes.h (revision 123210)
+++ include/c_compatibility/inttypes.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <cinttypes>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <cinttypes>
+#else
+# if _GLIBCXX_HAVE_INTTYPES_H
+# include_next <inttypes.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_INTTYPES_H
#define _GLIBCXX_INTTYPES_H 1
Index: include/c_compatibility/tgmath.h
===================================================================
--- include/c_compatibility/tgmath.h (revision 123210)
+++ include/c_compatibility/tgmath.h (working copy)
@@ -31,8 +31,16 @@
* This is a Standard C++ Library header.
*/
-#include <ctgmath>
+#include <bits/c++config.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+# include <ctgmath>
+#else
+# if _GLIBCXX_HAVE_TGMATH_H
+# include_next <tgmath.h>
+# endif
+#endif
+
#ifndef _GLIBCXX_TGMATH_H
#define _GLIBCXX_TGMATH_H 1
Index: acinclude.m4
===================================================================
--- acinclude.m4 (revision 123210)
+++ acinclude.m4 (working copy)
@@ -795,6 +795,7 @@
# This is necessary even though libstdc++ uses the builtin versions
# of these functions, because if the builtin cannot be used, a reference
# to the library function is emitted.
+ AC_CHECK_HEADERS(tgmath.h, ac_has_tgmath_h=yes, ac_has_tgmath_h=no)
AC_CHECK_HEADERS(complex.h, ac_has_complex_h=yes, ac_has_complex_h=no)
ac_c99_complex=no;
if test x"$ac_has_complex_h" = x"yes"; then