delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/09/15/18:17:08

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX1+YM6RVJGqY68AzLsXNd/xM0gK/bg0RpDuyizM9a8
DCm0VhYkTeJmrR
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: Re: update stdlib.h NULL macro
Date: Fri, 16 Sep 2011 00:12:09 +0200
User-Agent: KMail/1.9.10
References: <CAA2C=vCH3gcTSQsBJJ+iT1kOD9RN=65zJX4jbKsBRcwqjdzf7g AT mail DOT gmail DOT com>
In-Reply-To: <CAA2C=vCH3gcTSQsBJJ+iT1kOD9RN=65zJX4jbKsBRcwqjdzf7g@mail.gmail.com>
MIME-Version: 1.0
Message-Id: <201109160012.09405.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

Am Donnerstag, 15. September 2011 schrieb Ozkan Sezer:
> stdlib.h is not in sync with stdio.h and others for the NULL
> macro definition, possibly an oversight.  The attached patch
> remedies that.

OFYI, I committed the patch below.

Regards,
Juan M. Guerrero



2011-09-16  Juan Manuel Guerrero  <juan DOT guerrero AT gmx DOT de>

	* include/stdlib.h:  NULL macro definition updated.
	From Ozkan Sezer <sezeroz AT gmail DOT com>



Index: djgpp/include/stdlib.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdlib.h,v
retrieving revision 1.18
diff -U 5 -r1.18 stdlib.h
--- djgpp/include/stdlib.h	13 Apr 2009 12:35:00 -0000	1.18
+++ djgpp/include/stdlib.h	15 Sep 2011 22:01:28 -0000
@@ -16,15 +16,21 @@
 
 #include <sys/djtypes.h>
   
 /* Some programs think they know better... */
 #undef NULL
+#if (__GNUC__ >= 4) && defined(__cplusplus)
+#  define NULL          __null
+#elif defined(__cplusplus)
+#  define NULL          0
+#else
+#  define NULL          ((void*)0)
+#endif
 
 #define EXIT_FAILURE	1
 #define EXIT_SUCCESS	0
 #define MB_CUR_MAX	__dj_mb_cur_max
-#define NULL		0
 #define RAND_MAX	2147483647
 
 extern int __dj_mb_cur_max;
 
 typedef struct {

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019