Improved LEMON_FUNCTION_NAME macro.
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Sun, 13 Apr 2008 20:15:45 +0200
changeset 1428b703d177341
parent 141 96f81c791f0c
child 143 c3b45bb643b0
Improved LEMON_FUNCTION_NAME macro.
It should work fine with GCC and the MS C++ compilers. Otherwise it reverts to
using the __func__ variable which is C99, but I couldn't find a better
alternative.
lemon/assert.h
     1.1 --- a/lemon/assert.h	Sun Apr 13 13:22:52 2008 +0200
     1.2 +++ b/lemon/assert.h	Sun Apr 13 20:15:45 2008 +0200
     1.3 @@ -103,7 +103,13 @@
     1.4  #endif
     1.5  
     1.6  #ifndef LEMON_FUNCTION_NAME
     1.7 -#  define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
     1.8 +#  if defined __GNUC__
     1.9 +#    define LEMON_FUNCTION_NAME (__PRETTY_FUNCTION__)
    1.10 +#  elif defined _MSC_VER
    1.11 +#    define LEMON_FUNCTION_NAME (__FUNCSIG__)
    1.12 +#  else
    1.13 +#    define LEMON_FUNCTION_NAME (__func__)
    1.14 +#  endif
    1.15  #endif
    1.16  
    1.17  #ifdef DOXYGEN