https://gcc.gnu.org/g:d9055d010475fa1c624d6036881eee9c37034b21

commit r16-620-gd9055d010475fa1c624d6036881eee9c37034b21
Author: Tomasz Kamiński <tkami...@redhat.com>
Date:   Mon May 12 11:06:34 2025 +0200

    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 <ppa...@redhat.com>
    Reviewed-by: Jonathan Wakely <jwak...@redhat.com>
    Signed-off-by: Tomasz Kamiński <tkami...@redhat.com>

Diff:
---
 libstdc++-v3/doc/doxygen/stdheader.cc              |  2 +-
 libstdc++-v3/include/Makefile.am                   |  2 +-
 libstdc++-v3/include/Makefile.in                   |  2 +-
 .../bits/{move_only_function.h => funcwrap.h}      |  8 +++---
 libstdc++-v3/include/std/functional                | 32 +++++++++++-----------
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/libstdc++-v3/doc/doxygen/stdheader.cc 
b/libstdc++-v3/doc/doxygen/stdheader.cc
index 8a2013344100..839bfc81bc02 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 5cc13381b025..3e5b6c4142ed 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 6e5e97aa2362..3531162b5f75 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 b7328dbf4d89..4e053534cf57 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
 // <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
diff --git a/libstdc++-v3/include/std/functional 
b/libstdc++-v3/include/std/functional
index 46179998eebc..9a55b181e6da 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 <bits/version.h>
+
 #include <tuple>
 #include <type_traits>
 #include <bits/functional_hash.h>
@@ -72,24 +86,10 @@
 # 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)

Reply via email to