diff --git a/CMakeLists.txt b/CMakeLists.txt index 1abce07601403f398cf5c697ff2b85bcf22d5f21..6f4df68cc4ca4bfd33dd54d47fd5d8feb59b7a97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,6 +373,7 @@ endif ( ) if( WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG ) if ( WALBERLA_STL_BOUNDS_CHECKS ) add_definitions ( "-D_GLIBCXX_DEBUG" ) + add_definitions ( "-D_LIBCPP_DEBUG" ) endif() endif() diff --git a/src/waLBerlaDefinitions.in.h b/src/waLBerlaDefinitions.in.h index 496f223b731285a7fe942d29598fe84324c15e3f..21d1dd6d3ff0bb989e7fe75f367ddf6b3a4eea3a 100644 --- a/src/waLBerlaDefinitions.in.h +++ b/src/waLBerlaDefinitions.in.h @@ -41,6 +41,8 @@ #cmakedefine WALBERLA_THREAD_SAFE_LOGGING +#cmakedefine WALBERLA_STL_BOUNDS_CHECKS + // Compiler #cmakedefine WALBERLA_CXX_COMPILER_IS_GNU #cmakedefine WALBERLA_CXX_COMPILER_IS_INTEL diff --git a/tests/core/DebugSTLTest.cpp b/tests/core/DebugSTLTest.cpp index 4d588d5ce54d96feafac2aa1bfbe01e1d732ff5b..760fc34b8b5795f81c277554e1d9dba08cb7b18d 100644 --- a/tests/core/DebugSTLTest.cpp +++ b/tests/core/DebugSTLTest.cpp @@ -19,11 +19,12 @@ //====================================================================================================================== #include <vector> +#include "waLBerlaDefinitions.h" int main(int /*argc*/, char** /*argv*/) { int ret = 1; -#ifdef _GLIBCXX_DEBUG +#ifdef WALBERLA_STL_BOUNDS_CHECKS std::vector< int > a(100); // this throws an exception if the debug STL is used // otherwise main will return 0 and the test fails since it is expected to fail