From b1857eba8932ff5da6c7bf01fac8da8ebf3687c1 Mon Sep 17 00:00:00 2001 From: Sven Panne Date: Fri, 22 May 2009 15:50:24 +0000 Subject: [PATCH] Avoid warnings when the ATEXIT_HACK is used with GCC, making the hack even uglier. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@819 7f0cb862-5218-0410-a997-914c9d46530a --- ChangeLog | 3 +++ include/GL/freeglut_std.h | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6a6c3e..0e23a81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ 2009-05-22 Sven Panne + * 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 diff --git a/include/GL/freeglut_std.h b/include/GL/freeglut_std.h index 3248929..768157f 100644 --- a/include/GL/freeglut_std.h +++ b/include/GL/freeglut_std.h @@ -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 -- 1.7.10.4