From f5f4684e715ca9a76ee6435783d404b0548e3f3f Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 25 Mar 2013 19:29:35 +0000 Subject: 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 --- include/__debug | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/__debug') diff --git a/include/__debug b/include/__debug index c7bd5d0fa..0d631bf04 100644 --- a/include/__debug +++ b/include/__debug @@ -16,7 +16,9 @@ # include # include # include -# 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 -- cgit v1.2.3