X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=include%2FGL%2Ffreeglut_ucall.h;h=f6fc99a1327fdda671d242bb82aca0d48f199411;hb=897c62cf034695c0f2224955550aadabb59ec342;hp=bbbd32d9c5e7e53677d5e8ead8e6ada31a0c7336;hpb=071be85d52e073ab57e290d3ee9a458b34ff0b4e;p=freeglut diff --git a/include/GL/freeglut_ucall.h b/include/GL/freeglut_ucall.h index bbbd32d..f6fc99a 100644 --- a/include/GL/freeglut_ucall.h +++ b/include/GL/freeglut_ucall.h @@ -82,6 +82,27 @@ FGAPI void FGAPIENTRY glutInitWarningFuncUcall( void (* callback)( const char *f FGAPI void FGAPIENTRY glutInitContextFuncUcall( void (* callback)( void* ), void* user_data ); FGAPI void FGAPIENTRY glutAppStatusFuncUcall( void (* callback)( int, void* ), void* user_data ); +/* + * Continued "hack" from GLUT applied to Ucall functions. + * For more info, see bottom of freeglut_std.h + */ + +/* to get the prototype for exit() */ +#include + +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__) +FGAPI int FGAPIENTRY __glutCreateMenuUcallWithExit(void(*func)(int, void*), void(__cdecl *exitfunc)(int), void* user_data); +#ifndef FREEGLUT_BUILDING_LIB +#if defined(__GNUC__) +#define FGUNUSED __attribute__((unused)) +#else +#define FGUNUSED +#endif +static int FGAPIENTRY FGUNUSED glutCreateMenuUcall_ATEXIT_HACK(void(*func)(int, void*), void* user_data) { return __glutCreateMenuUcallWithExit(func, exit, user_data); } +#define glutCreateMenuUcall glutCreateMenuUcall_ATEXIT_HACK +#endif +#endif + #ifdef __cplusplus } #endif