summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-12-23 02:34:25 +0000
committerpeter <peter@FreeBSD.org>2003-12-23 02:34:25 +0000
commit409dd19ac040f6465a4e73882c919f0dc679c18e (patch)
tree33b636138fb6a94a92cb83653c9fd9541ed8d4cf
parentd564bf80e7d1e61e86a4078cb9fc3100d89c550d (diff)
downloadFreeBSD-src-409dd19ac040f6465a4e73882c919f0dc679c18e.zip
FreeBSD-src-409dd19ac040f6465a4e73882c919f0dc679c18e.tar.gz
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.
-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 3655254..6059f57 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
OpenPOWER on IntegriCloud