From: Tomasz Kamiński Date: Mon, 12 May 2025 09:06:34 +0000 (+0200) Subject: libstdc++: Renamed bits/move_only_function.h to bits/funcwrap.h [PR119125] X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9055d010475fa1c624d6036881eee9c37034b21;p=thirdparty%2Fgcc.git libstdc++: Renamed bits/move_only_function.h to bits/funcwrap.h [PR119125] The file now includes copyable_function in addition to move_only_function. PR libstdc++/119125 libstdc++-v3/ChangeLog: * include/bits/move_only_function.h: Move to... * include/bits/funcwrap.h: ...here. * doc/doxygen/stdheader.cc (init_map): Replaced move_only_function.h with funcwrap.h, and changed include guard to use feature test macro. Move bits/version.h include before others. * include/Makefile.am: Likewise. * include/Makefile.in: Likewise. * include/std/functional: Likewise. Reviewed-by: Patrick Palka Reviewed-by: Jonathan Wakely Signed-off-by: Tomasz Kamiński --- diff --git a/libstdc++-v3/doc/doxygen/stdheader.cc b/libstdc++-v3/doc/doxygen/stdheader.cc index 8a201334410..839bfc81bc0 100644 --- a/libstdc++-v3/doc/doxygen/stdheader.cc +++ b/libstdc++-v3/doc/doxygen/stdheader.cc @@ -55,7 +55,7 @@ void init_map() headers["functional_hash.h"] = "functional"; headers["mofunc_impl.h"] = "functional"; headers["cpyfunc_impl.h"] = "functional"; - headers["move_only_function.h"] = "functional"; + headers["funcwrap.h"] = "functional"; headers["invoke.h"] = "functional"; headers["ranges_cmp.h"] = "functional"; headers["refwrap.h"] = "functional"; diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 5cc13381b02..3e5b6c4142e 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -205,6 +205,7 @@ bits_headers = \ ${bits_srcdir}/fs_ops.h \ ${bits_srcdir}/fs_path.h \ ${bits_srcdir}/fstream.tcc \ + ${bits_srcdir}/funcwrap.h \ ${bits_srcdir}/gslice.h \ ${bits_srcdir}/gslice_array.h \ ${bits_srcdir}/hashtable.h \ @@ -224,7 +225,6 @@ bits_headers = \ ${bits_srcdir}/mask_array.h \ ${bits_srcdir}/memory_resource.h \ ${bits_srcdir}/mofunc_impl.h \ - ${bits_srcdir}/move_only_function.h \ ${bits_srcdir}/new_allocator.h \ ${bits_srcdir}/node_handle.h \ ${bits_srcdir}/ostream.tcc \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 6e5e97aa236..3531162b5f7 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -558,6 +558,7 @@ bits_freestanding = \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/fs_ops.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/fs_path.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/fstream.tcc \ +@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/funcwrap.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/gslice.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/gslice_array.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/hashtable.h \ @@ -577,7 +578,6 @@ bits_freestanding = \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/mask_array.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/memory_resource.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/mofunc_impl.h \ -@GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/move_only_function.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/new_allocator.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/node_handle.h \ @GLIBCXX_HOSTED_TRUE@ ${bits_srcdir}/ostream.tcc \ diff --git a/libstdc++-v3/include/bits/move_only_function.h b/libstdc++-v3/include/bits/funcwrap.h similarity index 98% rename from libstdc++-v3/include/bits/move_only_function.h rename to libstdc++-v3/include/bits/funcwrap.h index b7328dbf4d8..4e053534cf5 100644 --- a/libstdc++-v3/include/bits/move_only_function.h +++ b/libstdc++-v3/include/bits/funcwrap.h @@ -22,13 +22,13 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file include/bits/move_only_function.h +/** @file include/bits/funcwrap.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ -#ifndef _GLIBCXX_MOVE_ONLY_FUNCTION_H -#define _GLIBCXX_MOVE_ONLY_FUNCTION_H 1 +#ifndef _GLIBCXX_FUNCWRAP_H +#define _GLIBCXX_FUNCWRAP_H 1 #ifdef _GLIBCXX_SYSHDR #pragma GCC system_header @@ -504,4 +504,4 @@ _GLIBCXX_END_NAMESPACE_VERSION #endif // __glibcxx_copyable_function #endif // __glibcxx_copyable_function || __glibcxx_copyable_function -#endif // _GLIBCXX_MOVE_ONLY_FUNCTION_H +#endif // _GLIBCXX_FUNCWRAP_H diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 46179998eeb..9a55b181e6d 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -52,6 +52,20 @@ #if __cplusplus >= 201103L +#define __glibcxx_want_boyer_moore_searcher +#define __glibcxx_want_bind_front +#define __glibcxx_want_bind_back +#define __glibcxx_want_constexpr_functional +#define __glibcxx_want_copyable_function +#define __glibcxx_want_invoke +#define __glibcxx_want_invoke_r +#define __glibcxx_want_move_only_function +#define __glibcxx_want_not_fn +#define __glibcxx_want_ranges +#define __glibcxx_want_reference_wrapper +#define __glibcxx_want_transparent_operators +#include + #include #include #include @@ -72,24 +86,10 @@ # include // std::identity, ranges::equal_to etc. # include #endif -#if __cplusplus > 202002L && _GLIBCXX_HOSTED -# include +#if defined(__glibcxx_move_only_function) || defined(__glibcxx_copyable_function) +# include #endif -#define __glibcxx_want_boyer_moore_searcher -#define __glibcxx_want_bind_front -#define __glibcxx_want_bind_back -#define __glibcxx_want_constexpr_functional -#define __glibcxx_want_copyable_function -#define __glibcxx_want_invoke -#define __glibcxx_want_invoke_r -#define __glibcxx_want_move_only_function -#define __glibcxx_want_not_fn -#define __glibcxx_want_ranges -#define __glibcxx_want_reference_wrapper -#define __glibcxx_want_transparent_operators -#include - #endif // C++11 namespace std _GLIBCXX_VISIBILITY(default)