]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Renamed bits/move_only_function.h to bits/funcwrap.h [PR119125]
authorTomasz Kamiński <tkaminsk@redhat.com>
Mon, 12 May 2025 09:06:34 +0000 (11:06 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Wed, 14 May 2025 13:00:41 +0000 (15:00 +0200)
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 <ppalka@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/doc/doxygen/stdheader.cc
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/funcwrap.h [moved from libstdc++-v3/include/bits/move_only_function.h with 98% similarity]
libstdc++-v3/include/std/functional

index 8a20133441006d87c1321d8b7c599248e1760515..839bfc81bc02d49da6cd01507903499356387284 100644 (file)
@@ -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";
index 5cc13381b025885eaa55d01cbf0d2dbc376a1c18..3e5b6c4142edd83144e5957a5a592951c7755b03 100644 (file)
@@ -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 \
index 6e5e97aa2362fe8f021e20755fb68e28387e26db..3531162b5f75ae6ce3f8b13d2868052800b4d319 100644 (file)
@@ -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 \
similarity index 98%
rename from libstdc++-v3/include/bits/move_only_function.h
rename to libstdc++-v3/include/bits/funcwrap.h
index b7328dbf4d89b85cb56580193fda40e35dc16ccf..4e053534cf57a293fb110220bd772dd6ccb199dd 100644 (file)
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @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
index 46179998eebc336e322a93ce3bef35ca20f92c65..9a55b181e6daf2c71f11ff46ca8d2b2903c8f23b 100644 (file)
 
 #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 <bits/version.h>
+
 #include <tuple>
 #include <type_traits>
 #include <bits/functional_hash.h>
 # include <bits/ranges_cmp.h> // std::identity, ranges::equal_to etc.
 # include <compare>
 #endif
-#if __cplusplus > 202002L && _GLIBCXX_HOSTED
-# include <bits/move_only_function.h>
+#if defined(__glibcxx_move_only_function) || defined(__glibcxx_copyable_function)
+# include <bits/funcwrap.h>
 #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 <bits/version.h>
-
 #endif // C++11
 
 namespace std _GLIBCXX_VISIBILITY(default)