aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/_null.h
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2011-12-27 21:36:31 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2011-12-27 21:36:31 +0000
commit3033610f5dfd03b68de35631a8693963a80099c2 (patch)
tree3f47b4acf69328038b73d93b8fa105be369b52c5 /sys/sys/_null.h
parent981dfb09655a07be1cadeadca2604a542beefd5b (diff)
downloadsrc-3033610f5dfd03b68de35631a8693963a80099c2.tar.gz
src-3033610f5dfd03b68de35631a8693963a80099c2.zip
Define NULL to nullptr in C++11 mode (not strictly required, but it makes
migrating code to C++11 easier). Approved by: dim (mentor)
Notes
Notes: svn path=/head/; revision=228918
Diffstat (limited to 'sys/sys/_null.h')
-rw-r--r--sys/sys/_null.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/_null.h b/sys/sys/_null.h
index ed6804ccd10e..92706c6a037a 100644
--- a/sys/sys/_null.h
+++ b/sys/sys/_null.h
@@ -31,7 +31,9 @@
#if !defined(__cplusplus)
#define NULL ((void *)0)
#else
-#if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
+#if __cplusplus >= 201103L
+#define NULL nullptr
+#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
#define NULL __null
#else
#if defined(__LP64__)