summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2011-07-03 18:51:02 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2011-07-03 18:51:02 +0000
commitb27e467a0f3fbb2ba1e30b32a18174f170b76ef2 (patch)
tree069f384a9ef9f8857a52d9cdf82b44ad09d73aba /include/stdlib.h
parent2b26c94b023e817134a575613754dbb9ecc19518 (diff)
As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't gcc (or pretend to be gcc like clang). ok miod@
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index da29a50fc2d..bbd57544d16 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdlib.h,v 1.48 2011/04/06 11:39:42 miod Exp $ */
+/* $OpenBSD: stdlib.h,v 1.49 2011/07/03 18:51:01 jsg Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@@ -80,6 +80,8 @@ typedef struct {
#ifndef NULL
#ifdef __GNUG__
#define NULL __null
+#elif defined(__cplusplus)
+#define NULL 0L
#else
#define NULL ((void *)0)
#endif