macros: Try to use the standard __func__ first in G_STRFUNC

__func__ is part of the C99 standard.
__FUNCTION__ is another name for __func__. Older versions of GCC
recognize only this name. However, it is not standardized.
For maximum portability, Its recommended to use __func__.
__PRETTY_FUNCTION__ is yet another name for __func__. However, in C++,
__PRETTY_FUNCTION__ contains the type signature of the function as
well as its bare name

http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

https://gitlab.gnome.org/GNOME/glib/issues/535
This commit is contained in:
Javier Jardón 2014-01-13 12:29:10 +00:00 committed by Philip Withnall
parent f2d51adc13
commit 9f75cc9edf

View File

@ -304,10 +304,10 @@
#endif
/* Provide a string identifying the current function, non-concatenatable */
#if defined (__GNUC__) && defined (__cplusplus)
#define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#if defined (__func__)
#define G_STRFUNC ((const char*) (__func__))
#elif defined (__GNUC__) && defined (__cplusplus)
#define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__))
#elif defined (__GNUC__) || (defined(_MSC_VER) && (_MSC_VER > 1300))
#define G_STRFUNC ((const char*) (__FUNCTION__))
#else