summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-04 19:18:58 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-04 19:18:58 +0100
commit3597b0bcc3b59488338eb98f458ec3b2e46de6d6 (patch)
treece71ffbdf6a857e515dd1071e3dd3eaf5fb2c27a
parent4555d1fbf22070d5052287007e1537e37faa4970 (diff)
Fix build on Mac OS X 10.7.
Issue #45.
-rw-r--r--glimports.hpp9
-rw-r--r--specs/gltypes.py13
2 files changed, 15 insertions, 7 deletions
diff --git a/glimports.hpp b/glimports.hpp
index a24e20f..caa3a4e 100644
--- a/glimports.hpp
+++ b/glimports.hpp
@@ -34,6 +34,15 @@
// Prevent including system's glext.h
#define __glext_h_
+// Some functions take GLenum disguised as GLint. Apple noticed and fixed it
+// in the Mac OS X 10.6.x gl.h headers. Regardless, C++ typechecking rules
+// force the wrappers to match the prototype precisely.
+#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_7)
+#define GLenum_int GLenum
+#else
+#define GLenum_int GLint
+#endif
+
#if defined(_WIN32)
diff --git a/specs/gltypes.py b/specs/gltypes.py
index e25cd7e..e187688 100644
--- a/specs/gltypes.py
+++ b/specs/gltypes.py
@@ -91,13 +91,12 @@ GLenum = Enum("GLenum", [
# Parameters are added later from glparams.py's parameter table
])
-# Some functions take GLenum disguised as GLint. Apple noticed and fixed it in
-# the gl.h header. Regardless, C++ typechecking rules force the wrappers to
-# match the prototype precisely.
-if platform.system() == 'Darwin':
- GLenum_int = GLenum
-else:
- GLenum_int = Alias("GLint", GLenum)
+# Some functions take GLenum disguised as GLint, and need special treatment so
+# that symbolic names are traced correctly. Apple noticed and fixed it in the
+# gl.h header, which further complicates things. C++ typechecking rules force
+# the wrappers to match the prototype precisely, so the precise type is defined
+# in glimports.hpp
+GLenum_int = Alias("GLenum_int", GLenum)
GLenum_mode = FakeEnum(GLenum, [
"GL_POINTS", # 0x0000