Go to the documentation of this file.00001
00008
00009
00010
00011
00012 #ifndef ECL_EXCEPTIONS_MACROS_HPP_
00013 #define ECL_EXCEPTIONS_MACROS_HPP_
00014
00015
00016
00017
00018
00019 #include <ecl/config/ecl.hpp>
00020
00021
00022
00023
00024
00025 #if defined(ECL_DISABLE_EXCEPTIONS)
00026 #define ecl_throw_decl(exception)
00027 #define ecl_throw(exception) ((void)0)
00028 #define ecl_try if(true)
00029 #define ecl_catch(exception) else
00030 #else
00031
00044 #define ecl_throw_decl(exception) throw(exception)
00045
00054 #define ecl_throw(exception) throw exception;
00055
00060 #define ecl_try try
00061
00066 #define ecl_catch(exception) catch(exception)
00067
00070 #endif
00071
00072
00073
00074
00075
00076 #if defined(NDEBUG) || defined(ECL_NDEBUG) || defined(ECL_DISABLE_EXCEPTIONS)
00077 #define ecl_assert_throw_decl(exception)
00078 #define ecl_assert_throw(expression,exception) ((void)0)
00079 #define ecl_debug_throw_decl(exception)
00080 #define ecl_debug_throw(exception) ((void)0)
00081 #define ecl_debug_try if(true)
00082 #define ecl_debug_catch(exception) else
00083 #else
00084 #define ECL_HAS_EXCEPTIONS
00085
00100 #define ecl_assert_throw_decl(exception) throw(exception)
00101
00109 #define ecl_assert_throw(expression,exception) if ( !(expression) ) { throw exception; }
00110
00119 #define ecl_debug_throw_decl(exception) throw(exception)
00120
00129 #define ecl_debug_throw(exception) throw exception;
00130
00135 #define ecl_debug_try try
00136
00141 #define ecl_debug_catch(exception) catch(exception)
00142 #endif
00143
00147 #endif