]> git.cworth.org Git - fips/commitdiff
Fix glwrap.c to workaround 'const' changes in OpenGL headers.
authorCarl Worth <cworth@cworth.org>
Mon, 29 Apr 2013 20:23:58 +0000 (13:23 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 29 Apr 2013 20:23:58 +0000 (13:23 -0700)
Not all OpenGL headers are created equal. Some include more "const"
keywords than others, and we don't know wheter the headers we are
compiling against include the extra "const". We force all to be equal
by using the preprocessor to remove all "const" keywords altogether.

glwrap.c

index 3a789fc131e0c693c398386b8f6f152038cfda35..c37bae3a16ab1b63ad1883ed5f6c46fdf4def4c8 100644 (file)
--- a/glwrap.c
+++ b/glwrap.c
 
 #include "glwrap.h"
 
+/* The prototypes for some OpenGL functions changed at one point from:
+ *
+ *     const void* *indices
+ * to:
+ *     const void* const coist *indices
+ *
+ * This makes it difficult for us to provide an implementation of
+ * these functions that is consistent with the locally-available gl.h
+ * since we don't know if the extra const will be present or not.
+ *
+ * To workaround this problem, we simply #define away const altogether
+ * before including gl.h.
+ *
+ * Kudos to Keith Packard for suggesting this kludge.
+ */
+#define const
+
 #define GL_GLEXT_PROTOTYPES
 #include <GL/gl.h>