Patch for definition of NULL
- From: Mark Murnane <Mark Murnane Sun COM>
- To: gtk-devel-list gnome org
- Subject: Patch for definition of NULL
- Date: Wed, 11 Jul 2001 16:39:42 +0100
Hi,
When compiling glib with Sun's Forte compiler, we run across problems
with the definition of NULL. On Solaris systems NULL is defined as
either 0 or 0L, depending on whether or not you're compiling 64-bit
binaries. I've put a conditional define in gmacros.h which only applied
when Forte is being used. Does anyone have any objections if I commit
this?
Thanks,
Mark
Index: glib/gmacros.h
===================================================================
RCS file: /cvs/gnome/glib/glib/gmacros.h,v
retrieving revision 1.3
diff -u -r1.3 gmacros.h
--- glib/gmacros.h 2001/06/23 13:55:07 1.3
+++ glib/gmacros.h 2001/07/11 15:37:18
@@ -107,6 +107,15 @@
* been defined. It is assumed that if they are already
* defined then the current definition is correct.
*/
+
+#if !defined NULL && defined __SUNPRO_C
+# if defined (_LP64) && !defined (__cplusplus)
+# define NULL 0L
+# else
+# define NULL 0
+# endif
+#endif
+
#ifndef NULL
# ifdef __cplusplus
# define NULL (0L)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]