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 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: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 * include/stdlib.h: NULL macro definition updated. From Ozkan Sezer 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 /* 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 {