|
From: Marco <mrc...@gm...> - 2008-04-28 12:34:02
|
On Mon, 28 Apr 2008 14:07:46 +0200, Marco <mrc...@gm...> 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
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|