summaryrefslogtreecommitdiff
path: root/include/stddef.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-06-11 22:47:49 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-06-11 22:47:49 +0000
commit25018aae1e7a8c2288f61c32416e8d3c083a479f (patch)
tree1c6ccf39bfe7ab1508da3896c13a7920df0f267b /include/stddef.h
parent5d30b9dd685cc89d485c7ec3f358e239e00bfe45 (diff)
Define NULL to be __null for C++: better quality of implementation.
__null is a magic constant of integral type that converts to a null pointer as should be, but warns for ambiguity when used to resolved an overload between an integral type and a pointer type.
Diffstat (limited to 'include/stddef.h')
-rw-r--r--include/stddef.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/stddef.h b/include/stddef.h
index 487528c6228..0fcca4fb5a6 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stddef.h,v 1.2 1997/09/21 10:45:52 niklas Exp $ */
+/* $OpenBSD: stddef.h,v 1.3 1999/06/11 22:47:48 espie Exp $ */
/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
/*-
@@ -54,8 +54,12 @@ typedef _BSD_WCHAR_T_ wchar_t;
#endif
#ifndef NULL
+#ifdef __GNUG__
+#define NULL __null
+#else
#define NULL 0
#endif
+#endif
#define offsetof(type, member) ((size_t)(&((type *)0)->member))