Skip to content
Permalink
Browse files
2011-05-02 Xan Lopez <xlopez@igalia.com>
        Reviewed by Alexey Proskuryakov.

        Use native NullPtr when using GCC 4.6.0 and C++0x
        https://bugs.webkit.org/show_bug.cgi?id=59252

        GCC 4.6.0 has nullptr support, use it when possible.

        * wtf/NullPtr.cpp: include config.h to pull in Platform.h before
        NullPtr.h, since we need the GCC_VERSION_AT_LEAST definition.
        * wtf/NullPtr.h: check for GCC >= 4.6.0 and C++0x in order to
        use native nullptr.

Canonical link: https://commits.webkit.org/75223@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Xan Lopez committed May 2, 2011
1 parent f8316e4 commit b28de1a00040bc87c4d38b49dad6c50ad954eb1b
Showing 3 changed files with 16 additions and 3 deletions.
@@ -1,3 +1,17 @@
2011-05-02 Xan Lopez <xlopez@igalia.com>

Reviewed by Alexey Proskuryakov.

Use native NullPtr when using GCC 4.6.0 and C++0x
https://bugs.webkit.org/show_bug.cgi?id=59252

GCC 4.6.0 has nullptr support, use it when possible.

* wtf/NullPtr.cpp: include config.h to pull in Platform.h before
NullPtr.h, since we need the GCC_VERSION_AT_LEAST definition.
* wtf/NullPtr.h: check for GCC >= 4.6.0 and C++0x in order to
use native nullptr.

2011-05-02 Gavin Barraclough <barraclough@apple.com>

Reviewed by Oliver Hunt.
@@ -24,10 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "config.h"
#include "NullPtr.h"

#include "Platform.h"

#if !HAVE(NULLPTR)

std::nullptr_t nullptr;
@@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define __has_feature(feature) 0
#endif

#if __has_feature(cxx_nullptr) || (defined(_MSC_VER) && _MSC_VER >= 1600)
#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600)

#define HAVE_NULLPTR 1

0 comments on commit b28de1a

Please sign in to comment.