[libcxx-commits] [PATCH] D65370: libcxx: Define __STDCPP_THREADS__ to 1, not to __cplusplus.

Nico Weber via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 27 10:25:35 PDT 2019


thakis created this revision.
thakis added a reviewer: EricWF.
Herald added a subscriber: christof.

[cpp.predefined]p2:

  __STDCPP_THREADS__
   Defined, and has the value integer literal 1, if and only if a program
   can have more than one thread of execution .

Part of PR33230.


https://reviews.llvm.org/D65370

Files:
  libcxx/include/thread
  libcxx/test/std/thread/macro.pass.cpp


Index: libcxx/test/std/thread/macro.pass.cpp
===================================================================
--- libcxx/test/std/thread/macro.pass.cpp
+++ libcxx/test/std/thread/macro.pass.cpp
@@ -10,7 +10,7 @@
 
 // <thread>
 
-// #define __STDCPP_THREADS__ __cplusplus
+// #define __STDCPP_THREADS__ 1
 
 #include <thread>
 
Index: libcxx/include/thread
===================================================================
--- libcxx/include/thread
+++ libcxx/include/thread
@@ -14,7 +14,7 @@
 
     thread synopsis
 
-#define __STDCPP_THREADS__ __cplusplus
+#define __STDCPP_THREADS__ 1
 
 namespace std
 {
@@ -107,7 +107,7 @@
 _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
-#define __STDCPP_THREADS__ __cplusplus
+#define __STDCPP_THREADS__ 1
 
 #ifdef _LIBCPP_HAS_NO_THREADS
 #error <thread> is not supported on this single threaded system


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65370.212063.patch
Type: text/x-patch
Size: 851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190727/e5fec0bf/attachment.bin>


More information about the libcxx-commits mailing list