https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63287

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Library patch:

diff --git a/libgcc/gthr.h b/libgcc/gthr.h
index f31cf083cbe5..e6462679b362 100644
--- a/libgcc/gthr.h
+++ b/libgcc/gthr.h
@@ -147,6 +147,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. 
If not, see
 #endif
 #include "gthr-default.h"

+#if defined __GTHREADS_CXX0X && ! defined __STDCPP_THREADS__
+// The C++ standard says that __STDCPP_THREADS__ should be defined to 1,
+// but G++ does not currently do that (PR c++/63287).
+// Define it here if gthr-default.h defined __GTHREADS_CXX0X.
+# define __STDCPP_THREADS__ 1
+#endif
+
 #ifndef HIDE_EXPORTS
 #pragma GCC visibility pop
 #endif
diff --git a/libstdc++-v3/include/Makefile.am
b/libstdc++-v3/include/Makefile.am
index 292d89da8ba7..74e3e4932579 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -1316,6 +1316,7 @@ uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]

 ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
        sed -e '/^#pragma/b' \
+           -e '/__STDCPP_THREADS__/b' \
            -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
            -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
            -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \

Reply via email to