Avoid warnings when the ATEXIT_HACK is used with GCC, making the hack even uglier.
authorSven Panne <sven.panne@aedion.de>
Fri, 22 May 2009 15:50:24 +0000 (15:50 +0000)
committerSven Panne <sven.panne@aedion.de>
Fri, 22 May 2009 15:50:24 +0000 (15:50 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@819 7f0cb862-5218-0410-a997-914c9d46530a

ChangeLog
include/GL/freeglut_std.h

index e6a6c3e..0e23a81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 3248929..768157f 100644 (file)
@@ -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