diff --git a/applications/present3D/Cluster.cpp b/applications/present3D/Cluster.cpp index 86785b1c6..4dc9c4f24 100644 --- a/applications/present3D/Cluster.cpp +++ b/applications/present3D/Cluster.cpp @@ -18,7 +18,7 @@ #include #include -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) #include #include #include @@ -51,7 +51,7 @@ #elif defined (__APPLE__) #include #include -#elif defined (WIN32) +#elif defined (_WIN32) #include #include #elif defined (__hpux) @@ -63,7 +63,7 @@ #include #include #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #else #include @@ -265,7 +265,7 @@ Receiver::Receiver( void ) Receiver::~Receiver( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -274,7 +274,7 @@ Receiver::~Receiver( void ) bool Receiver::init( void ) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -295,7 +295,7 @@ bool Receiver::init( void ) int result = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // const BOOL on = TRUE; // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); #else @@ -312,7 +312,7 @@ bool Receiver::init( void ) // struct sockaddr_in saddr; saddr.sin_family = AF_INET; saddr.sin_port = htons( _port ); -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) saddr.sin_addr.s_addr = htonl(INADDR_ANY); #else saddr.sin_addr.s_addr = 0; @@ -366,7 +366,7 @@ void Receiver::sync( void ) tv.tv_sec = 0; tv.tv_usec = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // saddr.sin_port = htons( _port ); int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) @@ -419,7 +419,7 @@ Broadcaster::Broadcaster( void ) Broadcaster::~Broadcaster( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -428,7 +428,7 @@ Broadcaster::~Broadcaster( void ) bool Broadcaster::init( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -446,7 +446,7 @@ bool Broadcaster::init( void ) perror( "Socket" ); return false; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) const BOOL on = TRUE; #else int on = 1; @@ -454,7 +454,7 @@ bool Broadcaster::init( void ) int result = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int)); #else result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); @@ -466,24 +466,24 @@ bool Broadcaster::init( void ) saddr.sin_port = htons( _port ); if( _address == 0 ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int)); #else result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); #endif if (result) return false; -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) struct ifreq ifr; #endif #if defined (__linux) || defined(__CYGWIN__) strcpy( ifr.ifr_name, "eth0" ); #elif defined(__sun) strcpy( ifr.ifr_name, "hme0" ); -#elif !defined (WIN32) +#elif !defined (_WIN32) strcpy( ifr.ifr_name, "ef0" ); #endif -#if defined (WIN32) // get the server address +#if defined (_WIN32) // get the server address saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); } #else @@ -543,7 +543,7 @@ void Broadcaster::sync( void ) } int result = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) unsigned int size = sizeof( SOCKADDR_IN ); result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); // int err = WSAGetLastError (); diff --git a/applications/present3D/Cluster.h b/applications/present3D/Cluster.h index f594d9c52..6c25c2c2c 100644 --- a/applications/present3D/Cluster.h +++ b/applications/present3D/Cluster.h @@ -19,7 +19,7 @@ #include -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #else #include "winsock.h" @@ -51,7 +51,7 @@ class Receiver bool init( void ); private : -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) SOCKET _so; SOCKADDR_IN saddr; #else @@ -94,7 +94,7 @@ class Broadcaster bool init( void ); private : -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKET _so; #else int _so; @@ -103,7 +103,7 @@ class Broadcaster short _port; void *_buffer; unsigned int _buffer_size; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKADDR_IN saddr; #else struct sockaddr_in saddr; diff --git a/examples/osgcluster/broadcaster.cpp b/examples/osgcluster/broadcaster.cpp index a1a21432f..d968f4372 100644 --- a/examples/osgcluster/broadcaster.cpp +++ b/examples/osgcluster/broadcaster.cpp @@ -21,7 +21,7 @@ #include #include -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) #include #include #include @@ -54,7 +54,7 @@ #elif defined (__APPLE__) #include #include -#elif defined (WIN32) +#elif defined (_WIN32) #include #include #elif defined (__hpux) @@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void ) _ifr_name = "eth0"; #elif defined(__sun) _ifr_name = "hme0"; -#elif !defined (WIN32) +#elif !defined (_WIN32) _ifr_name = "ef0"; #endif _port = 0; @@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void ) Broadcaster::~Broadcaster( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void ) bool Broadcaster::init( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -111,13 +111,13 @@ bool Broadcaster::init( void ) perror( "Socket" ); return false; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) const BOOL on = TRUE; #else int on = 1; #endif -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int)); #else setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); @@ -127,17 +127,17 @@ bool Broadcaster::init( void ) saddr.sin_port = htons( _port ); if( _address == 0 ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int)); #else setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); #endif -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) struct ifreq ifr; strcpy( ifr.ifr_name, _ifr_name.c_str()); #endif -#if defined (WIN32) // get the server address +#if defined (_WIN32) // get the server address saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); } #else @@ -202,7 +202,7 @@ void Broadcaster::sync( void ) return; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) unsigned int size = sizeof( SOCKADDR_IN ); sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); int err = WSAGetLastError (); diff --git a/examples/osgcluster/broadcaster.h b/examples/osgcluster/broadcaster.h index 8f9648cb3..bcdd68aa2 100644 --- a/examples/osgcluster/broadcaster.h +++ b/examples/osgcluster/broadcaster.h @@ -29,7 +29,7 @@ // Class definition for broadcasting a buffer to a LAN // -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -65,7 +65,7 @@ class Broadcaster std::string _ifr_name; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKET _so; #else int _so; @@ -74,7 +74,7 @@ class Broadcaster short _port; void *_buffer; unsigned int _buffer_size; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKADDR_IN saddr; #else struct sockaddr_in saddr; diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index 832e09290..e2ba41d7a 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -36,7 +36,7 @@ #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #endif diff --git a/examples/osgcluster/receiver.cpp b/examples/osgcluster/receiver.cpp index 6ab5e7931..985fab4e5 100644 --- a/examples/osgcluster/receiver.cpp +++ b/examples/osgcluster/receiver.cpp @@ -19,7 +19,7 @@ #include #include #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #else #include @@ -46,7 +46,7 @@ Receiver::Receiver( void ) Receiver::~Receiver( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -55,7 +55,7 @@ Receiver::~Receiver( void ) bool Receiver::init( void ) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -73,7 +73,7 @@ bool Receiver::init( void ) perror( "Socket" ); return false; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // const BOOL on = TRUE; // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); #else @@ -84,7 +84,7 @@ bool Receiver::init( void ) // struct sockaddr_in saddr; saddr.sin_family = AF_INET; saddr.sin_port = htons( _port ); -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) saddr.sin_addr.s_addr = htonl(INADDR_ANY); #else saddr.sin_addr.s_addr = 0; @@ -137,7 +137,7 @@ unsigned int Receiver::sync( void ) tv.tv_sec = 0; tv.tv_usec = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // saddr.sin_port = htons( _port ); recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) diff --git a/examples/osgcluster/receiver.h b/examples/osgcluster/receiver.h index 7b2a3b5d5..3d4877cff 100644 --- a/examples/osgcluster/receiver.h +++ b/examples/osgcluster/receiver.h @@ -28,7 +28,7 @@ // Class definition for the recipient of a broadcasted message // -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -53,7 +53,7 @@ class Receiver bool init( void ); private : -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) SOCKET _so; SOCKADDR_IN saddr; #else diff --git a/examples/osghangglide/terrain_coords.h b/examples/osghangglide/terrain_coords.h index 04aad2fd2..948c003d4 100644 --- a/examples/osghangglide/terrain_coords.h +++ b/examples/osghangglide/terrain_coords.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osghangglide/terrain_normals.h b/examples/osghangglide/terrain_normals.h index bfe1dc705..081f5c96f 100644 --- a/examples/osghangglide/terrain_normals.h +++ b/examples/osghangglide/terrain_normals.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osghangglide/terrain_texcoords.h b/examples/osghangglide/terrain_texcoords.h index 33cd35149..adc4c822f 100644 --- a/examples/osghangglide/terrain_texcoords.h +++ b/examples/osghangglide/terrain_texcoords.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 9de15b188..33775af9a 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -417,7 +417,7 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video."); arguments.getApplicationUsage()->addCommandLineOption("--interactive","Use camera manipulator to allow movement around movie."); arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom."); -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit."); #endif @@ -433,7 +433,7 @@ int main(int argc, char** argv) return 1; } -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) // if user requests devices video capability. if (arguments.read("-devices") || arguments.read("--devices")) { diff --git a/examples/osgshadow/terrain_coords.h b/examples/osgshadow/terrain_coords.h index 04aad2fd2..948c003d4 100644 --- a/examples/osgshadow/terrain_coords.h +++ b/examples/osgshadow/terrain_coords.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osgsimulation/osgsimulation.cpp b/examples/osgsimulation/osgsimulation.cpp index c5509b43a..dd114e2fb 100644 --- a/examples/osgsimulation/osgsimulation.cpp +++ b/examples/osgsimulation/osgsimulation.cpp @@ -16,7 +16,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) ///////////////////////////////////////////////////////////////////////////// // Disable unavoidable warning messages: @@ -32,7 +32,7 @@ #pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786) -#endif // WIN32 +#endif // _WIN32 #include #include diff --git a/examples/osgunittests/UnitTestFramework.cpp b/examples/osgunittests/UnitTestFramework.cpp index 13305fb05..b9f88d8f9 100644 --- a/examples/osgunittests/UnitTestFramework.cpp +++ b/examples/osgunittests/UnitTestFramework.cpp @@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl): _traceLevel(tl), _outputStreamPtr(&o), -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) _nullStream("nul") #else _nullStream("/dev/null") diff --git a/examples/osgviewerWX/osgviewerWX.cpp b/examples/osgviewerWX/osgviewerWX.cpp index 7befa2f30..d5a6aac02 100644 --- a/examples/osgviewerWX/osgviewerWX.cpp +++ b/examples/osgviewerWX/osgviewerWX.cpp @@ -10,7 +10,7 @@ #endif // For wxCURSOR_BLANK below, but isn't used a.t.m. -//#ifdef WIN32 +//#ifdef _WIN32 //#include "wx/msw/wx.rc" //#endif diff --git a/include/OpenThreads/Exports b/include/OpenThreads/Exports index bf2620993..8755ce51a 100644 --- a/include/OpenThreads/Exports +++ b/include/OpenThreads/Exports @@ -16,7 +16,7 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #define OPENTHREAD_EXPORT_DIRECTIVE #else #if defined( OT_LIBRARY_STATIC ) diff --git a/include/osg/Notify b/include/osg/Notify index 9e21a8695..9bb8e684b 100644 --- a/include/osg/Notify +++ b/include/osg/Notify @@ -126,7 +126,7 @@ public: void notify(osg::NotifySeverity severity, const char *message); }; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) /** Redirects notification stream to windows debugger with use of * OuputDebugString functions. diff --git a/include/osg/Timer b/include/osg/Timer index ac1a452d1..acc3ab79f 100644 --- a/include/osg/Timer +++ b/include/osg/Timer @@ -18,7 +18,7 @@ namespace osg { -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) typedef unsigned __int64 Timer_t; #else typedef unsigned long long Timer_t; diff --git a/src/osg/ArgumentParser.cpp b/src/osg/ArgumentParser.cpp index c1fb6fca7..76ce9ac51 100644 --- a/src/osg/ArgumentParser.cpp +++ b/src/osg/ArgumentParser.cpp @@ -198,7 +198,7 @@ ArgumentParser::ArgumentParser(int* argc,char **argv): } #endif -#ifdef WIN32 +#ifdef _WIN32 // Remove linefeed from last argument if it exist char* lastline = argc==0 ? 0 : _argv[*argc-1]; if (lastline) diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index 5c699c8b0..c65a808b1 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -25,7 +25,7 @@ using namespace osg; using namespace std; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } #else @@ -719,7 +719,7 @@ void DisplaySettings::readEnvironmentalVariables() if (getEnvVar("OSG_KEYSTONE_FILES", value)) { - #if defined(WIN32) && !defined(__CYGWIN__) + #if defined(_WIN32) && !defined(__CYGWIN__) char delimitor = ';'; #else char delimitor = ':'; diff --git a/src/osg/GL.in b/src/osg/GL.in index 2f790be4f..e6c220318 100644 --- a/src/osg/GL.in +++ b/src/osg/GL.in @@ -42,7 +42,7 @@ #define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@" -#ifndef WIN32 +#ifndef _WIN32 // Required for compatibility with glext.h style function definitions of // OpenGL extensions, such as in src/osg/Point.cpp. @@ -50,7 +50,7 @@ #define APIENTRY #endif -#else // WIN32 +#else // _WIN32 #if defined(__CYGWIN__) || defined(__MINGW32__) @@ -103,7 +103,7 @@ #define _WCHAR_T_DEFINED #endif -#endif // WIN32 +#endif // _WIN32 #if defined(OSG_GL3_AVAILABLE) #define GL3_PROTOTYPES 1 diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 88c139c13..375ba86be 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -27,7 +27,7 @@ #include #include -#if defined(WIN32) +#if defined(_WIN32) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif // WIN32_LEAN_AND_MEAN @@ -174,7 +174,7 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord)); } - #if defined(WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE)) + #if defined(_WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE)) // add WGL extensions to the list @@ -340,7 +340,7 @@ OSG_INIT_SINGLETON_PROXY(GLExtensionDisableStringInitializationProxy, osg::getGL #endif return dlsym(handle, funcName); - #elif defined(WIN32) + #elif defined(_WIN32) #if defined(OSG_GLES2_AVAILABLE) static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll")); diff --git a/src/osg/Notify.cpp b/src/osg/Notify.cpp index c4cef6029..16c609e79 100644 --- a/src/osg/Notify.cpp +++ b/src/osg/Notify.cpp @@ -241,7 +241,7 @@ void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char fputs(message, stdout); } -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN diff --git a/src/osg/PagedLOD.cpp b/src/osg/PagedLOD.cpp index e2680b2bd..461758567 100644 --- a/src/osg/PagedLOD.cpp +++ b/src/osg/PagedLOD.cpp @@ -98,7 +98,7 @@ void PagedLOD::setDatabasePath(const std::string& path) /* // make sure the last character is the appropriate slash -#ifdef WIN32 +#ifdef _WIN32 if (lastCharacter==unixSlash) { lastCharacter = winSlash; diff --git a/src/osg/Timer.cpp b/src/osg/Timer.cpp index 873e2e6c8..0fec87f05 100644 --- a/src/osg/Timer.cpp +++ b/src/osg/Timer.cpp @@ -20,7 +20,7 @@ using namespace osg; // follows are the constructors of the Timer class, once version -// for each OS combination. The order is WIN32, FreeBSD, Linux, IRIX, +// for each OS combination. The order is _WIN32, FreeBSD, Linux, IRIX, // and the rest of the world. // // all the rest of the timer methods are implemented within the header. @@ -32,7 +32,7 @@ Timer* Timer::instance() return &s_timer; } -#ifdef WIN32 +#ifdef _WIN32 #include #include diff --git a/src/osgDB/ConvertUTF.cpp b/src/osgDB/ConvertUTF.cpp index 1b5013a89..caaf3672a 100644 --- a/src/osgDB/ConvertUTF.cpp +++ b/src/osgDB/ConvertUTF.cpp @@ -17,7 +17,7 @@ #include #include -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN #include #endif @@ -39,7 +39,7 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* s){return convert std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if (sourceLength == 0) { return std::string(); @@ -71,7 +71,7 @@ std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength) std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if (sourceLength == 0) { return std::wstring(); @@ -103,7 +103,7 @@ std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength) std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned sourceLength) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if (sourceLength == 0) { return std::string(); @@ -132,7 +132,7 @@ std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned sourceLength) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if (sourceLength == 0) { return std::string(); diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 856250d1a..253231154 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -34,7 +34,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #else #include diff --git a/src/osgDB/DynamicLibrary.cpp b/src/osgDB/DynamicLibrary.cpp index 913429245..c26cd4a0a 100644 --- a/src/osgDB/DynamicLibrary.cpp +++ b/src/osgDB/DynamicLibrary.cpp @@ -19,7 +19,7 @@ #endif #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include #include @@ -59,7 +59,7 @@ DynamicLibrary::~DynamicLibrary() if (_handle) { OSG_INFO<<"Closing DynamicLibrary "<<_name<(_handle), FALSE); @@ -95,7 +95,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr { HANDLE handle = NULL; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #ifdef OSG_USE_UTF8_FILENAME handle = LoadLibraryW( convertUTF8toUTF16(libraryName).c_str() ); #else @@ -150,7 +150,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& procName) { if (_handle==NULL) return NULL; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) return osg::convertPointerType( GetProcAddress( (HMODULE)_handle, procName.c_str() ) ); #elif defined(__APPLE__) && defined(APPLE_PRE_10_3) std::string temp("_"); diff --git a/src/osgDB/FileNameUtils.cpp b/src/osgDB/FileNameUtils.cpp index ceb09ebe9..bcc59ae3b 100644 --- a/src/osgDB/FileNameUtils.cpp +++ b/src/osgDB/FileNameUtils.cpp @@ -18,13 +18,13 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #endif #if defined(__sgi) #include -#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__) +#elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__) #include using std::tolower; #endif @@ -98,7 +98,7 @@ std::string osgDB::convertFileNameToUnixStyle(const std::string& fileName) char osgDB::getNativePathSeparator() { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) return WINDOWS_PATH_SEPARATOR; #else return UNIX_PATH_SEPARATOR; @@ -107,7 +107,7 @@ char osgDB::getNativePathSeparator() bool osgDB::isFileNameNativeStyle(const std::string& fileName) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) return fileName.find(UNIX_PATH_SEPARATOR) == std::string::npos; // return true if no unix style slash exist #else return fileName.find(WINDOWS_PATH_SEPARATOR) == std::string::npos; // return true if no windows style backslash exist @@ -116,7 +116,7 @@ bool osgDB::isFileNameNativeStyle(const std::string& fileName) std::string osgDB::convertFileNameToNativeStyle(const std::string& fileName) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) return convertFileNameToWindowsStyle(fileName); #else return convertFileNameToUnixStyle(fileName); @@ -261,7 +261,7 @@ std::string osgDB::getServerFileName(const std::string& filename) std::string osgDB::concatPaths(const std::string& left, const std::string& right) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) const char delimiterNative = WINDOWS_PATH_SEPARATOR; const char delimiterForeign = UNIX_PATH_SEPARATOR; #else @@ -291,7 +291,7 @@ std::string osgDB::concatPaths(const std::string& left, const std::string& right std::string osgDB::getRealPath(const std::string& path) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #ifdef OSG_USE_UTF8_FILENAME diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index c0c8cec88..09e98f334 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -24,7 +24,7 @@ typedef char TCHAR; // the mac version will change soon to reflect the path scheme under osx, but // for now, the above include is commented out, and the below code takes precedence. -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include #define WINBASE_DECLARE_GET_MODULE_HANDLE_EX #include @@ -204,7 +204,7 @@ bool osgDB::makeDirectory( const std::string &path ) { std::string dir = paths.top(); - #if defined(WIN32) + #if defined(_WIN32) //catch drive name if (dir.size() == 2 && dir.c_str()[1] == ':') { paths.pop(); @@ -274,7 +274,7 @@ bool osgDB::setCurrentWorkingDirectory( const std::string &newCurrentWorkingDire void osgDB::convertStringPathIntoFilePathList(const std::string& paths,FilePathList& filepath) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) char delimitor = ';'; #else char delimitor = ':'; @@ -342,7 +342,7 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis OSG_DEBUG << "itr='" <<*itr<< "'\n"; std::string path = itr->empty() ? filename : concatPaths(*itr, filename); -#ifdef WIN32 +#ifdef _WIN32 // if combined file path exceeds MAX_PATH then ignore as it's not a legal path otherwise subsequent IO calls with this path may result in undefined behavior if (path.length()>MAX_PATH) continue; #endif @@ -355,7 +355,7 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis OSG_DEBUG << "FindFileInPath() : USING " << path << "\n"; return path; } -#ifndef WIN32 +#ifndef _WIN32 // windows already case insensitive so no need to retry.. else if (caseSensitivity==CASE_INSENSITIVE) { @@ -395,7 +395,7 @@ std::string osgDB::findFileInDirectory(const std::string& fileName,const std::st std::string realFileName = fileName; // Skip case-insensitive recursion if on Windows - #ifdef WIN32 + #ifdef _WIN32 bool win32 = true; #else bool win32 = false; @@ -535,7 +535,7 @@ static void appendInstallationLibraryFilePaths(osgDB::FilePathList& filepath) #endif } -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include @@ -763,7 +763,7 @@ bool osgDB::containsCurrentWorkingDirectoryReference(const FilePathList& paths) convertStringPathIntoFilePathList("/usr/bin/:/usr/local/bin/",filepath); } -#elif defined(WIN32) +#elif defined(_WIN32) void osgDB::appendPlatformSpecificLibraryFilePaths(FilePathList& filepath) { diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 2262e9dae..51f66e834 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -39,7 +39,7 @@ #if defined(__sgi) #include -#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__) +#elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__) #include using std::tolower; #endif @@ -53,7 +53,7 @@ using namespace osg; using namespace osgDB; -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) static osg::ApplicationUsageProxy Registry_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FILE_PATH [:path]..","Paths for locating datafiles"); static osg::ApplicationUsageProxy Registry_e1(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_LIBRARY_PATH [:path]..","Paths for locating libraries/ plugins"); #else @@ -787,7 +787,7 @@ std::string Registry::createLibraryNameForExtension(const std::string& ext) return prepend+"cygwin_"+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; #elif defined(__MINGW32__) return prepend+"mingw_"+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; -#elif defined(WIN32) +#elif defined(_WIN32) return prepend+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; #elif macintosh return prepend+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES; @@ -803,7 +803,7 @@ std::string Registry::createLibraryNameForNodeKit(const std::string& name) return "cyg"+name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; #elif defined(__MINGW32__) return "lib"+name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; -#elif defined(WIN32) +#elif defined(_WIN32) return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; #elif macintosh return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES; diff --git a/src/osgPlugins/OpenCASCADE/ReaderWriterOpenCASCADE.h b/src/osgPlugins/OpenCASCADE/ReaderWriterOpenCASCADE.h index 705259820..e6a7caffa 100644 --- a/src/osgPlugins/OpenCASCADE/ReaderWriterOpenCASCADE.h +++ b/src/osgPlugins/OpenCASCADE/ReaderWriterOpenCASCADE.h @@ -24,7 +24,7 @@ /// \brief header file for creating osgdb plugin for IGES format /// \author Abhishek Bansal, Engineer Graphics, vizExperts India Pvt. Ltd. -#ifdef WIN32 +#ifdef _WIN32 /// \brief preproccessor macro required for compilation with open cascade /// \todo not sure what it does #define WNT diff --git a/src/osgPlugins/cfg/Camera.cpp b/src/osgPlugins/cfg/Camera.cpp index 10534809a..1f3fed965 100644 --- a/src/osgPlugins/cfg/Camera.cpp +++ b/src/osgPlugins/cfg/Camera.cpp @@ -11,7 +11,7 @@ * OpenSceneGraph Public License for more details. */ -#ifdef WIN32 +#ifdef _WIN32 #include #endif diff --git a/src/osgPlugins/cfg/ConfigLexer.cpp b/src/osgPlugins/cfg/ConfigLexer.cpp index 4e169efe4..a1470b7f4 100644 --- a/src/osgPlugins/cfg/ConfigLexer.cpp +++ b/src/osgPlugins/cfg/ConfigLexer.cpp @@ -29,7 +29,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp index 62d30c3f5..d42171004 100644 --- a/src/osgPlugins/cfg/ConfigParser.cpp +++ b/src/osgPlugins/cfg/ConfigParser.cpp @@ -210,7 +210,7 @@ -#ifndef WIN32 +#ifndef _WIN32 #include #include #include @@ -218,7 +218,7 @@ #endif #if 0 -#ifndef WIN32 +#ifndef _WIN32 #define SUPPORT_CPP 1 #endif #endif diff --git a/src/osgPlugins/cfg/RenderSurface.cpp b/src/osgPlugins/cfg/RenderSurface.cpp index ffa4b9e3f..3d6da15ee 100644 --- a/src/osgPlugins/cfg/RenderSurface.cpp +++ b/src/osgPlugins/cfg/RenderSurface.cpp @@ -221,7 +221,7 @@ void RenderSurface::setDisplay( Display *dpy ) Producer::Display *RenderSurface::getDisplay() { -#ifdef WIN32 +#ifdef _WIN32 return &_hdc; #else return _dpy; @@ -230,7 +230,7 @@ Producer::Display *RenderSurface::getDisplay() const Producer::Display *RenderSurface::getDisplay() const { -#ifdef WIN32 +#ifdef _WIN32 return &_hdc; #else return _dpy; @@ -434,7 +434,7 @@ void RenderSurface::setWindow( const Window win ) return; } _win = win; -#ifdef WIN32 +#ifdef _WIN32 _ownWindow = false; #endif } diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp index 39341977e..41e1a4056 100644 --- a/src/osgPlugins/dae/ReaderWriterDAE.cpp +++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp @@ -26,7 +26,7 @@ #include "daeReader.h" #include "daeWriter.h" -#ifdef WIN32 +#ifdef _WIN32 #include "windows.h" #endif diff --git a/src/osgPlugins/dae/daeRMaterials.cpp b/src/osgPlugins/dae/daeRMaterials.cpp index 5da9d608a..4763cdb5b 100644 --- a/src/osgPlugins/dae/daeRMaterials.cpp +++ b/src/osgPlugins/dae/daeRMaterials.cpp @@ -907,7 +907,7 @@ std::string daeReader::processImagePath(const domImage* pDomImage) const OSG_WARN << "Unable to get path from URI." << std::endl; return std::string(); } -#ifdef WIN32 +#ifdef _WIN32 // If the path has a drive specifier or a UNC name then strip the leading / if (path.size() > 2 && (path[2] == ':' || (path[1] == '/' && path[2] == '/'))) return path.substr(1, std::string::npos); diff --git a/src/osgPlugins/dae/daeWMaterials.cpp b/src/osgPlugins/dae/daeWMaterials.cpp index 2be1cc665..69f207c5e 100644 --- a/src/osgPlugins/dae/daeWMaterials.cpp +++ b/src/osgPlugins/dae/daeWMaterials.cpp @@ -27,7 +27,7 @@ //#include //#include -#ifdef WIN32 +#ifdef _WIN32 #include "windows.h" #endif diff --git a/src/osgPlugins/dds/ReaderWriterDDS.cpp b/src/osgPlugins/dds/ReaderWriterDDS.cpp index 184a3e310..26532d778 100644 --- a/src/osgPlugins/dds/ReaderWriterDDS.cpp +++ b/src/osgPlugins/dds/ReaderWriterDDS.cpp @@ -62,7 +62,7 @@ #define GL_LUMINANCE4_ALPHA4 0x8043 #endif -// NOTICE ON WIN32: +// NOTICE ON _WIN32: // typedef DWORD unsigned long; // sizeof(DWORD) = 4 diff --git a/src/osgPlugins/fbx/ReaderWriterFBX.cpp b/src/osgPlugins/fbx/ReaderWriterFBX.cpp index db385c410..66c6e99d2 100644 --- a/src/osgPlugins/fbx/ReaderWriterFBX.cpp +++ b/src/osgPlugins/fbx/ReaderWriterFBX.cpp @@ -1,6 +1,6 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include //for strncasecmp #endif @@ -339,7 +339,7 @@ ReaderWriterFBX::readNode(const std::string& filenameInit, for (unsigned int i = 0; i < sizeof(authoringTools) / sizeof(authoringTools[0]); ++i) { if (0 == -#ifdef WIN32 +#ifdef _WIN32 _strnicmp #else strncasecmp diff --git a/src/osgPlugins/md2/ReaderWriterMD2.cpp b/src/osgPlugins/md2/ReaderWriterMD2.cpp index d5c918d40..1c1bd3ffc 100644 --- a/src/osgPlugins/md2/ReaderWriterMD2.cpp +++ b/src/osgPlugins/md2/ReaderWriterMD2.cpp @@ -29,7 +29,7 @@ #include #include -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) # include #else # include diff --git a/src/osgPlugins/osc/osc/OscHostEndianness.h b/src/osgPlugins/osc/osc/OscHostEndianness.h index fe135f46b..839bc26f9 100644 --- a/src/osgPlugins/osc/osc/OscHostEndianness.h +++ b/src/osgPlugins/osc/osc/OscHostEndianness.h @@ -42,7 +42,7 @@ // you can define one of the above symbols from the command line // then you don't have to edit this file. -#elif defined(__WIN32__) || defined(WIN32) || defined(WINCE) +#elif defined(__WIN32__) || defined(_WIN32) || defined(WINCE) // assume that __WIN32__ is only defined on little endian systems diff --git a/src/osgPlugins/osc/osc/OscOutboundPacketStream.cpp b/src/osgPlugins/osc/osc/OscOutboundPacketStream.cpp index c7ba9da82..3f495028d 100644 --- a/src/osgPlugins/osc/osc/OscOutboundPacketStream.cpp +++ b/src/osgPlugins/osc/osc/OscOutboundPacketStream.cpp @@ -33,7 +33,7 @@ #include #include -#if defined(__WIN32__) || defined(WIN32) +#if defined(__WIN32__) || defined(_WIN32) #include // for alloca #endif diff --git a/src/osgPlugins/osc/osc/OscTypes.h b/src/osgPlugins/osc/osc/OscTypes.h index b31911143..ead9d758b 100644 --- a/src/osgPlugins/osc/osc/OscTypes.h +++ b/src/osgPlugins/osc/osc/OscTypes.h @@ -35,7 +35,7 @@ namespace osc{ // basic types -#if defined(__BORLANDC__) || defined(_MSC_VER) +#if defined(__BORLANDC__) || (defined(_MSC_VER) && !defined(__clang__)) typedef __int64 int64; typedef unsigned __int64 uint64; diff --git a/src/osgPlugins/pdf/ReaderWriterPDF.cpp b/src/osgPlugins/pdf/ReaderWriterPDF.cpp index ed664eb73..23a04404e 100644 --- a/src/osgPlugins/pdf/ReaderWriterPDF.cpp +++ b/src/osgPlugins/pdf/ReaderWriterPDF.cpp @@ -121,7 +121,7 @@ class PopplerPdfImage : public osgWidget::PdfImage foundFile = osgDB::getRealPath(foundFile); OSG_NOTICE<<"foundFile = "< -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include diff --git a/src/osgPlugins/shp/ESRIShapeParser.cpp b/src/osgPlugins/shp/ESRIShapeParser.cpp index 4245f2232..d92a1eebb 100644 --- a/src/osgPlugins/shp/ESRIShapeParser.cpp +++ b/src/osgPlugins/shp/ESRIShapeParser.cpp @@ -20,7 +20,7 @@ ESRIShapeParser::ESRIShapeParser(const std::string fileName, bool useDouble, boo int fd = 0; if( !fileName.empty() ) { -#ifdef WIN32 +#ifdef _WIN32 if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 ) #else if( (fd = open( fileName.c_str(), O_RDONLY )) < 0 ) diff --git a/src/osgPlugins/shp/XBaseParser.cpp b/src/osgPlugins/shp/XBaseParser.cpp index 61119ec9e..d1eb0fc22 100644 --- a/src/osgPlugins/shp/XBaseParser.cpp +++ b/src/osgPlugins/shp/XBaseParser.cpp @@ -87,7 +87,7 @@ XBaseParser::XBaseParser(const std::string& fileName): if (!fileName.empty()) { int fd = 0; -#ifdef WIN32 +#ifdef _WIN32 if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 ) #else if( (fd = ::open( fileName.c_str(), O_RDONLY )) < 0 ) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index b9d413f20..f56122feb 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -102,7 +102,7 @@ std::string osgText::findFontFile(const std::string& str) if (!initialized) { initialized = true; - #if defined(WIN32) + #if defined(_WIN32) osgDB::convertStringPathIntoFilePathList( ".;C:/winnt/fonts;C:/windows/fonts", s_FontFilePath); diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 88156a66c..e895f98f7 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -1101,7 +1101,7 @@ bool Win32WindowingSystem::changeScreenSettings( const osg::GraphicsContext::Scr // Start by testing if the change would be successful (without applying it) // - unsigned int result = ::ChangeDisplaySettingsEx(displayDevice.DeviceName, &deviceMode, NULL, CDS_TEST, NULL); + int result = ::ChangeDisplaySettingsEx(displayDevice.DeviceName, &deviceMode, NULL, CDS_TEST, NULL); if (result==DISP_CHANGE_SUCCESSFUL) { result = ::ChangeDisplaySettingsEx(displayDevice.DeviceName, &deviceMode, NULL, 0, NULL); diff --git a/src/osgWidget/Input.cpp b/src/osgWidget/Input.cpp index 3b565b04a..899d7fd97 100644 --- a/src/osgWidget/Input.cpp +++ b/src/osgWidget/Input.cpp @@ -5,7 +5,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #endif @@ -512,7 +512,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*) { std::string data; // Data from clipboard -#ifdef WIN32 +#ifdef _WIN32 if (::OpenClipboard(NULL)) { HANDLE hData = ::GetClipboardData( CF_TEXT ); @@ -571,7 +571,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*) data = selection.createUTF8EncodedString(); // Data to clipboard -#ifdef WIN32 +#ifdef _WIN32 if(::OpenClipboard(NULL)) { ::EmptyClipboard();