[libc++] Use __extension__ in a portable manner

llvm-svn: 370889
This commit is contained in:
Louis Dionne 2019-09-04 12:44:19 +00:00
parent 13dadedc29
commit 801f6a495c
2 changed files with 9 additions and 1 deletions

View File

@ -485,6 +485,8 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS
#endif
#define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__
#elif defined(_LIBCPP_COMPILER_GCC)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@ -520,6 +522,8 @@ typedef __char32_t char32_t;
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
#define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__
#elif defined(_LIBCPP_COMPILER_MSVC)
#define _LIBCPP_TOSTRING2(x) #x
@ -545,6 +549,8 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_VECTOR_EXTENSION
#define _LIBCPP_DISABLE_EXTENSION_WARNING
#elif defined(_LIBCPP_COMPILER_IBM)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@ -565,6 +571,8 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_VECTOR_EXTENSION
#define _LIBCPP_DISABLE_EXTENSION_WARNING
#endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
#if defined(_LIBCPP_OBJECT_FORMAT_COFF)

View File

@ -920,7 +920,7 @@ struct __cxx_atomic_base_impl {
#endif // _LIBCPP_CXX03_LANG
_LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp value) _NOEXCEPT
: __a_value(value) {}
__extension__ _Atomic(_Tp) __a_value;
_LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value;
};
#define __cxx_atomic_is_lock_free(__s) __c11_atomic_is_lock_free(__s)