mfbt/NullPtr.h
author Gaia Pushbot <release+gaiajson@mozilla.com>
Fri, 21 Jun 2013 07:10:21 -0700
changeset 147598 9abebeb1a290ca9e22631509cca7ee8a03603829
parent 130407 ecdbffdf275adaf214ae7c8e2cc91ba20ccfd181
child 151964 f55906cadf07a9ef44cc4ce2574fe35f3dc85672
permissions -rw-r--r--
Bumping gaia.json for 4 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/8dbe6215ffc8 Author: Anthony Ricaud <anthony@ricaud.me> Desc: Merge pull request #10509 from Rik/latest-closure-linter-870729 Bug 870729 - Disable specific code errors instead of --nojsdoc r=yurenju ======== https://hg.mozilla.org/integration/gaia-central/rev/7370a7fe21a8 Author: Anthony Ricaud <anthony@ricaud.me> Desc: Bug 870729 - Disable specific code errors instead of --nojsdoc This will let us use the latest closure-linter ======== https://hg.mozilla.org/integration/gaia-central/rev/4c5c1fb7d3db Author: Ben Francis <ben@tola.me.uk> Desc: Merge pull request #10522 from daleharvey/806556 Bug 806556 - Change wording of url placeholder text r=benfrancis ======== https://hg.mozilla.org/integration/gaia-central/rev/a90a109458af Author: Dale Harvey <dale@arandomurl.com> Desc: Bug 806556 - Change wording of url placeholder text

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implements a workaround for compilers which do not support the C++11 nullptr
 * constant.
 */

#ifndef mozilla_NullPtr_h_
#define mozilla_NullPtr_h_

#include "mozilla/Compiler.h"

#if defined(__clang__)
#  ifndef __has_extension
#    define __has_extension __has_feature
#  endif
#  if __has_extension(cxx_nullptr)
#    define MOZ_HAVE_CXX11_NULLPTR
#  endif
#elif defined(__GNUC__)
#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)
#      define MOZ_HAVE_CXX11_NULLPTR
#    endif
#  endif
#elif _MSC_VER >= 1600
# define MOZ_HAVE_CXX11_NULLPTR
#endif

/**
 * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal
 * with the correct size to match the size of a pointer on a given platform.
 */

#ifndef MOZ_HAVE_CXX11_NULLPTR
#  if defined(__GNUC__)
#    define nullptr __null
#  elif defined(_WIN64)
#    define nullptr 0LL
#  else
#    define nullptr 0L
#  endif
#endif

#endif  /* mozilla_NullPtr_h_ */