define NULL as nullptr when used in C++11 or later
This should be safer for casting and more compatible with existing code bases that wrongly assume it must be defined as a pointer.
This commit is contained in:
1 parent
8274aaaaa1
commit
98e688a9da
8 files changed
+24
-8
No files matched your search
+3
-1
@@ -7,7 +7,9 @@ extern "C" {
|
||||
|
||||
#include <features.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus >= 201103L
|
||||
#define NULL nullptr
|
||||
#elif defined(__cplusplus)
|
||||
#define NULL 0L
|
||||
#else
|
||||
#define NULL ((void*)0)
|
||||
|
||||
Reference in new issue
Block a user