On Mon, 28 Apr 2008 14:07:46 +0200, Marco <mrcekets@...400...> wrote:
#ifdef LIB2GEOM_EXCEPTIONS # define throwException( cond, message ) \ if ( (cond) ) throw(Geom::Exception(message, __FILE__, __LINE__)) # define throwRangeError( cond, message ) \ if ( (cond) ) throw(RangeError(message, __FILE__, __LINE__)) . . . #else # define throwException( cond, message ) \ if( (cond) ) std::cerr << "lib2geom Error: " << message << std::endl; \ assert( (cond) ) # define throwRangeError( cond, message ) \ if( (cond) ) std::cerr << "lib2geom RangeError: " << message << std::endl; \ assert( (cond) ) . . . #endif // LIB2GEOM_EXCEPTIONS
Marco
Ops, I forgot some logical negation :
#ifdef LIB2GEOM_EXCEPTIONS # define throwException( cond, message ) \ if ( (cond) ) throw(Geom::Exception(message, __FILE__, __LINE__)) # define throwRangeError( cond, message ) \ if ( (cond) ) throw(RangeError(message, __FILE__, __LINE__)) . . . #else # define throwException( cond, message ) \ if( (cond) ) std::cerr << "lib2geom Error: " << message << std::endl; \ assert( !(cond) ) # define throwRangeError( cond, message ) \ if( (cond) ) std::cerr << "lib2geom RangeError: " << message << std::endl; \ assert( !(cond) ) . . . #endif // LIB2GEOM_EXCEPTIONS