-
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
#define DEBUG 1
+#if defined (__GNUC__)
+# define FUNC ((const char*) (__PRETTY_FUNCTION__))
+#elif defined (__sun) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+# define FUNC ((const char*) (__func__))
+#else
+# define FUNC ((const char*) ("???"))
+#endif
+
#if DEBUG
#define return_if_fail(expr) \
{ \
if (!(expr)) \
{ \
- fprintf(stderr, "In %s: %s failed\n", __FUNCTION__, #expr); \
+ fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
return; \
} \
} \
{ \
if (!(expr)) \
{ \
- fprintf(stderr, "In %s: %s failed\n", __FUNCTION__, #expr); \
+ fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
return (retval); \
} \
} \