Avoid warnings when the ATEXIT_HACK is used with GCC, making the hack even uglier.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@819 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
f3de81ff34
commit
2bf156719b
@ -1,4 +1,7 @@
|
||||
2009-05-22 Sven Panne <sven.panne@aedion.de>
|
||||
* include/GL/freeglut_std.h: Avoid warnings when the ATEXIT_HACK is used
|
||||
with GCC, making the hack even uglier.
|
||||
|
||||
* include/GL/freeglut_std.h,src/freeglut_init.c,src/freeglut_internal.h,
|
||||
src/freeglut_menu.c,src/freeglut_window.c,src/freeglutdll.def: Added the
|
||||
ugly ATEXIT_HACK from GLUT 3.7, making freeglut binary compatible with the
|
||||
|
@ -604,11 +604,16 @@ FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl
|
||||
FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
|
||||
FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));
|
||||
#ifndef FREEGLUT_BUILDING_LIB
|
||||
static void FGAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
|
||||
#if defined(__GNUC__)
|
||||
#define FGUNUSED __attribute__((unused))
|
||||
#else
|
||||
#define FGUNUSED
|
||||
#endif
|
||||
static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
|
||||
#define glutInit glutInit_ATEXIT_HACK
|
||||
static int FGAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
|
||||
static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
|
||||
#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
|
||||
static int FGAPIENTRY glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }
|
||||
static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }
|
||||
#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user