[libcxx-commits] [PATCH] D123519: [libc++] Define legacy symbols for inline functions at a finer-grained level

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 12 10:44:49 PDT 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0cc34ca7ecfc: [libc++] Define legacy symbols for inline functions at a finer-grained level (authored by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123519/new/

https://reviews.llvm.org/D123519

Files:
  libcxx/include/__memory/shared_ptr.h
  libcxx/include/system_error
  libcxx/src/memory.cpp
  libcxx/src/system_error.cpp


Index: libcxx/src/system_error.cpp
===================================================================
--- libcxx/src/system_error.cpp
+++ libcxx/src/system_error.cpp
@@ -6,8 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <__assert>
 #include <__config>
+#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+#   define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS
+#endif
+
+#include <__assert>
 #include <cerrno>
 #include <cstdio>
 #include <cstdlib>
@@ -26,7 +30,7 @@
 
 // class error_category
 
-#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
 error_category::error_category() noexcept
 {
 }
Index: libcxx/src/memory.cpp
===================================================================
--- libcxx/src/memory.cpp
+++ libcxx/src/memory.cpp
@@ -6,6 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include <__config>
+#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+#   define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS
+#endif
+
 #include <memory>
 
 #ifndef _LIBCPP_HAS_NO_THREADS
@@ -38,7 +43,7 @@
 {
 }
 
-#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
 void
 __shared_count::__add_shared() noexcept
 {
@@ -75,7 +80,7 @@
         __release_weak();
 }
 
-#endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+#endif // _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS
 
 void
 __shared_weak_count::__release_weak() noexcept
Index: libcxx/include/system_error
===================================================================
--- libcxx/include/system_error
+++ libcxx/include/system_error
@@ -202,8 +202,7 @@
 public:
     virtual ~error_category() _NOEXCEPT;
 
-#if defined(_LIBCPP_BUILDING_LIBRARY) && \
-    defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
     error_category() noexcept;
 #else
     _LIBCPP_INLINE_VISIBILITY
Index: libcxx/include/__memory/shared_ptr.h
===================================================================
--- libcxx/include/__memory/shared_ptr.h
+++ libcxx/include/__memory/shared_ptr.h
@@ -162,8 +162,7 @@
     explicit __shared_count(long __refs = 0) _NOEXCEPT
         : __shared_owners_(__refs) {}
 
-#if defined(_LIBCPP_BUILDING_LIBRARY) && \
-    defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
     void __add_shared() noexcept;
     bool __release_shared() noexcept;
 #else
@@ -200,8 +199,7 @@
     virtual ~__shared_weak_count();
 
 public:
-#if defined(_LIBCPP_BUILDING_LIBRARY) && \
-    defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
+#if defined(_LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS)
     void __add_shared() noexcept;
     void __add_weak() noexcept;
     void __release_shared() noexcept;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123519.422292.patch
Type: text/x-patch
Size: 3210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220412/34dce24c/attachment.bin>


More information about the libcxx-commits mailing list