. Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility

with the IBM VisualAge C++ compiler. Eventually some more code will be
   needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
   for the IBM compilers, however we currently build using our own header files
   that already handle this.

 . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
   with the IBM VisualAge C++ compiler in src-glu.

 . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
   with 0 warnings now.

 . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
   code with a #if 0 to avoid a compiler warning, but it looks dangerous.
This commit is contained in:
Kendall Bennett
1999-11-11 03:21:43 +00:00
parent cb5ecb883e
commit a73119234c
6 changed files with 101 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: gl.h,v 1.18 1999/11/11 01:27:17 brianp Exp $ */
/* $Id: gl.h,v 1.19 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -77,14 +77,18 @@
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# define GLAPIENTRYP __stdcall *
# define GLCALLBACK __stdcall
# define GLCALLBACKP __stdcall *
# define GLWINAPI __stdcall
# define GLWINAPIV __cdecl
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
# define GLAPIENTRYP *
# define GLCALLBACK
# define GLCALLBACKP *
# define GLWINAPI
# define GLWINAPIV
#endif /* WIN32 / CYGWIN32 bracket */

View File

@@ -1,4 +1,4 @@
/* $Id: glu.h,v 1.15 1999/11/11 01:27:17 brianp Exp $ */
/* $Id: glu.h,v 1.16 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -134,7 +134,7 @@ extern "C" {
/* NURBS */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_PARAMETRIC_TOLERANC 100202
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_SAMPLING_METHOD 100205

View File

@@ -1,4 +1,4 @@
/* $Id: nurbs.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: nurbs.c,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,25 @@
/*
* $Log: nurbs.c,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.2 1999/11/11 03:21:43 kendallb
*
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
* with the IBM VisualAge C++ compiler. Eventually some more code will be
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
* for the IBM compilers, however we currently build using our own header files
* that already handle this.
*
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
* with the IBM VisualAge C++ compiler in src-glu.
*
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
* with 0 warnings now.
*
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.14 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
@@ -600,12 +617,12 @@ void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
void GLAPIENTRY
gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACK *fn)())
gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACKP fn)())
{
#if defined(__CYGWIN32__) || defined(OPENSTEP)
nobj->error_callback = (void(*)(GLenum))fn;
#else
nobj->error_callback = (void(GLCALLBACK*)(GLenum))fn;
nobj->error_callback = (void(GLCALLBACKP)(GLenum))fn;
#endif
if(which!=GLU_ERROR)

View File

@@ -1,4 +1,4 @@
/* $Id: nurbs.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: nurbs.h,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,25 @@
/*
* $Log: nurbs.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.2 1999/11/11 03:21:43 kendallb
*
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
* with the IBM VisualAge C++ compiler. Eventually some more code will be
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
* for the IBM compilers, however we currently build using our own header files
* that already handle this.
*
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
* with the IBM VisualAge C++ compiler in src-glu.
*
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
* with 0 warnings now.
*
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.5 1999/02/27 13:55:31 brianp
* fixed BeOS-related GLU typedef problems
@@ -151,7 +168,7 @@ typedef struct
struct GLUnurbs {
GLboolean culling;
GLenum error;
void (GLCALLBACK *error_callback)( GLenum err );
void (GLCALLBACKP error_callback)( GLenum err );
GLenum display_mode;
GLU_nurbs_enum nurbs_type;
GLboolean auto_load_matrix;

View File

@@ -1,4 +1,4 @@
/* $Id: quadric.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: quadric.c,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,25 @@
/*
* $Log: quadric.c,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.2 1999/11/11 03:21:43 kendallb
*
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
* with the IBM VisualAge C++ compiler. Eventually some more code will be
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
* for the IBM compilers, however we currently build using our own header files
* that already handle this.
*
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
* with the IBM VisualAge C++ compiler in src-glu.
*
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
* with 0 warnings now.
*
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.19 1999/02/27 13:55:31 brianp
* fixed BeOS-related GLU typedef problems
@@ -105,17 +122,6 @@
#ifndef M_PI
# define M_PI (3.1415926)
#endif
/*
* Convert degrees to radians:
*/
#define DEG_TO_RAD(A) ((A)*(M_PI/180.0))
/*
* Sin and Cos for degree angles:
*/
@@ -135,7 +141,7 @@ struct GLUquadric {
GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */
GLboolean TextureFlag; /* Generate texture coords? */
GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */
void (GLCALLBACK *ErrorFunc)(GLenum err); /* Error handler callback function */
void (GLCALLBACKP ErrorFunc)(GLenum err); /* Error handler callback function */
};
@@ -221,7 +227,7 @@ void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
* Set the error handler callback function.
*/
void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
GLenum which, void (GLCALLBACK *fn)() )
GLenum which, void (GLCALLBACKP fn)() )
{
/*
* UGH, this is a mess! I thought ANSI was a standard.
@@ -232,13 +238,13 @@ void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
#elif defined(OPENSTEP)
qobj->ErrorFunc = (void(*)(GLenum))fn;
#elif defined(_WIN32)
qobj->ErrorFunc = (void(GLCALLBACK*)(int))fn;
qobj->ErrorFunc = (void(GLCALLBACKP)(int))fn;
#elif defined(__STORM__)
qobj->ErrorFunc = (void(GLCALLBACK*)(GLenum))fn;
qobj->ErrorFunc = (void(GLCALLBACKP)(GLenum))fn;
#elif defined(__BEOS__)
qobj->ErrorFunc = (void(*)(GLenum))fn;
#else
qobj->ErrorFunc = (void(GLCALLBACK*)())fn;
qobj->ErrorFunc = (void(GLCALLBACKP)())fn;
#endif
}
}

View File

@@ -1,4 +1,4 @@
/* $Id: tess.c,v 1.20 1999/11/05 20:36:55 gareth Exp $ */
/* $Id: tess.c,v 1.21 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -388,60 +388,60 @@ void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj )
* gluTessCallback
*****************************************************************************/
void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
void (GLCALLBACK *fn)() )
void (GLCALLBACKP fn)() )
{
switch ( which )
{
/* Register the begin callbacks. */
case GLU_TESS_BEGIN:
tobj->callbacks.begin = (void (GLCALLBACK*)(GLenum)) fn;
tobj->callbacks.begin = (void (GLCALLBACKP)(GLenum)) fn;
break;
case GLU_TESS_BEGIN_DATA:
tobj->callbacks.beginData = (void (GLCALLBACK*)(GLenum, void *)) fn;
tobj->callbacks.beginData = (void (GLCALLBACKP)(GLenum, void *)) fn;
break;
/* Register the edge flag callbacks. */
case GLU_TESS_EDGE_FLAG:
tobj->callbacks.edgeFlag = (void (GLCALLBACK*)(GLboolean)) fn;
tobj->callbacks.edgeFlag = (void (GLCALLBACKP)(GLboolean)) fn;
break;
case GLU_TESS_EDGE_FLAG_DATA:
tobj->callbacks.edgeFlagData =
(void (GLCALLBACK*)(GLboolean, void *)) fn;
(void (GLCALLBACKP)(GLboolean, void *)) fn;
break;
/* Register the vertex callbacks. */
case GLU_TESS_VERTEX:
tobj->callbacks.vertex = (void (GLCALLBACK*)(void *)) fn;
tobj->callbacks.vertex = (void (GLCALLBACKP)(void *)) fn;
break;
case GLU_TESS_VERTEX_DATA:
tobj->callbacks.vertexData = (void (GLCALLBACK*)(void *, void *)) fn;
tobj->callbacks.vertexData = (void (GLCALLBACKP)(void *, void *)) fn;
break;
/* Register the end callbacks. */
case GLU_TESS_END:
tobj->callbacks.end = (void (GLCALLBACK*)(void)) fn;
tobj->callbacks.end = (void (GLCALLBACKP)(void)) fn;
break;
case GLU_TESS_END_DATA:
tobj->callbacks.endData = (void (GLCALLBACK*)(void *)) fn;
tobj->callbacks.endData = (void (GLCALLBACKP)(void *)) fn;
break;
/* Register the error callbacks. */
case GLU_TESS_ERROR:
tobj->callbacks.error = (void (GLCALLBACK*)(GLenum)) fn;
tobj->callbacks.error = (void (GLCALLBACKP)(GLenum)) fn;
break;
case GLU_TESS_ERROR_DATA:
tobj->callbacks.errorData = (void (GLCALLBACK*)(GLenum, void *)) fn;
tobj->callbacks.errorData = (void (GLCALLBACKP)(GLenum, void *)) fn;
break;
/* Register the combine callbacks. */
case GLU_TESS_COMBINE:
tobj->callbacks.combine =
(void (GLCALLBACK*)(GLdouble[3], void *[4],
(void (GLCALLBACKP)(GLdouble[3], void *[4],
GLfloat [4], void **)) fn;
break;
case GLU_TESS_COMBINE_DATA:
tobj->callbacks.combineData =
(void (GLCALLBACK*)(GLdouble[3], void *[4], GLfloat [4],
(void (GLCALLBACKP)(GLdouble[3], void *[4], GLfloat [4],
void **, void *)) fn;
break;
@@ -597,19 +597,19 @@ void tess_error_callback( GLUtesselator *tobj, GLenum errnum )
*****************************************************************************/
static void init_callbacks( tess_callbacks_t *callbacks )
{
callbacks->begin = ( void (GLCALLBACK*)(GLenum) ) NULL;
callbacks->beginData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL;
callbacks->edgeFlag = ( void (GLCALLBACK*)(GLboolean) ) NULL;
callbacks->edgeFlagData = ( void (GLCALLBACK*)(GLboolean, void *) ) NULL;
callbacks->vertex = ( void (GLCALLBACK*)(void *) ) NULL;
callbacks->vertexData = ( void (GLCALLBACK*)(void *, void *) ) NULL;
callbacks->end = ( void (GLCALLBACK*)(void) ) NULL;
callbacks->endData = ( void (GLCALLBACK*)(void *) ) NULL;
callbacks->error = ( void (GLCALLBACK*)(GLenum) ) NULL;
callbacks->errorData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL;
callbacks->combine = ( void (GLCALLBACK*)(GLdouble [3], void *[4],
callbacks->begin = ( void (GLCALLBACKP)(GLenum) ) NULL;
callbacks->beginData = ( void (GLCALLBACKP)(GLenum, void *) ) NULL;
callbacks->edgeFlag = ( void (GLCALLBACKP)(GLboolean) ) NULL;
callbacks->edgeFlagData = ( void (GLCALLBACKP)(GLboolean, void *) ) NULL;
callbacks->vertex = ( void (GLCALLBACKP)(void *) ) NULL;
callbacks->vertexData = ( void (GLCALLBACKP)(void *, void *) ) NULL;
callbacks->end = ( void (GLCALLBACKP)(void) ) NULL;
callbacks->endData = ( void (GLCALLBACKP)(void *) ) NULL;
callbacks->error = ( void (GLCALLBACKP)(GLenum) ) NULL;
callbacks->errorData = ( void (GLCALLBACKP)(GLenum, void *) ) NULL;
callbacks->combine = ( void (GLCALLBACKP)(GLdouble [3], void *[4],
GLfloat [4], void **) ) NULL;
callbacks->combineData = ( void (GLCALLBACK*)(GLdouble [3], void *[4],
callbacks->combineData = ( void (GLCALLBACKP)(GLdouble [3], void *[4],
GLfloat [4], void **,
void *) ) NULL;
}