[libcxx-commits] [PATCH] D118989: [libc++] __config cleanup; _LIBCPP_ABI_UNSTABLE should set _LIBCPP_ABI_VERSION

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 4 05:32:44 PST 2022


philnik created this revision.
philnik added reviewers: ldionne, Quuxplusone, Mordante, var-const.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Some `__config` cleanup and `_LIBCPP_ABI_UNSTABLE` should set `_LIBCPP_ABI_VERSION`, since the latest ABI version //is// the unstable ABI.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118989

Files:
  libcxx/include/__config


Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ 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 @@
 #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 @@
 #  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 @@
 #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]]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118989.405932.patch
Type: text/x-patch
Size: 2528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220204/3f97aaae/attachment-0001.bin>


More information about the libcxx-commits mailing list