Bug 782416 - Make gfx::2d's nullptr definition actually work. r=nrc
authorJoe Drew <joe@drew.ca>
Wed, 15 Aug 2012 15:24:44 -0400
changeset 107946 e00f4d16eeed04c089402d805a2453a7406d8bc4
parent 107945 5fbacb9e6e627f1a10a19a55979741eba6a9190f
child 107947 8f6b4e0bcef0922e09b722a6b52285918ca88c63
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnrc
bugs782416
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 782416 - Make gfx::2d's nullptr definition actually work. r=nrc
gfx/2d/2D.h
gfx/2d/Types.h
gfx/2d/UserData.h
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1,46 +1,30 @@
 /* -*- Mode: C++; tab-width: 20; 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/. */
 
 #ifndef _MOZILLA_GFX_2D_H
 #define _MOZILLA_GFX_2D_H
 
+#include "Types.h"
 #include "Point.h"
 #include "Rect.h"
 #include "Matrix.h"
 #include "UserData.h"
 // This RefPtr class isn't ideal for usage in Azure, as it doesn't allow T**
 // outparams using the &-operator. But it will have to do as there's no easy
 // solution.
 #include "mozilla/RefPtr.h"
 
 #ifdef MOZ_ENABLE_FREETYPE
 #include <string>
 #endif
 
-/**
- * Use C++11 nullptr if available; otherwise use a C++ typesafe template; and
- * for C, fall back to longs.  See bugs 547964 and 626472.
- * Copy and paste job from nscore.h, see bug 781943
- */
-#if defined(MOZ_GFX) && !defined(HAVE_NULLPTR)
-#ifndef __cplusplus
-# define nullptr ((void*)0)
-#elif defined(__GNUC__)
-# define nullptr __null
-#elif defined(_WIN64)
-# define nullptr 0LL
-#else
-# define nullptr 0L
-#endif
-#endif /* defined(MOZ_GFX) && !defined(HAVE_NULLPTR) */
-
 struct _cairo_surface;
 typedef _cairo_surface cairo_surface_t;
 
 struct _cairo_scaled_font;
 typedef _cairo_scaled_font cairo_scaled_font_t;
 
 struct ID3D10Device1;
 struct ID3D10Texture2D;
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -1,16 +1,33 @@
 /* -*- Mode: C++; tab-width: 20; 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/. */
 
 #ifndef MOZILLA_GFX_TYPES_H_
 #define MOZILLA_GFX_TYPES_H_
 
+/**
+ * Use C++11 nullptr if available; otherwise use a C++ typesafe template; and
+ * for C, fall back to longs.  See bugs 547964 and 626472.
+ * Copy and paste job from nscore.h, see bug 781943
+ */
+#if defined(MOZ_GFX) && !defined(HAVE_NULLPTR)
+#ifndef __cplusplus
+# define nullptr ((void*)0)
+#elif defined(__GNUC__)
+# define nullptr __null
+#elif defined(_WIN64)
+# define nullptr 0LL
+#else
+# define nullptr 0L
+#endif
+#endif /* defined(MOZ_GFX) && !defined(HAVE_NULLPTR) */
+
 #include "mozilla/StandardInteger.h"
 
 #include <stddef.h>
 
 namespace mozilla {
 namespace gfx {
 
 typedef float Float;
--- a/gfx/2d/UserData.h
+++ b/gfx/2d/UserData.h
@@ -2,16 +2,17 @@
  * 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/. */
 
 #ifndef MOZILLA_GFX_USERDATA_H_
 #define MOZILLA_GFX_USERDATA_H_
 
 #include <stdlib.h>
+#include "Types.h"
 #include "mozilla/Assertions.h"
 
 namespace mozilla {
 namespace gfx {
 
 struct UserDataKey {
   int unused;
 };