]> git.cworth.org Git - apitrace/commitdiff
Use patch instead of sed for glext.h tweaks.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 14 Mar 2012 09:08:54 +0000 (09:08 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 14 Mar 2012 09:15:19 +0000 (09:15 +0000)
thirdparty/khronos/GL/glext.patch [new file with mode: 0644]
thirdparty/khronos/GL/glext.sed [deleted file]
thirdparty/khronos/Makefile
thirdparty/khronos/README.markdown [new file with mode: 0644]

diff --git a/thirdparty/khronos/GL/glext.patch b/thirdparty/khronos/GL/glext.patch
new file mode 100644 (file)
index 0000000..0ab1430
--- /dev/null
@@ -0,0 +1,22 @@
+# MacOSX doesn't follow the official glext.h definition for GLhandleARB, and
+# instead defines it as:
+#
+#   typedef void *GLhandleARB;
+#
+# But to avoid integer to pointer conversion issues, we simply use 'unsigned
+# long' which should be the same size on all supported architectures.
+--- glext.h.orig       2012-03-05 11:00:02.000000000 +0000
++++ glext.h    2012-03-14 08:56:54.199519853 +0000
+@@ -5484,8 +5484,12 @@
+ #ifndef GL_ARB_shader_objects
+ /* GL types for program/shader text and shader object handles */
+ typedef char GLcharARB;
++#ifdef __APPLE__
++typedef unsigned long GLhandleARB;
++#else
+ typedef unsigned int GLhandleARB;
+ #endif
++#endif
+ /* GL type for "half" precision (s10e5) float data in host memory */
+ #ifndef GL_ARB_half_float_pixel
diff --git a/thirdparty/khronos/GL/glext.sed b/thirdparty/khronos/GL/glext.sed
deleted file mode 100644 (file)
index bc4835d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# MacOSX doesn't follow the official glext.h definition for GLhandleARB, and
-# instead defines it as:
-#
-#   typedef void *GLhandleARB;
-#
-# But to avoid integer to pointer conversion issues, we simply use 'unsigned
-# long' which should be the same size on all supported architectures.
-
-/^typedef unsigned int GLhandleARB;$/ {
-
-    i\
-#ifdef __APPLE__\
-typedef unsigned long GLhandleARB;\
-#else
-
-    a\
-#endif
-
-}
index 2b5ff307a222da17e8439a0647a6c59f49fa1efe..b53d5f5478433cf01e9cfe456345cd6f0f31f7e9 100644 (file)
@@ -16,15 +16,16 @@ update: \
 GL/wglext.h GL/glxext.h: FORCE
        wget -O $@ "http://www.opengl.org/registry/api/$(@F)"
 
-GL/glext.h: GL/glext.sed FORCE
-       wget -O - "http://www.opengl.org/registry/api/$(@F)" | sed -f $*.sed > $@
+GL/glext.h: GL/glext.patch FORCE
+       wget -O $@ "http://www.opengl.org/registry/api/$(@F)"
+       patch $@ $<
 
 EGL/egl.h EGL/eglext.h KHR/khrplatform.h: FORCE
        wget -O $@ "http://www.khronos.org/registry/egl/api/$@"
 
 EGL/eglplatform.h: EGL/eglplatform.patch FORCE
        wget -O $@ "http://www.khronos.org/registry/egl/api/$@"
-       patch $@ EGL/eglplatform.patch
+       patch $@ $<
 
 GLES/gl.h GLES/glext.h GLES/glplatform.h: FORCE
        wget -O $@ "http://www.khronos.org/registry/gles/api/1.1/$(@F)"
diff --git a/thirdparty/khronos/README.markdown b/thirdparty/khronos/README.markdown
new file mode 100644 (file)
index 0000000..3e4bddc
--- /dev/null
@@ -0,0 +1,12 @@
+This directory contains headers for all relevant Khronos APIs, based from:
+
+* http://www.khronos.org/
+
+* http://www.opengl.org/registry/
+
+* http://oss.sgi.com/projects/ogl-sample/
+
+
+To update simply run:
+
+    make