From 0c383901a79805370f24fd8f5bc7dc6ce3ebd757 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 24 Aug 2002 19:35:00 +0000 Subject: [PATCH] Clean up of include/osg/GL and include/osg/GLExtensions for better support of Windows build. --- include/osg/GL | 98 +++++++++++++++++++--------------------- include/osg/GLExtensions | 9 ++-- 2 files changed, 52 insertions(+), 55 deletions(-) diff --git a/include/osg/GL b/include/osg/GL index f754ec9d1..0d6a7f844 100644 --- a/include/osg/GL +++ b/include/osg/GL @@ -12,8 +12,8 @@ #ifdef __DARWIN_OSX__ #include #else - #include - #endif + #include + #endif #endif // required for compatibility with glext.h sytle function definitions of @@ -22,64 +22,60 @@ #define APIENTRY #endif -#else +#else // WIN32 -#if defined(__CYGWIN__) || defined(__MINGW32__) -# ifndef APIENTRY -# define GLUT_APIENTRY_DEFINED -# define APIENTRY __stdcall -# endif - // XXX This is from Win32's -# ifndef CALLBACK -# define CALLBACK __stdcall -# endif + #if defined(__CYGWIN__) || defined(__MINGW32__) -#else // ! __CYGWIN__ + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #define APIENTRY __stdcall + #endif + // XXX This is from Win32's + #ifndef CALLBACK + #define CALLBACK __stdcall + #endif - // Under windows avoid including - // to avoid name space pollution, but Win32's - // needs APIENTRY and WINGDIAPI defined properly. - // F - # if defined(__MWERKS__) - # define WIN32_LEAN_AND_MEAN - # include - # else - // XXX This is from Win32's - # ifndef APIENTRY - # define GLUT_APIENTRY_DEFINED - # if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) - # define APIENTRY __stdcall - # else - # define APIENTRY - # endif - # endif - // XXX This is from Win32's - # ifndef CALLBACK - # if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) - # define CALLBACK __stdcall - # else - # define CALLBACK - # endif - # endif + #else // ! __CYGWIN__ -#endif // __CYGWIN__ + // Under windows avoid including + // to avoid name space pollution, but Win32's + // needs APIENTRY and WINGDIAPI defined properly. + // XXX This is from Win32's + #ifndef APIENTRY + #define GLUT_APIENTRY_DEFINED + #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) + #define APIENTRY __stdcall + #else + #define APIENTRY + #endif + #endif - // XXX This is from Win32's and -# ifndef WINGDIAPI -# define GLUT_WINGDIAPI_DEFINED -# define WINGDIAPI __declspec(dllimport) -# endif - // XXX This is from Win32's -# ifndef _WCHAR_T_DEFINED -typedef unsigned short wchar_t; -# define _WCHAR_T_DEFINED -# endif -# endif + // XXX This is from Win32's + #ifndef CALLBACK + #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #endif + + #endif // __CYGWIN__ + + // XXX This is from Win32's and + #ifndef WINGDIAPI + #define GLUT_WINGDIAPI_DEFINED + #define WINGDIAPI __declspec(dllimport) + #endif + // XXX This is from Win32's + #ifndef _WCHAR_T_DEFINED + typedef unsigned short wchar_t; + #define _WCHAR_T_DEFINED + #endif #ifndef __gl_h_ #include #endif -#endif +#endif // WIN32 #endif // __osgGL_h diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions index bf25edd90..486649b2f 100644 --- a/include/osg/GLExtensions +++ b/include/osg/GLExtensions @@ -8,12 +8,13 @@ #include #if defined(WIN32) -#include + #define WIN32_LEAN_AND_MEAN + #include #elif defined(__DARWIN_OSX__) -#include -#include + #include + #include #else -#include + #include #endif namespace osg {