svn commit: r228918 - head/sys/sys

David Chisnall theraven at FreeBSD.org
Tue Dec 27 21:36:32 UTC 2011


Author: theraven
Date: Tue Dec 27 21:36:31 2011
New Revision: 228918
URL: http://svn.freebsd.org/changeset/base/228918

Log:
  Define NULL to nullptr in C++11 mode (not strictly required, but it makes
  migrating code to C++11 easier).
  
  Approved by:	dim (mentor)

Modified:
  head/sys/sys/_null.h

Modified: head/sys/sys/_null.h
==============================================================================
--- head/sys/sys/_null.h	Tue Dec 27 20:03:57 2011	(r228917)
+++ head/sys/sys/_null.h	Tue Dec 27 21:36:31 2011	(r228918)
@@ -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__)


More information about the svn-src-all mailing list