From 0d1d48d60fa2a48cae4e0ab4933e04ef3bf6a96d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 27 Oct 2011 14:43:10 +0100 Subject: [PATCH] Define GLhandleARB as unsigned long on MacOSX. --- thirdparty/glext/Makefile | 3 +++ thirdparty/glext/glext.h | 4 ++++ thirdparty/glext/glext.sed | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 thirdparty/glext/glext.sed diff --git a/thirdparty/glext/Makefile b/thirdparty/glext/Makefile index 3223c3c..5a80007 100644 --- a/thirdparty/glext/Makefile +++ b/thirdparty/glext/Makefile @@ -3,6 +3,9 @@ update: glext.h glxext.h wglext.h %.h: FORCE wget -N "http://www.opengl.org/registry/api/$@" +glext.h: glext.sed FORCE + wget -O - "http://www.opengl.org/registry/api/$@" | sed -f $*.sed > $@ + .PHONY: update FORCE: diff --git a/thirdparty/glext/glext.h b/thirdparty/glext/glext.h index af58da2..c640bb8 100644 --- a/thirdparty/glext/glext.h +++ b/thirdparty/glext/glext.h @@ -5335,8 +5335,12 @@ typedef ptrdiff_t GLsizeiptrARB; #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/glext/glext.sed b/thirdparty/glext/glext.sed new file mode 100644 index 0000000..bc4835d --- /dev/null +++ b/thirdparty/glext/glext.sed @@ -0,0 +1,19 @@ +# 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 + +} -- 2.43.0