summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-09-17 12:21:36 +0000
committerBrian Paul <[email protected]>1999-09-17 12:21:36 +0000
commit1bf28c46c2d4d3f2d0a502e45abfa66d37afe733 (patch)
treef8bbb2d64ee64b1fb4d6380cb6102c97c8fb95cc
parent9b563507cb00399faadafb72f6fa2b60ed0c8378 (diff)
glGetProcAddressEXT changes to accomodate Win32 and non-Win32
-rw-r--r--include/GL/gl.h12
-rw-r--r--include/GL/glu.h14
-rw-r--r--src/glu/mesa/glu.c17
3 files changed, 32 insertions, 11 deletions
diff --git a/include/GL/gl.h b/include/GL/gl.h
index e45acbc066f..ff67f263a31 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -1,4 +1,4 @@
-/* $Id: gl.h,v 1.5 1999/09/17 04:25:56 tjump Exp $ */
+/* $Id: gl.h,v 1.6 1999/09/17 12:21:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -2181,9 +2181,15 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void );
* If you want to try it out, #define GL_EXT_get_proc_address before
* #include <GL/gl.h>
*/
+#define GL_EXT_get_proc_address 1
#ifdef GL_EXT_get_proc_address
-typedef (void (GLAPIENTRY *glProcAddress))();
-glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName);
+#ifdef __WIN32__
+ typedef (void GLAPIENTRY *glProcAddress)();
+ glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName);
+#else
+ /* everything but Windows */
+ GLAPI void GLAPIENTRY (*glGetProcAddressEXT(const GLubyte *procName))();
+#endif
#endif
diff --git a/include/GL/glu.h b/include/GL/glu.h
index 43727bcce02..01d630ef8b1 100644
--- a/include/GL/glu.h
+++ b/include/GL/glu.h
@@ -1,4 +1,4 @@
-/* $Id: glu.h,v 1.7 1999/09/17 02:44:19 tjump Exp $ */
+/* $Id: glu.h,v 1.8 1999/09/17 12:21:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,6 +23,9 @@
/*
* $Log: glu.h,v $
+ * Revision 1.8 1999/09/17 12:21:36 brianp
+ * glGetProcAddressEXT changes to accomodate Win32 and non-Win32
+ *
* Revision 1.7 1999/09/17 02:44:19 tjump
* I changed the xxxGetProcAddressEXT function declarations to be more
* MSVC friendly. Brianp - could you verify that they describe and operate
@@ -508,9 +511,12 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
* which uses this extension yet! It may change!
*/
#define GLU_EXT_get_proc_address 1
-typedef (GLAPIENTRY *gluProcAddress)();
-gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName);
-
+#ifdef __WIN32__
+ typedef (void (GLAPIENTRY *gluProcAddress))();
+ gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName);
+#else
+ GLUAPI void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))();
+#endif
diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c
index 110e267aa8f..e844633906f 100644
--- a/src/glu/mesa/glu.c
+++ b/src/glu/mesa/glu.c
@@ -1,4 +1,4 @@
-/* $Id: glu.c,v 1.13 1999/09/17 03:17:18 tjump Exp $ */
+/* $Id: glu.c,v 1.14 1999/09/17 12:21:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,6 +23,9 @@
/*
* $Log: glu.c,v $
+ * Revision 1.14 1999/09/17 12:21:53 brianp
+ * glGetProcAddressEXT changes to accomodate Win32 and non-Win32
+ *
* Revision 1.13 1999/09/17 03:17:18 tjump
* Patch error fixup
*
@@ -376,10 +379,12 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name )
#ifdef GLU_EXT_get_proc_address
#ifdef __cplusplus
-/* for BeOS R4.5 */
-gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName)
+ /* for BeOS R4.5 */
+ void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(...)
+#elif defined(__WIN32__)
+ gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName)
#else
-gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName)
+ void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))()
#endif
{
struct proc {
@@ -407,7 +412,11 @@ gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName)
for (i = 0; procTable[i].address; i++) {
if (strcmp((const char *) procName, procTable[i].name) == 0)
+#ifdef __WIN32__
return (gluProcAddress) procTable[i].address;
+#else
+ return (void (*)()) procTable[i].address;
+#endif
}
return NULL;