[libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since _LIBCPP_BUILDING_LIBRARY
Summary: As suggested by Marshall in https://reviews.llvm.org/D49914
Reviewers: mclow.lists, EricWF
Subscribers: christof, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D50008
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338475 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__functional_base b/include/__functional_base
index 1a90bd6..57fdf2b 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -561,7 +561,7 @@
struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
extern const allocator_arg_t allocator_arg;
#else
/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t();
diff --git a/include/__mutex_base b/include/__mutex_base
index 402a52d..4659ca9 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -74,7 +74,7 @@
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
struct _LIBCPP_TYPE_VIS adopt_lock_t {};
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MUTEX)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
extern const defer_lock_t defer_lock;
extern const try_to_lock_t try_to_lock;
diff --git a/include/functional b/include/functional
index 8026189..6b70f73 100644
--- a/include/functional
+++ b/include/functional
@@ -2005,7 +2005,7 @@
template <int _Np> struct __ph {};
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_FUNC_VIS extern const __ph<1> _1;
_LIBCPP_FUNC_VIS extern const __ph<2> _2;
_LIBCPP_FUNC_VIS extern const __ph<3> _3;
@@ -2027,7 +2027,7 @@
/* _LIBCPP_INLINE_VAR */ constexpr __ph<8> _8{};
/* _LIBCPP_INLINE_VAR */ constexpr __ph<9> _9{};
/* _LIBCPP_INLINE_VAR */ constexpr __ph<10> _10{};
-#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
} // placeholders
diff --git a/include/memory b/include/memory
index fd830d7..a4bf89b 100644
--- a/include/memory
+++ b/include/memory
@@ -3511,7 +3511,7 @@
explicit __shared_count(long __refs = 0) _NOEXCEPT
: __shared_owners_(__refs) {}
-#if defined(_LIBCPP_BUILDING_MEMORY) && \
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void __add_shared() _NOEXCEPT;
bool __release_shared() _NOEXCEPT;
@@ -3549,7 +3549,7 @@
virtual ~__shared_weak_count();
public:
-#if defined(_LIBCPP_BUILDING_MEMORY) && \
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void __add_shared() _NOEXCEPT;
void __add_weak() _NOEXCEPT;
@@ -5549,7 +5549,7 @@
#endif
#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) && \
- defined(_LIBCPP_BUILDING_MEMORY)
+ defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
#else
// This function is only offered in C++03 under ABI v1.
diff --git a/include/new b/include/new
index b5dc055..e70b9c6 100644
--- a/include/new
+++ b/include/new
@@ -103,13 +103,13 @@
#pragma GCC system_header
#endif
-#if !(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
+#if !(defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_STD_VER >= 14 || \
(defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309))
# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
#endif
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \
- (!(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER > 14 || \
+ (!(defined(_LIBCPP_BUILDING_LIBRARY) || _LIBCPP_STD_VER > 14 || \
(defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606)))
# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
#endif
@@ -167,7 +167,7 @@
#define _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
-#endif // defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
+#endif // defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || _LIBCPP_STD_VER > 14
diff --git a/include/shared_mutex b/include/shared_mutex
index 9cb8152..a7735d6 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -129,7 +129,7 @@
#include <__undef_macros>
-#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_SHARED_MUTEX)
+#if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_LIBRARY)
#include <__mutex_base>
diff --git a/include/system_error b/include/system_error
index 917c710..6e2c838 100644
--- a/include/system_error
+++ b/include/system_error
@@ -199,7 +199,7 @@
public:
virtual ~error_category() _NOEXCEPT;
-#if defined(_LIBCPP_BUILDING_SYSTEM_ERROR) && \
+#if defined(_LIBCPP_BUILDING_LIBRARY) && \
defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
error_category() _NOEXCEPT;
#else
diff --git a/include/utility b/include/utility
index 8fdaf65..ed9bf03 100644
--- a/include/utility
+++ b/include/utility
@@ -295,7 +295,7 @@
#endif
struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
/* _LIBCPP_INLINE_VAR */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
diff --git a/src/bind.cpp b/src/bind.cpp
index b318fc1..b4c76ff 100644
--- a/src/bind.cpp
+++ b/src/bind.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_BIND
#include "functional"
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/src/memory.cpp b/src/memory.cpp
index 4e0d3af..77ebe83 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_MEMORY
#include "memory"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
diff --git a/src/mutex.cpp b/src/mutex.cpp
index c36bd55..c61d34b 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_MUTEX
#include "mutex"
#include "limits"
#include "system_error"
diff --git a/src/new.cpp b/src/new.cpp
index e228a0d..8013d89 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_NEW
-
#include <stdlib.h>
#include "new"
diff --git a/src/shared_mutex.cpp b/src/shared_mutex.cpp
index 874aceb..6185f15 100644
--- a/src/shared_mutex.cpp
+++ b/src/shared_mutex.cpp
@@ -10,7 +10,6 @@
#include "__config"
#ifndef _LIBCPP_HAS_NO_THREADS
-#define _LIBCPP_BUILDING_SHARED_MUTEX
#include "shared_mutex"
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/src/system_error.cpp b/src/system_error.cpp
index 72623ea..06caa6f 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -9,7 +9,6 @@
#include "__config"
-#define _LIBCPP_BUILDING_SYSTEM_ERROR
#include "system_error"
#include "include/config_elast.h"
diff --git a/src/utility.cpp b/src/utility.cpp
index e9830e7..7dccffb 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_BUILDING_UTILITY
#include "utility"
_LIBCPP_BEGIN_NAMESPACE_STD