delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2011/09/15/12:34:22

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=cm6O5pYR5GpjK02OYrFcJCuz3iGB5kiniB8ixlw6DRg=;
b=vb4zCKYILURRIjROPetSX3k0gSa2calrElJgkl1SorHaoy/RP50+KMVv+kgb0XY2YY
XC/pQZxqelkG59B0DD6djf0twj3T1qXfI3M28ksft8M+Y33hfhNrkx7pKkKmz39YsX/B
aQoW3wgbTse3IsuNJtf8/cIY0Sr970k8NZOaI=
MIME-Version: 1.0
Date: Thu, 15 Sep 2011 19:11:55 +0300
Message-ID: <CAA2C=vCH3gcTSQsBJJ+iT1kOD9RN=65zJX4jbKsBRcwqjdzf7g@mail.gmail.com>
Subject: update stdlib.h NULL macro
From: Ozkan Sezer <sezeroz AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
Reply-To: djgpp-workers AT delorie DOT com

--0016e6542ec2af71fe04acfd22a1
Content-Type: text/plain; charset=ISO-8859-1

stdlib.h is not in sync with stdio.h and others for the NULL
macro definition, possibly an oversight.  The attached patch
remedies that.

Index: include/stdlib.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/stdlib.h,v
retrieving revision 1.18
diff -u -p -r1.18 stdlib.h
--- include/stdlib.h	13 Apr 2009 12:35:00 -0000	1.18
+++ include/stdlib.h	15 Sep 2011 16:08:25 -0000
@@ -18,11 +18,17 @@ extern "C" {

 /* 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;


--
O.S.

--0016e6542ec2af71fe04acfd22a1
Content-Type: application/octet-stream; name="stdlib-NULL.diff"
Content-Disposition: attachment; filename="stdlib-NULL.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gslxrtjx0

SW5kZXg6IGluY2x1ZGUvc3RkbGliLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2cy9kamdwcC9k
amdwcC9pbmNsdWRlL3N0ZGxpYi5oLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjE4CmRpZmYgLXUg
LXAgLXIxLjE4IHN0ZGxpYi5oCi0tLSBpbmNsdWRlL3N0ZGxpYi5oCTEzIEFwciAyMDA5IDEyOjM1
OjAwIC0wMDAwCTEuMTgKKysrIGluY2x1ZGUvc3RkbGliLmgJMTUgU2VwIDIwMTEgMTY6MDg6MjUg
LTAwMDAKQEAgLTE4LDExICsxOCwxNyBAQCBleHRlcm4gIkMiIHsKICAgCiAvKiBTb21lIHByb2dy
YW1zIHRoaW5rIHRoZXkga25vdyBiZXR0ZXIuLi4gKi8KICN1bmRlZiBOVUxMCisjaWYgKF9fR05V
Q19fID49IDQpICYmIGRlZmluZWQoX19jcGx1c3BsdXMpCisjICBkZWZpbmUgTlVMTCAgICAgICAg
ICBfX251bGwKKyNlbGlmIGRlZmluZWQoX19jcGx1c3BsdXMpCisjICBkZWZpbmUgTlVMTCAgICAg
ICAgICAwCisjZWxzZQorIyAgZGVmaW5lIE5VTEwgICAgICAgICAgKCh2b2lkKikwKQorI2VuZGlm
CiAKICNkZWZpbmUgRVhJVF9GQUlMVVJFCTEKICNkZWZpbmUgRVhJVF9TVUNDRVNTCTAKICNkZWZp
bmUgTUJfQ1VSX01BWAlfX2RqX21iX2N1cl9tYXgKLSNkZWZpbmUgTlVMTAkJMAogI2RlZmluZSBS
QU5EX01BWAkyMTQ3NDgzNjQ3CiAKIGV4dGVybiBpbnQgX19kal9tYl9jdXJfbWF4Owo=
--0016e6542ec2af71fe04acfd22a1--

- Raw text -


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