]> granicus.if.org Git - clang/commit
Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.
authorEric Fiselier <eric@efcs.ca>
Thu, 20 Apr 2017 22:53:57 +0000 (22:53 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 20 Apr 2017 22:53:57 +0000 (22:53 +0000)
commit158094675940142068ac417223dbf7a25b211baa
tree26995cac4e6760e41cf2c1830da5b10cca203e21
parentb8a9d6cf3ba65f6c2048db8df7a8bdd946613815
Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.

Summary:
Libc++ currently implements the `ATOMIC_<TYPE>_LOCK_FREE` macros using the `__GCC_ATOMIC_<TYPE>_LOCK_FREE` macros. However these are not available when MSVC compatibility is enabled even though C11 `_Atomic` is.  This prevents libc++ from correctly implementing `ATOMIC_<TYPE>_LOCK_FREE`.

This patch adds an alternative spelling `__CLANG_ATOMIC_<TYPE>_LOCK_FREE` that is enabled with `-fms-compatibility`.

Reviewers: rsmith, aaron.ballman, majnemer, zturner, compnerd, jfb, rnk

Reviewed By: rsmith

Subscribers: BillyONeal, smeenai, jfb, cfe-commits, dschuff

Differential Revision: https://reviews.llvm.org/D32265

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300914 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/InitPreprocessor.cpp
test/Preprocessor/init.c
test/Sema/atomic-ops.c