[libcxx-commits] [libcxx] 24c12bf - [libc++] __config cleanup; _LIBCPP_ABI_UNSTABLE should set _LIBCPP_ABI_VERSION
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Feb 5 03:02:42 PST 2022
Author: Nikolas Klauser
Date: 2022-02-05T12:00:54+01:00
New Revision: 24c12bfb3345f8ea71471c59c6689f0148360813
URL: https://github.com/llvm/llvm-project/commit/24c12bfb3345f8ea71471c59c6689f0148360813
DIFF: https://github.com/llvm/llvm-project/commit/24c12bfb3345f8ea71471c59c6689f0148360813.diff
LOG: [libc++] __config cleanup; _LIBCPP_ABI_UNSTABLE should set _LIBCPP_ABI_VERSION
Some `__config` cleanup and `_LIBCPP_ABI_UNSTABLE` should set `_LIBCPP_ABI_VERSION`, since the latest ABI version //is// the unstable ABI.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D118989
Added:
Modified:
libcxx/include/__config
Removed:
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index ffcf9fd646aa5..14e96c9fd40b8 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -26,6 +26,10 @@
#define _LIBCPP_VERSION 15000
+#ifdef _LIBCPP_ABI_UNSTABLE
+# define _LIBCPP_ABI_VERSION 2
+#endif
+
#ifndef _LIBCPP_ABI_VERSION
# define _LIBCPP_ABI_VERSION 1
#endif
@@ -44,7 +48,7 @@
# elif __cplusplus <= 202002L
# define _LIBCPP_STD_VER 20
# else
-# define _LIBCPP_STD_VER 21 // current year, or date of c++2b ratification
+# define _LIBCPP_STD_VER 22 // current year, or date of c++2b ratification
# endif
#endif // _LIBCPP_STD_VER
@@ -60,7 +64,7 @@
// ... add new file formats here ...
#endif
-#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
+#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
@@ -151,7 +155,7 @@
# define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR
#endif
-#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
+#if defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_ABI_VERSION >= 2
// Enable additional explicit instantiations of iostreams components. This
// reduces the number of weak definitions generated in programs that use
// iostreams by providing a single strong definition in the shared library.
@@ -837,7 +841,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
#define _LIBCPP_END_NAMESPACE_FILESYSTEM \
_LIBCPP_END_NAMESPACE_STD } }
-#define _VSTD_FS _VSTD::__fs::filesystem
+#define _VSTD_FS std::__fs::filesystem
#if __has_attribute(__enable_if__)
# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
@@ -1020,13 +1024,13 @@ typedef unsigned int char32_t;
# define _LIBCPP_DEPRECATED_IN_CXX11
#endif
-#if _LIBCPP_STD_VER >= 14
+#if _LIBCPP_STD_VER > 11
# define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
#else
# define _LIBCPP_DEPRECATED_IN_CXX14
#endif
-#if _LIBCPP_STD_VER >= 17
+#if _LIBCPP_STD_VER > 14
# define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
#else
# define _LIBCPP_DEPRECATED_IN_CXX17
@@ -1287,7 +1291,7 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
#endif
// Use a function like macro to imply that it must be followed by a semicolon
-#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
+#if _LIBCPP_STD_VER > 14 && __has_cpp_attribute(fallthrough)
# define _LIBCPP_FALLTHROUGH() [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
# define _LIBCPP_FALLTHROUGH() [[clang::fallthrough]]
More information about the libcxx-commits
mailing list