From 51f7ef800ee84f9cbc0e1f742c2d869f887bd5ed Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 27 Feb 2014 14:00:26 -0800 Subject: [PATCH] Make Q_NULLPTR be NULL on C++98 Some compilers actually have a C++11-like null pointer constant in C++98 mode: $ gcc -dM -E -include stddef.h -xc++ /dev/null | grep NULL #define NULL __null $ icc -dM -E -include stddef.h -xc++ /dev/null | grep NULL #define NULL __null $ clang -dM -E -include stddef.h -xc++ /dev/null | grep NULL #define NULL __null Change-Id: Ie0bcaf36fed6ad27e761a0a24332817129128571 Reviewed-by: Olivier Goffart --- src/corelib/global/qcompilerdetection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 1eb442aa5f..6755b82f61 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -858,7 +858,7 @@ #ifdef Q_COMPILER_NULLPTR # define Q_NULLPTR nullptr #else -# define Q_NULLPTR 0 +# define Q_NULLPTR NULL #endif #ifdef Q_COMPILER_DEFAULT_MEMBERS