Bug 800657 - Fix WebGL typedefs, WebGLintptr was wrong on 32bit systems, caused index-validation.html regression - r=bz
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 15 Oct 2012 12:57:14 -0400
changeset 110427 39d70a2e0deab2b037be3c22e87337d2f2196e8d
parent 110426 64bf0d8480a55d9adebdab86d2da017684270622
child 110428 621cfd13ceaf4c3cce0aaaef12323544789f1650
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbz
bugs800657
milestone19.0a1
Bug 800657 - Fix WebGL typedefs, WebGLintptr was wrong on 32bit systems, caused index-validation.html regression - r=bz
content/canvas/src/WebGLContext.h
dom/base/nsDOMClassInfo.cpp
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -56,27 +56,27 @@
 #define MINVALUE_GL_MAX_FRAGMENT_UNIFORM_VECTORS      16    // Page 164
 #define MINVALUE_GL_MAX_VERTEX_UNIFORM_VECTORS        128   // Page 164
 #define MINVALUE_GL_MAX_VARYING_VECTORS               8     // Page 164
 #define MINVALUE_GL_MAX_TEXTURE_IMAGE_UNITS           8     // Page 164
 #define MINVALUE_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS    0     // Page 164
 #define MINVALUE_GL_MAX_RENDERBUFFER_SIZE             1024  // Different from the spec, which sets it to 1 on page 164
 #define MINVALUE_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS  8     // Page 164
 
-#define DECL_WEBGL_TYPEDEF(type) typedef type Web##type;
-DECL_WEBGL_TYPEDEF(GLenum)
-DECL_WEBGL_TYPEDEF(GLbitfield)
-DECL_WEBGL_TYPEDEF(GLint)
-DECL_WEBGL_TYPEDEF(GLsizei)
-DECL_WEBGL_TYPEDEF(GLsizeiptr)
-DECL_WEBGL_TYPEDEF(GLintptr)
-DECL_WEBGL_TYPEDEF(GLuint)
-DECL_WEBGL_TYPEDEF(GLfloat)
-DECL_WEBGL_TYPEDEF(GLclampf)
-typedef realGLboolean WebGLboolean;
+// Manual reflection of WebIDL typedefs
+typedef uint32_t WebGLenum;
+typedef uint32_t WebGLbitfield;
+typedef int32_t WebGLint;
+typedef int32_t WebGLsizei;
+typedef int64_t WebGLsizeiptr;
+typedef int64_t WebGLintptr;
+typedef uint32_t WebGLuint;
+typedef float WebGLfloat;
+typedef float WebGLclampf;
+typedef bool WebGLboolean;
 
 class nsIPropertyBag;
 
 namespace mozilla {
 
 class WebGLTexture;
 class WebGLBuffer;
 class WebGLProgram;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -549,18 +549,16 @@ using mozilla::dom::indexedDB::IDBWrappe
 #include "GeneratedEvents.h"
 #include "mozilla/Likely.h"
 #include "nsDebug.h"
 
 #ifdef MOZ_WEBRTC
 #include "nsIDOMDataChannel.h"
 #endif
 
-#undef None // something included above defines this preprocessor symbol, maybe Xlib headers
-#include "WebGLContext.h"
 #include "nsICanvasRenderingContextInternal.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);