Added "hack" function for glutCreateMenuUcall
Not desired, but potentially needed as with the other "hack" functions git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1821 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
2646c0c9f8
commit
deaa5b843a
@ -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 glutInitContextFuncUcall( void (* callback)( void* ), void* user_data );
|
||||||
FGAPI void FGAPIENTRY glutAppStatusFuncUcall( void (* callback)( int, 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 <stdlib.h>
|
||||||
|
|
||||||
|
#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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -106,3 +106,8 @@ int FGAPIENTRY __glutCreateMenuWithExit( void(* callback)( int ), void (__cdecl
|
|||||||
return glutCreateMenu( callback );
|
return glutCreateMenu( callback );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int FGAPIENTRY __glutCreateMenuUcallWithExit(void(*callback)(int, void*), void(__cdecl *exit_function)(int), void* user_data)
|
||||||
|
{
|
||||||
|
__glutExitFunc = exit_function;
|
||||||
|
return glutCreateMenuUcall(callback, user_data);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user