From 4d880987d248ff078845027cc21ba437564ac07d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 16:24:39 +0000 Subject: Have OSMesaGetProcAddress() return new OSMESAproc typedef. --- include/GL/osmesa.h | 18 ++++++++++++------ src/mesa/drivers/osmesa/osmesa.c | 31 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index cf892b91c93..ef645905c4d 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -60,8 +60,8 @@ extern "C" { #include -#define OSMESA_MAJOR_VERSION 4 -#define OSMESA_MINOR_VERSION 1 +#define OSMESA_MAJOR_VERSION 6 +#define OSMESA_MINOR_VERSION 3 #define OSMESA_PATCH_VERSION 0 @@ -252,12 +252,18 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, +/** + * This typedef is new in Mesa 6.3. + */ +typedef void (*OSMESAproc)(); + + /* * Return pointer to the named function. - * * New in Mesa 4.1 + * Return OSMESAproc in 6.3. */ -GLAPI void * GLAPIENTRY +GLAPI OSMESAproc GLAPIENTRY OSMesaGetProcAddress( const char *funcName ); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index b25f7dca557..b95e446590e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1276,35 +1276,34 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, } -typedef void (*generic_function)(); - struct name_function { const char *Name; - generic_function Function; + OSMESAproc Function; }; static struct name_function functions[] = { - { "OSMesaCreateContext", (generic_function) OSMesaCreateContext }, - { "OSMesaCreateContextExt", (generic_function) OSMesaCreateContextExt }, - { "OSMesaDestroyContext", (generic_function) OSMesaDestroyContext }, - { "OSMesaMakeCurrent", (generic_function) OSMesaMakeCurrent }, - { "OSMesaGetCurrentContext", (generic_function) OSMesaGetCurrentContext }, - { "OSMesaPixelsStore", (generic_function) OSMesaPixelStore }, - { "OSMesaGetIntegerv", (generic_function) OSMesaGetIntegerv }, - { "OSMesaGetDepthBuffer", (generic_function) OSMesaGetDepthBuffer }, - { "OSMesaGetColorBuffer", (generic_function) OSMesaGetColorBuffer }, - { "OSMesaGetProcAddress", (generic_function) OSMesaGetProcAddress }, + { "OSMesaCreateContext", (OSMESAproc) OSMesaCreateContext }, + { "OSMesaCreateContextExt", (OSMESAproc) OSMesaCreateContextExt }, + { "OSMesaDestroyContext", (OSMESAproc) OSMesaDestroyContext }, + { "OSMesaMakeCurrent", (OSMESAproc) OSMesaMakeCurrent }, + { "OSMesaGetCurrentContext", (OSMESAproc) OSMesaGetCurrentContext }, + { "OSMesaPixelsStore", (OSMESAproc) OSMesaPixelStore }, + { "OSMesaGetIntegerv", (OSMESAproc) OSMesaGetIntegerv }, + { "OSMesaGetDepthBuffer", (OSMESAproc) OSMesaGetDepthBuffer }, + { "OSMesaGetColorBuffer", (OSMESAproc) OSMesaGetColorBuffer }, + { "OSMesaGetProcAddress", (OSMESAproc) OSMesaGetProcAddress }, { NULL, NULL } }; -GLAPI void * GLAPIENTRY + +GLAPI OSMESAproc GLAPIENTRY OSMesaGetProcAddress( const char *funcName ) { int i; for (i = 0; functions[i].Name; i++) { if (_mesa_strcmp(functions[i].Name, funcName) == 0) - return (void *) functions[i].Function; + return functions[i].Function; } - return (void *) _glapi_get_proc_address(funcName); + return _glapi_get_proc_address(funcName); } -- cgit v1.2.3