aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/_null.h
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2003-12-23 02:34:25 +0000
committerPeter Wemm <peter@FreeBSD.org>2003-12-23 02:34:25 +0000
commit98ef6ed422a98c5a23f580fa08cf563a05f9a9fe (patch)
tree33b636138fb6a94a92cb83653c9fd9541ed8d4cf /sys/sys/_null.h
parent8070ad52a109d386d484e640dd08842d9e1bc2a3 (diff)
downloadsrc-98ef6ed422a98c5a23f580fa08cf563a05f9a9fe.tar.gz
src-98ef6ed422a98c5a23f580fa08cf563a05f9a9fe.zip
Don peril sensitive sunglasses and set NULL to an actual pointer type,
but *only* for the kernel. We can do this because the kernel is not a standard C application environment. This would have stopped the recent mtx_* arg NULL/MTX_DEF mixups from going unnoticed for so long.
Notes
Notes: svn path=/head/; revision=123739
Diffstat (limited to 'sys/sys/_null.h')
-rw-r--r--sys/sys/_null.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/_null.h b/sys/sys/_null.h
index 36552546e2b1..6059f578590a 100644
--- a/sys/sys/_null.h
+++ b/sys/sys/_null.h
@@ -28,10 +28,14 @@
#ifndef NULL
+#ifdef _KERNEL
+#define NULL (void *)0
+#else
#if defined(__LP64__) || defined(__amd64__)
#define NULL 0L
#else
#define NULL 0
#endif
+#endif /* _KERNEL */
#endif