glut: Silent the glut*_ATEXIT_HACK defined but not used warnings.
[mesa.git] / include / GL / glut.h
index 6f877f353fda9d6d4050a5417cef61fed981632a..d9fc938dc7a357007d2eaba31fca4823e11e4ab0 100644 (file)
@@ -25,7 +25,7 @@ extern "C" {
 
 /* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
    in your compile preprocessor options. */
-# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
+# if defined(_MSC_VER) && !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
 #  pragma comment (lib, "winmm.lib")      /* link with Windows MultiMedia lib */
 /* To enable automatic SGI OpenGL for Windows library usage for GLUT,
    define GLUT_USE_SGI_OPENGL in your compile preprocessor options.  */
@@ -74,23 +74,9 @@ extern "C" {
 #  define __cdecl
 #  define GLUT_DEFINED___CDECL
 # endif
-# ifndef _CRTIMP
-#  ifdef _NTSDK
-    /* Definition compatible with NT SDK */
-#   define _CRTIMP
-#  else
-    /* Current definition */
-#   ifdef _DLL
-#    define _CRTIMP __declspec(dllimport)
-#   else
-#    define _CRTIMP
-#   endif
-#  endif
-#  define GLUT_DEFINED__CRTIMP
-# endif
-# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
-# endif
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+#include <stdlib.h>
+#endif
 
 /* GLUT callback calling convention for Win32. */
 # define GLUTCALLBACK __cdecl
@@ -109,9 +95,9 @@ extern _CRTIMP void __cdecl exit(int);
 #endif
 
 /* GLUT API entry point declarations for Win32. */
-#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && defined(_DLL)
+#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && !defined(GLUT_STATIC)
 #      define GLUTAPI __declspec(dllexport)
-#elif defined(_DLL)
+#elif !defined(GLUT_STATIC)
 #   define GLUTAPI __declspec(dllimport)
 #else
 #      define GLUTAPI extern
@@ -122,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
 #  define GLUTAPIENTRY
 #  define GLUTAPIENTRYV
 #  define GLUTCALLBACK
-#  define GLUTAPI __attribute__((visibility("default")))
+#  define GLUTAPI extern __attribute__((visibility("default")))
 
 #else
 
@@ -466,8 +452,7 @@ GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
 GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
 #ifndef GLUT_BUILDING_LIB
-static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
-#define glutInit glutInit_ATEXIT_HACK
+#define glutInit(__argcp, __argv) __glutInitWithExit(__argcp, __argv, exit)
 #endif
 #endif
 GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
@@ -483,8 +468,7 @@ GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
 GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
 #ifndef GLUT_BUILDING_LIB
-static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
-#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
+#define glutCreateWindow(__title) __glutCreateWindowWithExit(__title, exit)
 #endif
 #endif
 GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
@@ -529,8 +513,7 @@ GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
 #if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
 GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
 #ifndef GLUT_BUILDING_LIB
-static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); }
-#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
+#define glutCreateMenu(__func) __glutCreateMenuWithExit(__func, exit)
 #endif
 #endif
 GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);