NFC. Move definition of _LIBCPP_ASSERT into __debug header and remove external include guards.
Things done in this patch:
1. Make __debug include __config since it uses macros from it.
2. The current method of defining _LIBCPP_ASSERT is prone to redefinitions. Move
the null _LIBCPP_ASSERT definition into the __debug header to prevent this.
3. Remove external <__debug> include gaurds. <__debug> guards almost all of its
contents internally. There is no reason to be doing it externally.
This patch should not change any functionality.
llvm-svn: 215332
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: c1bd9197ebfc0a8de772dfe5ecd88ceea1e7c18c
diff --git a/include/__debug b/include/__debug
index f1805ad..c151224 100644
--- a/include/__debug
+++ b/include/__debug
@@ -11,19 +11,23 @@
#ifndef _LIBCPP_DEBUG_H
#define _LIBCPP_DEBUG_H
+#include <__config>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
-
# include <cstdlib>
# include <cstdio>
# include <cstddef>
# ifndef _LIBCPP_ASSERT
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
# endif
+#endif
+#ifndef _LIBCPP_ASSERT
+# define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
#if _LIBCPP_DEBUG_LEVEL >= 2