blob: a072c5b2cf55ede2ba2dec5d07e759ae6796ddf6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
$NetBSD: patch-aj,v 1.1 2004/06/01 08:03:10 shannonjr Exp $
--- glib.h.orig 2001-02-26 20:44:38.000000000 -0700
+++ glib.h
@@ -271,14 +271,18 @@ extern "C" {
/* Wrap the gcc __PRETTY_FUNCTION__ and __FUNCTION__ variables with
* macros, so we can refer to them as strings unconditionally.
+ *
+ * NB: GLib requires that these expand to string literals so that
+ * they're concatenable. Therefore, they're only useful for GCC < 3.0
+ * because since GCC 3.0 these macros expand to const pointers.
*/
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ < 3)
#define G_GNUC_FUNCTION __FUNCTION__
#define G_GNUC_PRETTY_FUNCTION __PRETTY_FUNCTION__
-#else /* !__GNUC__ */
+#else /* !(__GNUC__ < 3) */
#define G_GNUC_FUNCTION ""
#define G_GNUC_PRETTY_FUNCTION ""
-#endif /* !__GNUC__ */
+#endif /* !(__GNUC__ < 3) */
/* we try to provide a usefull equivalent for ATEXIT if it is
* not defined, but use is actually abandoned. people should
|