aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2009-05-11 17:29:11 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2009-05-11 17:29:11 +0000
commit56916f026cf41926e91e2b06f1b14408424e5d33 (patch)
tree6e2f2a178f802b9d5d456200df4e8f69cc4d449f /sys
parentd83d76df1f28484e61552e8b32f9c01bcdd476f4 (diff)
downloadsrc-56916f026cf41926e91e2b06f1b14408424e5d33.tar.gz
src-56916f026cf41926e91e2b06f1b14408424e5d33.zip
Always use __null to define NULL for GCC 4+. Use '0' rather than
'(void *)0' for NULL for C++ compilers compiling kernel code. Together this makes it easier to build kernel modules using C++. Reviewed by: imp MFC after: 3 days
Notes
Notes: svn path=/head/; revision=191996
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/_null.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sys/_null.h b/sys/sys/_null.h
index caae78133c9d..b53c1b236983 100644
--- a/sys/sys/_null.h
+++ b/sys/sys/_null.h
@@ -28,18 +28,18 @@
#ifndef NULL
-#if defined(_KERNEL) || !defined(__cplusplus)
-#define NULL ((void *)0)
-#else
#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
#define NULL __null
#else
+#if defined(_KERNEL) && !defined(__cplusplus)
+#define NULL ((void *)0)
+#else
#if defined(__LP64__)
#define NULL (0L)
#else
#define NULL 0
#endif /* __LP64__ */
+#endif /* _KERNEL && !__cplusplus */
#endif /* __GNUG__ */
-#endif /* _KERNEL || !__cplusplus */
#endif