summaryrefslogtreecommitdiff
path: root/include/__debug
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-03-25 19:29:35 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-03-25 19:29:35 +0000
commitf5f4684e715ca9a76ee6435783d404b0548e3f3f (patch)
treea1a35eddf3ecee14283bca65014cd02e4faf2131 /include/__debug
parentae7bf9daac7c7427953ac90484fcc72df5b15d2a (diff)
downloadlibcxx-f5f4684e715ca9a76ee6435783d404b0548e3f3f.tar.gz
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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/__debug')
-rw-r--r--include/__debug4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/__debug b/include/__debug
index c7bd5d0fa..0d631bf04 100644
--- a/include/__debug
+++ b/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