]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix std.compat exports of <stdbit.h> and <stdckdint.h>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 20 Mar 2025 18:47:33 +0000 (18:47 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 21 Mar 2025 09:32:21 +0000 (09:32 +0000)
libstdc++-v3/ChangeLog:

* src/c++23/std.compat.cc.in: Only export <stdbit.h> and
<stdckdint.h> contents for C++26 and later.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
libstdc++-v3/src/c++23/std.compat.cc.in

index ba7ed0312ab89478b129d66d0c85eb7ae317396e..344502195b1c8f8a23383d95a7a6f3712a709692 100644 (file)
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-export module std.compat;
-export import std;
+module;
 
 #include <stdbit.h>
+#include <stdckdint.h>
+
+export module std.compat;
+export import std;
 
+#ifdef __STDC_VERSION_STDBIT_H__
 // <stdbit.h>
 export
 {
@@ -52,7 +56,9 @@ _GLIBCXX_STDBIT_FUNC(stdc_bit_floor);
 _GLIBCXX_STDBIT_FUNC(stdc_bit_ceil);
 #undef _GLIBCXX_STDBIT_FUNC
 }
+#endif
 
+#ifdef __STDC_VERSION_STDCKDINT_H__
 // <stdckdint.h>
 export
 {
@@ -60,6 +66,7 @@ export
   using __gnu_cxx::ckd_sub;
   using __gnu_cxx::ckd_mul;
 }
+#endif
 
 #define STD_COMPAT 1