summaryrefslogtreecommitdiff
path: root/devel/glib/patches/patch-aj
blob: 9fc9276374eaac44ad3f41709c2f5f9ae046c651 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$NetBSD: patch-aj,v 1.4 2008/11/18 17:59:02 chuck Exp $

--- glib.h.orig	2001-02-26 22:44:38.000000000 -0500
+++ glib.h	2008-11-18 12:51:35.000000000 -0500
@@ -119,8 +119,12 @@
  *  defined then the current definition is correct.
  */
 #ifndef	NULL
+#ifdef		__cplusplus
+#define	NULL	(0L)
+#else
 #define	NULL	((void*) 0)
 #endif
+#endif
 
 #ifndef	FALSE
 #define	FALSE	(0)
@@ -204,7 +208,7 @@
 #ifndef G_INLINE_FUNC
 #  ifdef __GNUC__
 #    ifdef __OPTIMIZE__
-#      define G_INLINE_FUNC extern inline
+#      define G_INLINE_FUNC static inline
 #    else
 #      undef G_CAN_INLINE
 #      define G_INLINE_FUNC extern
@@ -271,14 +275,18 @@
 
 /* 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