public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: gcc-patches@gcc.gnu.org
Cc: libstdc++@gcc.gnu.org, "Jonathan Wakely" <jwakely@redhat.com>,
	"Arsen Arsenović" <arsen@aarsen.me>
Subject: [PATCH 03/10] libstdc++: Adjust precompiled headers for freestanding
Date: Fri, 30 Sep 2022 18:45:49 +0200	[thread overview]
Message-ID: <20220930164556.1198044-4-arsen@aarsen.me> (raw)
In-Reply-To: <20220930164556.1198044-1-arsen@aarsen.me>

From: Jonathan Wakely <jwakely@redhat.com>

Co-authored-by: Arsen Arsenović <arsen@aarsen.me>

libstdc++-v3/ChangeLog:

	* include/precompiled/extc++.h [!_GLIBCXX_HOSTED]: Do not
	include headers that aren't valid for freestanding.
	* include/precompiled/stdc++.h [!_GLIBCXX_HOSTED]: Likewise.

Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
---
 libstdc++-v3/include/precompiled/extc++.h | 17 +++--
 libstdc++-v3/include/precompiled/stdc++.h | 81 +++++++++++++++++++++--
 2 files changed, 86 insertions(+), 12 deletions(-)

diff --git a/libstdc++-v3/include/precompiled/extc++.h b/libstdc++-v3/include/precompiled/extc++.h
index 7fe70738042..b094701aafb 100644
--- a/libstdc++-v3/include/precompiled/extc++.h
+++ b/libstdc++-v3/include/precompiled/extc++.h
@@ -32,14 +32,21 @@
 #include <bits/stdc++.h>
 #endif
 
-#include <ext/algorithm>
 #if __cplusplus >= 201103L
 # include <ext/aligned_buffer.h>
 #endif
 #include <ext/alloc_traits.h>
 #include <ext/atomicity.h>
-#include <ext/bitmap_allocator.h>
 #include <ext/cast.h>
+#include <ext/iterator>
+#include <ext/numeric_traits.h>
+#include <ext/pointer.h>
+#include <ext/typelist.h>
+#include <ext/type_traits.h>
+
+#if _GLIBCXX_HOSTED
+#include <ext/algorithm>
+#include <ext/bitmap_allocator.h>
 #if __cplusplus >= 201103L
 # include <ext/cmath>
 #endif
@@ -47,15 +54,12 @@
 #include <ext/debug_allocator.h>
 #include <ext/extptr_allocator.h>
 #include <ext/functional>
-#include <ext/iterator>
 #include <ext/malloc_allocator.h>
 #include <ext/memory>
 #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>
@@ -66,8 +70,6 @@
 #include <ext/stdio_filebuf.h>
 #include <ext/stdio_sync_filebuf.h>
 #include <ext/throw_allocator.h>
-#include <ext/typelist.h>
-#include <ext/type_traits.h>
 #include <ext/vstring.h>
 #include <ext/pb_ds/assoc_container.hpp>
 #include <ext/pb_ds/priority_queue.hpp>
@@ -81,3 +83,4 @@
  #include <ext/codecvt_specializations.h>
  #include <ext/enc_filebuf.h>
 #endif
+#endif // HOSTED
diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index 5ee1244dc22..bfbb1654b88 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -28,6 +28,80 @@
 
 // 17.4.1.2 Headers
 
+// C
+#ifndef _GLIBCXX_NO_ASSERT
+#include <cassert>
+#endif
+#include <cctype>
+#include <cfloat>
+#include <ciso646>
+#include <climits>
+#include <csetjmp>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdlib>
+
+#if __cplusplus >= 201103L
+#include <cstdint>
+#endif
+
+// C++
+// #include <bitset>
+// #include <complex>
+#include <algorithm>
+#include <bitset>
+#include <functional>
+#include <iterator>
+#include <limits>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <typeinfo>
+#include <utility>
+
+#if __cplusplus >= 201103L
+#include <array>
+#include <atomic>
+#include <initializer_list>
+#include <ratio>
+#include <scoped_allocator>
+#include <tuple>
+#include <typeindex>
+#include <type_traits>
+#endif
+
+#if __cplusplus >= 201402L
+#endif
+
+#if __cplusplus >= 201703L
+#include <any>
+#include <charconv>
+// #include <execution>
+#include <optional>
+#include <variant>
+#endif
+
+#if __cplusplus >= 202002L
+#include <bit>
+#include <compare>
+#include <concepts>
+#include <numbers>
+#include <ranges>
+#include <span>
+#include <source_location>
+#include <version>
+#endif
+
+#if __cplusplus > 202002L
+#include <expected>
+#include <stdatomic.h>
+#if __cpp_impl_coroutine
+# include <coroutine>
+#endif
+#endif
+
+
+#if _GLIBCXX_HOSTED
 // C
 #ifndef _GLIBCXX_NO_ASSERT
 #include <cassert>
@@ -62,8 +136,6 @@
 #endif
 
 // C++
-#include <algorithm>
-#include <bitset>
 #include <complex>
 #include <deque>
 #include <exception>
@@ -138,9 +210,6 @@
 #include <bit>
 #include <compare>
 #include <concepts>
-#if __cpp_impl_coroutine
-# include <coroutine>
-#endif
 #include <latch>
 #include <numbers>
 #include <ranges>
@@ -160,3 +229,5 @@
 #endif
 #include <stdatomic.h>
 #endif
+
+#endif // HOSTED
-- 
2.37.3


  parent reply	other threads:[~2022-09-30 16:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 16:45 [PATCH 00/10] c-family,libstdc++: P1642 and related changes Arsen Arsenović
2022-09-30 16:45 ` [PATCH 01/10] libstdc++: Make _GLIBCXX_HOSTED respect -ffreestanding [PR103626] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 02/10] libstdc++: Filter out unconditional <stdio.h> default include Arsen Arsenović
2022-09-30 16:45 ` Arsen Arsenović [this message]
2022-09-30 16:45 ` [PATCH 04/10] libstdc++: Mark headers that must be hosted as such [PR103626] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 05/10] c-family: Implement new `int main' semantics in freestanding Arsen Arsenović
2022-09-30 16:45 ` [PATCH 06/10] libstdc++: Rework how freestanding install works [PR106953] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 07/10] libstdc++: Make some tests work on freestanding [PR103626] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 08/10] libstdc++: Add effective-target 'hosted' for testsuite [PR103626] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 09/10] libstdc++: Re-enable std::hash<std::bitset> in freestanding [PR103626] Arsen Arsenović
2022-09-30 16:45 ` [PATCH 10/10] libstdc++: Disable hosted-only tests [PR103626] Arsen Arsenović
2022-09-30 18:15 ` [PATCH 00/10] c-family,libstdc++: P1642 and related changes Jonathan Wakely
2022-10-03 14:49   ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220930164556.1198044-4-arsen@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).