diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-04-26 13:08:21 +0100 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-04-26 13:08:21 +0100 |
commit | 1916700541671b44e753d2f36b4a3d8a33ed46c9 (patch) | |
tree | 323e720fc7edd6d2422cac5edde5099fa75d6a2c /glib/gmacros.h | |
parent | 63af8ed0ea2022d59e7476f16c56787ab792d06a (diff) | |
download | glib-1916700541671b44e753d2f36b4a3d8a33ed46c9.tar.gz |
Revert "macros: Try to use the standard __func__ first in G_STRFUNC"
This reverts commit 9f75cc9edf1d311ef4bacc3d686c7afa0c4dcbb2.
It breaks usage of G_STRFUNC when compiling applications with
`-Wpedantic` — `__func__` is not `#define`d, so G_STRFUNC was falling
through to using `__FUNCTION__`, which raises a warning with
`-Wpedantic`.
Fun times.
Fixes: #1755
Diffstat (limited to 'glib/gmacros.h')
-rw-r--r-- | glib/gmacros.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h index cde9f6b43..91fb98e9d 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -733,10 +733,10 @@ #endif /* Provide a string identifying the current function, non-concatenatable */ -#if defined (__func__) -#define G_STRFUNC ((const char*) (__func__)) -#elif defined (__GNUC__) && defined (__cplusplus) +#if defined (__GNUC__) && defined (__cplusplus) #define G_STRFUNC ((const char*) (__PRETTY_FUNCTION__)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#define G_STRFUNC ((const char*) (__func__)) #elif defined (__GNUC__) || (defined(_MSC_VER) && (_MSC_VER > 1300)) #define G_STRFUNC ((const char*) (__FUNCTION__)) #else |