[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
Mon Jul 29 07:37:11 PDT 2019
thakis updated this revision to Diff 212148.
thakis marked an inline comment as done.
thakis edited the summary of this revision.
thakis added a comment.
remove from synopsis, define conditional, add test for value
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65370/new/
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>
@@ -20,6 +20,8 @@
{
#ifndef __STDCPP_THREADS__
#error __STDCPP_THREADS__ is not defined
+#elif __STDCPP_THREADS__ != 1
+#error __STDCPP_THREADS__ has the wrong value
#endif
return 0;
Index: libcxx/include/thread
===================================================================
--- libcxx/include/thread
+++ libcxx/include/thread
@@ -14,8 +14,6 @@
thread synopsis
-#define __STDCPP_THREADS__ __cplusplus
-
namespace std
{
@@ -107,7 +105,9 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
-#define __STDCPP_THREADS__ __cplusplus
+#ifndef __STDCPP_THREADS__
+#define __STDCPP_THREADS__ 1
+#endif
#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.212148.patch
Type: text/x-patch
Size: 1051 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190729/a6ee9f31/attachment.bin>
More information about the libcxx-commits
mailing list