[libcxx-commits] [libcxx] b6ff5b4 - [libc++] Use XXYYZZ instead of XXYZZ for _LIBCPP_VERSION

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 26 08:22:28 PDT 2022


Author: Louis Dionne
Date: 2022-09-26T11:22:04-04:00
New Revision: b6ff5b470d5e4acfde59d57f18e575c0284941f4

URL: https://github.com/llvm/llvm-project/commit/b6ff5b470d5e4acfde59d57f18e575c0284941f4
DIFF: https://github.com/llvm/llvm-project/commit/b6ff5b470d5e4acfde59d57f18e575c0284941f4.diff

LOG: [libc++] Use XXYYZZ instead of XXYZZ for _LIBCPP_VERSION

As discussed on Discord.

Differential Revision: https://reviews.llvm.org/D134209

Added: 
    

Modified: 
    libcxx/docs/ReleaseNotes.rst
    libcxx/include/__config

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 2b1683af088f2..aad7dba31e9d2 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -86,6 +86,12 @@ API Changes
   Any standards-required ``[[nodiscard]]`` applications in C++20 are now always enabled. Any extended applications
   are now enabled by default and can be disabled by defining ``_LIBCPP_DISABLE_NODISCARD_EXT``.
 
+- ``_LIBCPP_VERSION`` was previously defined to e.g. ``15001`` to represent LLVM 15.0.01, but this value had been
+  left undocumented. Starting with LLVM 16, ``_LIBCPP_VERSION`` will contain the version of LLVM represented as
+  ``XXYYZZ``. In other words, ``_LIBCPP_VERSION`` is gaining a digit. This should not be an issue for existing
+  code, since using e.g. ``_LIBCPP_VERSION > 15000`` will still give the right answer now that ``_LIBCPP_VERSION``
+  is defined as e.g. ``160000`` (with one more digit).
+
 ABI Affecting Changes
 ---------------------
 - In freestanding mode, ``atomic<small enum class>`` does not contain a lock byte anymore if the platform

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index cfe2b20bdd3c4..e83b579b094bd 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -25,9 +25,9 @@
 #ifdef __cplusplus
 
 // _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
-// Given a LLVM release LLVM XX.Y.ZZ (e.g. LLVM 16.0.1 == 16.0.01), _LIBCPP_VERSION is
-// defined to XXYZZ.
-#  define _LIBCPP_VERSION 16000
+// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 16.0.1 == 16.00.01), _LIBCPP_VERSION is
+// defined to XXYYZZ.
+#  define _LIBCPP_VERSION 160000
 
 #  define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
 #  define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)


        


More information about the libcxx-commits mailing list