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
This commit is contained in:
John Baldwin 2009-05-11 17:29:11 +00:00
parent d83d76df1f
commit 56916f026c

View File

@ -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