Boost logo

Boost :

From: John Torjo (john_at_[hidden])
Date: 2003-05-23 00:46:45


> John Torjo wrote:
> >> 3. In addition to __FUNCTION_ GCC has __PRETTY_FUNCTION__ and C99
> >> __func__ (I think). Other platforms may have their own (like
> >> __function__).
> >
> > Thanks!
> > Basically, I would be interested in all of these unportable macros.
> > The more the merrier, since the more information we can supply about a
> > failed assertion, the better!
> >
> > If anyone has knowledge about these, please let me know. Thanks.
>
> See boost/current_function.hpp.

Thanks. Did it.
However, I guess a possible improvement of current_function.hpp would be one
more macro - sigh -, something like:
BOOST_CURRENT_FUNCTION_EXISTS.

I suppose:

#undef BOOST_CURRENT_FUNCTION_EXISTS

#if defined(__GNUC__)

# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
#define BOOST_CURRENT_FUNCTION_EXISTS

#elif defined(__FUNCSIG__)

# define BOOST_CURRENT_FUNCTION __FUNCSIG__
#define BOOST_CURRENT_FUNCTION_EXISTS

#elif defined(__BORLANDC__)

# define BOOST_CURRENT_FUNCTION __FUNC__
#define BOOST_CURRENT_FUNCTION_EXISTS

#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)

# define BOOST_CURRENT_FUNCTION __func__
#define BOOST_CURRENT_FUNCTION_EXISTS

#else

# define BOOST_CURRENT_FUNCTION "(unknown)"

#endif

What do you think?

Best,
John


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk