diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index 1260aebaaf07..bc12195a6742 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -6,6 +6,7 @@ #ifndef _MOZILLA_GFX_2D_H #define _MOZILLA_GFX_2D_H +#include "Types.h" #include "Point.h" #include "Rect.h" #include "Matrix.h" @@ -19,23 +20,6 @@ #include #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; diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index 9ff357d6667a..ccb8c9dfcd41 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -6,6 +6,23 @@ #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 diff --git a/gfx/2d/UserData.h b/gfx/2d/UserData.h index 20b6c4624ee1..b6b1c96c9ea7 100644 --- a/gfx/2d/UserData.h +++ b/gfx/2d/UserData.h @@ -7,6 +7,7 @@ #define MOZILLA_GFX_USERDATA_H_ #include +#include "Types.h" #include "mozilla/Assertions.h" namespace mozilla {