[libcxx-commits] [libcxx] r364354 - Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 25 15:13:40 PDT 2019


Author: ericwf
Date: Tue Jun 25 15:13:39 2019
New Revision: 364354

URL: http://llvm.org/viewvc/llvm-project?rev=364354&view=rev
Log:
Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`
when _LIBCPP_ABI_UNSTABLE is defined.

User defined _LIBCPP_ABI_NAMESPACE will still be respected,
but the default version namespace in unstable mode will be the libc++ version
(Currently '__9000').

Previously  `_LIBCPP_ABI_VERSION` and `_LIBCPP_ABI_NAMESPACE` were
`1` and `__1` respectively, whuch conflicted with the stable ABI

Modified:
    libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=364354&r1=364353&r2=364354&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Tue Jun 25 15:13:39 2019
@@ -34,10 +34,6 @@
 
 #define _LIBCPP_VERSION 9000
 
-#ifndef _LIBCPP_ABI_VERSION
-#  define _LIBCPP_ABI_VERSION 1
-#endif
-
 #ifndef __STDC_HOSTED__
 #  define _LIBCPP_FREESTANDING
 #endif
@@ -66,7 +62,18 @@
 #  error Unknown object file format
 #endif
 
-#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
+#if defined(_LIBCPP_ABI_UNSTABLE)
+# ifdef _LIBCPP_ABI_VERSION
+#   error _LIBCPP_ABI_VERSION cannot be defined with _LIBCPP_ABI_UNSTABLE
+# endif
+# define _LIBCPP_ABI_VERSION _LIBCPP_VERSION
+#endif
+
+#ifndef _LIBCPP_ABI_VERSION
+#  define _LIBCPP_ABI_VERSION 1
+#endif
+
+#if _LIBCPP_ABI_VERSION >= 2
 // Change short string representation so that string data starts at offset 0,
 // improving its alignment in some cases.
 #  define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT




More information about the libcxx-commits mailing list