Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-03-25 23:29:35 +0400
committerHoward Hinnant <hhinnant@apple.com>2013-03-25 23:29:35 +0400
commit92bd7c0337b4e63ea823573f3ce92eb6afbb082c (patch)
treeb31d3b7b95615756407eb6c9ce8ddab5074cf12b /libcxx/include/__debug
parenta9bf2fd9d100f4a9afe3331d2233aa0ec4052169 (diff)
Debug mode: learning to crawl. I need to set up some tests that actually test that the debug mode is working, but that won't cause problems when debug mode isn't on. This is my first prototype of such a test. It should call std::terminate() because it's comparing iterators from different containers. And std::terminate() is rigged up to exit normally. If debug mode fails, and doesn't call terminate, then the program asserts. The test is a no-op if _LIBCPP_DEBUG2 is not defined or is defined to be 0.
llvm-svn: 177892
Diffstat (limited to 'libcxx/include/__debug')
-rw-r--r--libcxx/include/__debug4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/__debug b/libcxx/include/__debug
index c7bd5d0fac60..0d631bf04386 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -16,7 +16,9 @@
# include <cstdlib>
# include <cstdio>
# include <cstddef>
-# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
+# ifndef _LIBCPP_ASSERT
+# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
+# endif
#endif