ian@0: // Copyright 2007-2010 Baptiste Lepilleur ian@0: // Distributed under MIT license, or public domain if desired and ian@0: // recognized in your jurisdiction. ian@0: // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE ian@0: ian@0: #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED ian@0: # define CPPTL_JSON_ASSERTIONS_H_INCLUDED ian@0: ian@0: #include ian@0: #include ian@0: ian@0: #if !defined(JSON_IS_AMALGAMATION) ian@0: # include ian@0: #endif // if !defined(JSON_IS_AMALGAMATION) ian@0: ian@0: #if defined(JSON_USE_EXCEPTION) ian@0: #define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw ian@0: #define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message ); ian@0: #else // defined(JSON_USE_EXCEPTION) ian@0: #define JSON_ASSERT( condition ) assert( condition ); ian@0: #define JSON_FAIL_MESSAGE( message ) { std::cerr << std::endl << message << std::endl; exit(123); } ian@0: #endif ian@0: ian@0: #define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) { JSON_FAIL_MESSAGE( message ) } ian@0: ian@0: #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED