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

Eric Fiselier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 06:30:32 PDT 2019


EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

LGTM after moving the define to `<__config>`.



================
Comment at: libcxx/include/thread:110
 
-#define __STDCPP_THREADS__ __cplusplus
+#define __STDCPP_THREADS__ 1
 
----------------
thakis wrote:
> EricWF wrote:
> > This should be defined by the compiler, not the library. So we should only define it if it hasn't already been defined.
> Currently it's only defined if thread is included; in __config it'd always be defined. Is the latter what we want? If the compiler doesn't define it, if <thread> is included seems like an ok signal.
What if you want to use `__STDCPP_THREADS__` to determine if you can include thread?
Defining it in `<__config>` best matches the correct behavior of having the compiler predefine it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65370/new/

https://reviews.llvm.org/D65370





More information about the llvm-commits mailing list