This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] libstdc++/64857 Rationalise PCH headers and 17_intro/headers tests.


On 11/09/15 13:25 +0100, Jonathan Wakely wrote:
diff --git a/libstdc++-v3/include/precompiled/extc++.h b/libstdc++-v3/include/precompiled/extc++.h
index de3775b..8883e47 100644
--- a/libstdc++-v3/include/precompiled/extc++.h
+++ b/libstdc++-v3/include/precompiled/extc++.h
@@ -28,15 +28,25 @@

#if __cplusplus < 201103L
#include <bits/stdtr1c++.h>
+#else
+#include <bits/stdc++.h>
#endif

#include <ext/algorithm>
+#if __cplusplus >= 201103L
+# include <ext/aligned_buffer.h>
+#endif
+#include <ext/alloc_traits.h>
#include <ext/array_allocator.h>
#include <ext/atomicity.h>
#include <ext/bitmap_allocator.h>
#include <ext/cast.h>
+#if __cplusplus >= 201103L
+# include <ext/cmath>
+#endif
#include <ext/concurrence.h>
#include <ext/debug_allocator.h>
+#include <ext/enc_filebuf.h>

Kai pointed out that <ext/enc_filebuf.h> is already included further
down, and guarded by _GLIBCXX_HAVE_ICONV, so doing it here breaks some
targets.

#include <ext/extptr_allocator.h>
#include <ext/functional>
#include <ext/iterator>
@@ -45,9 +55,13 @@
#include <ext/mt_allocator.h>
#include <ext/new_allocator.h>
#include <ext/numeric>
+#include <ext/numeric_traits.h>
#include <ext/pod_char_traits.h>
#include <ext/pointer.h>
#include <ext/pool_allocator.h>
+#if __cplusplus >= 201103L
+# include <ext/random>
+#endif

This breaks bootstrap on (at least) NetBSD 5.x because <ext/random>
uses UINT32_C. That fails due to https://gcc.gnu.org/PR65806 so I'm
checking for that macro in <ext/random> (and I also have a patch
coming to use GCC's own stdint.h on NetBSD 5).

Fixed by the attached patch.

Tested powerpc64le-linux and x86_64-netbsd5.1.

Committed to trunk.

commit c8d1af248beaa22b81d7606a14a2742028d20056
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Sep 18 11:35:11 2015 +0100

    Fix errors due to extra includes in extc++.h
    
    	* include/precompiled/extc++.h: Fix bootstrap error due to
    	unconditional inclusion of <ext/enc_filebuf.h>.
    	* include/ext/random: Check for definition of UINT32_C.

diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random
index be6db5d..0bcfa4a 100644
--- a/libstdc++-v3/include/ext/random
+++ b/libstdc++-v3/include/ext/random
@@ -43,7 +43,7 @@
 # include <x86intrin.h>
 #endif
 
-#ifdef _GLIBCXX_USE_C99_STDINT_TR1
+#if defined(_GLIBCXX_USE_C99_STDINT_TR1) && defined(UINT32_C)
 
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
@@ -3499,7 +3499,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
 #include "ext/opt_random.h"
 #include "random.tcc"
 
-#endif // _GLIBCXX_USE_C99_STDINT_TR1
+#endif // _GLIBCXX_USE_C99_STDINT_TR1 && UINT32_C
 
 #endif // C++11
 
diff --git a/libstdc++-v3/include/precompiled/extc++.h b/libstdc++-v3/include/precompiled/extc++.h
index 8883e47..31f5ec8 100644
--- a/libstdc++-v3/include/precompiled/extc++.h
+++ b/libstdc++-v3/include/precompiled/extc++.h
@@ -46,7 +46,6 @@
 #endif
 #include <ext/concurrence.h>
 #include <ext/debug_allocator.h>
-#include <ext/enc_filebuf.h>
 #include <ext/extptr_allocator.h>
 #include <ext/functional>
 #include <ext/iterator>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]