[PATCH] D32265: Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 15:35:49 PDT 2017


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

I'm not thrilled about adding yet more predefined macros, but it really doesn't make sense for libc++ to depend on `__GCC_*` macros when targeting Windows, nor for these to be Windows-only, so let's do it.



================
Comment at: lib/Frontend/InitPreprocessor.cpp:910-912
+  addLockFreeMacros("__CLANG_ATOMIC");
+  if (!LangOpts.MSVCCompat)
+    addLockFreeMacros("__GCC_ATOMIC");
----------------
I'd sink the `_` into the prefix too, but this looks fine either way.


https://reviews.llvm.org/D32265





More information about the cfe-commits mailing list