Bug 782416 - Make gfx::2d's nullptr definition actually work. r=nrc

--HG--
extra : rebase_source : da098e5e6d04aa1dce2ffefd4ccd0ad6ffb376b8
This commit is contained in:
Joe Drew 2012-08-15 15:24:44 -04:00
parent 3966995e74
commit db420cfa05
3 changed files with 19 additions and 17 deletions

View File

@ -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 <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;

View File

@ -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 <stddef.h>

View File

@ -7,6 +7,7 @@
#define MOZILLA_GFX_USERDATA_H_
#include <stdlib.h>
#include "Types.h"
#include "mozilla/Assertions.h"
namespace mozilla {