diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 183198619..4303ccb67 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -26,6 +26,32 @@ #include #include +#if defined(WIN32) + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif // WIN32_LEAN_AND_MEAN + #ifndef NOMINMAX + #define NOMINMAX + #endif // NOMINMAX + #include +#elif defined(__APPLE__) + // The NS*Symbol* stuff found in is deprecated. + // Since 10.3 (Panther) OS X has provided the dlopen/dlsym/dlclose + // family of functions under . Since 10.4 (Tiger), Apple claimed + // the dlfcn family was significantly faster than the NS*Symbol* family. + // Since 'deprecated' needs to be taken very seriously with the + // coming of 10.5 (Leopard), it makes sense to use the dlfcn family when possible. + #include + #if !defined(MAC_OS_X_VERSION_10_3) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3) + #define USE_APPLE_LEGACY_NSSYMBOL + #include + #else + #include + #endif +#else + #include +#endif + typedef std::set ExtensionSet; static osg::buffered_object s_glExtensionSetList; static osg::buffered_object s_glRendererList; @@ -347,31 +373,6 @@ std::string& osg::getGLExtensionDisableString() } #else - #if defined(WIN32) - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif // WIN32_LEAN_AND_MEAN - #ifndef NOMINMAX - #define NOMINMAX - #endif // NOMINMAX - #include - #elif defined(__APPLE__) - // The NS*Symbol* stuff found in is deprecated. - // Since 10.3 (Panther) OS X has provided the dlopen/dlsym/dlclose - // family of functions under . Since 10.4 (Tiger), Apple claimed - // the dlfcn family was significantly faster than the NS*Symbol* family. - // Since 'deprecated' needs to be taken very seriously with the - // coming of 10.5 (Leopard), it makes sense to use the dlfcn family when possible. - #include - #if !defined(MAC_OS_X_VERSION_10_3) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3) - #define USE_APPLE_LEGACY_NSSYMBOL - #include - #else - #include - #endif - #else - #include - #endif void* osg::getGLExtensionFuncPtr(const char *funcName) {