ABI versioning macros for libc++.
C++ macros and CMake options that specify the default ABI version of the library, and can be overridden to pick up new ABI-changing features. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@250254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,7 +23,13 @@
|
||||
|
||||
#define _LIBCPP_VERSION 3800
|
||||
|
||||
#ifndef _LIBCPP_ABI_VERSION
|
||||
#define _LIBCPP_ABI_VERSION 1
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
|
||||
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
|
||||
#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
|
||||
@@ -240,9 +246,12 @@
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
#if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
|
||||
!defined(__arm__)
|
||||
#define _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
|
||||
// _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
|
||||
#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
|
||||
!defined(__arm__)) || \
|
||||
defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
|
||||
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
#endif
|
||||
|
||||
#if __has_feature(cxx_alignas)
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#ifndef _LIBCPP_CONFIG_SITE
|
||||
#define _LIBCPP_CONFIG_SITE
|
||||
|
||||
#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@
|
||||
#cmakedefine _LIBCPP_ABI_UNSTABLE
|
||||
#cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
|
||||
#cmakedefine _LIBCPP_HAS_NO_STDIN
|
||||
#cmakedefine _LIBCPP_HAS_NO_STDOUT
|
||||
|
||||
@@ -1185,7 +1185,7 @@ _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __basic_string_common<true>)
|
||||
#pragma warning( pop )
|
||||
#endif // _LIBCPP_MSVC
|
||||
|
||||
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
template <class _CharT, size_t = sizeof(_CharT)>
|
||||
struct __padding
|
||||
@@ -1198,7 +1198,7 @@ struct __padding<_CharT, 1>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
template<class _CharT, class _Traits, class _Allocator>
|
||||
class _LIBCPP_TYPE_VIS_ONLY basic_string
|
||||
@@ -1234,7 +1234,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
struct __long
|
||||
{
|
||||
@@ -1294,7 +1294,7 @@ private:
|
||||
value_type __data_[__min_cap];
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
union __ulx{__long __lx; __short __lxx;};
|
||||
|
||||
@@ -1698,7 +1698,7 @@ private:
|
||||
const allocator_type& __alloc() const _NOEXCEPT
|
||||
{return __r_.second();}
|
||||
|
||||
#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __set_short_size(size_type __s) _NOEXCEPT
|
||||
@@ -1716,7 +1716,7 @@ private:
|
||||
{return __r_.first().__s.__size_;}
|
||||
# endif
|
||||
|
||||
#else // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#else // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __set_short_size(size_type __s) _NOEXCEPT
|
||||
@@ -1734,7 +1734,7 @@ private:
|
||||
{return __r_.first().__s.__size_ >> 1;}
|
||||
# endif
|
||||
|
||||
#endif // _LIBCPP_ALTERNATE_STRING_LAYOUT
|
||||
#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __set_long_size(size_type __s) _NOEXCEPT
|
||||
|
||||
Reference in New Issue
Block a user