build/windows_clang

This commit is contained in:
MeyerFabian 2020-07-17 18:01:05 +02:00
parent 47207248d4
commit ba70c7d543
53 changed files with 127 additions and 127 deletions

View File

@ -18,7 +18,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -51,7 +51,7 @@
#elif defined (__APPLE__) #elif defined (__APPLE__)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#elif defined (WIN32) #elif defined (_WIN32)
#include <winsock.h> #include <winsock.h>
#include <stdio.h> #include <stdio.h>
#elif defined (__hpux) #elif defined (__hpux)
@ -63,7 +63,7 @@
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h> #include <winsock.h>
#else #else
#include <unistd.h> #include <unistd.h>
@ -265,7 +265,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void ) Receiver::~Receiver( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so); closesocket( _so);
#else #else
close( _so ); close( _so );
@ -274,7 +274,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void ) bool Receiver::init( void )
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1); WORD version = MAKEWORD(1,1);
WSADATA wsaData; WSADATA wsaData;
// First, we start up Winsock // First, we start up Winsock
@ -295,7 +295,7 @@ bool Receiver::init( void )
int result = 0; int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE; // const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else #else
@ -312,7 +312,7 @@ bool Receiver::init( void )
// struct sockaddr_in saddr; // struct sockaddr_in saddr;
saddr.sin_family = AF_INET; saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY); saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else #else
saddr.sin_addr.s_addr = 0; saddr.sin_addr.s_addr = 0;
@ -366,7 +366,7 @@ void Receiver::sync( void )
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 0; tv.tv_usec = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port ); // saddr.sin_port = htons( _port );
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
@ -419,7 +419,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void ) Broadcaster::~Broadcaster( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so); closesocket( _so);
#else #else
close( _so ); close( _so );
@ -428,7 +428,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void ) bool Broadcaster::init( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1); WORD version = MAKEWORD(1,1);
WSADATA wsaData; WSADATA wsaData;
// First, we start up Winsock // First, we start up Winsock
@ -446,7 +446,7 @@ bool Broadcaster::init( void )
perror( "Socket" ); perror( "Socket" );
return false; return false;
} }
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE; const BOOL on = TRUE;
#else #else
int on = 1; int on = 1;
@ -454,7 +454,7 @@ bool Broadcaster::init( void )
int result = 0; 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)); result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else #else
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
@ -466,24 +466,24 @@ bool Broadcaster::init( void )
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
if( _address == 0 ) 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)); result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else #else
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif #endif
if (result) return false; if (result) return false;
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (_WIN32) || defined(__CYGWIN__)
struct ifreq ifr; struct ifreq ifr;
#endif #endif
#if defined (__linux) || defined(__CYGWIN__) #if defined (__linux) || defined(__CYGWIN__)
strcpy( ifr.ifr_name, "eth0" ); strcpy( ifr.ifr_name, "eth0" );
#elif defined(__sun) #elif defined(__sun)
strcpy( ifr.ifr_name, "hme0" ); strcpy( ifr.ifr_name, "hme0" );
#elif !defined (WIN32) #elif !defined (_WIN32)
strcpy( ifr.ifr_name, "ef0" ); strcpy( ifr.ifr_name, "ef0" );
#endif #endif
#if defined (WIN32) // get the server address #if defined (_WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
} }
#else #else
@ -543,7 +543,7 @@ void Broadcaster::sync( void )
} }
int result = 0; int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN ); unsigned int size = sizeof( SOCKADDR_IN );
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
// int err = WSAGetLastError (); // int err = WSAGetLastError ();

View File

@ -19,7 +19,7 @@
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
#if !defined(WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h> #include <netinet/in.h>
#else #else
#include "winsock.h" #include "winsock.h"
@ -51,7 +51,7 @@ class Receiver
bool init( void ); bool init( void );
private : private :
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
SOCKET _so; SOCKET _so;
SOCKADDR_IN saddr; SOCKADDR_IN saddr;
#else #else
@ -94,7 +94,7 @@ class Broadcaster
bool init( void ); bool init( void );
private : private :
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
SOCKET _so; SOCKET _so;
#else #else
int _so; int _so;
@ -103,7 +103,7 @@ class Broadcaster
short _port; short _port;
void *_buffer; void *_buffer;
unsigned int _buffer_size; unsigned int _buffer_size;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr; SOCKADDR_IN saddr;
#else #else
struct sockaddr_in saddr; struct sockaddr_in saddr;

View File

@ -21,7 +21,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <iostream> #include <iostream>
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -54,7 +54,7 @@
#elif defined (__APPLE__) #elif defined (__APPLE__)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#elif defined (WIN32) #elif defined (_WIN32)
#include <winsock.h> #include <winsock.h>
#include <stdio.h> #include <stdio.h>
#elif defined (__hpux) #elif defined (__hpux)
@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void )
_ifr_name = "eth0"; _ifr_name = "eth0";
#elif defined(__sun) #elif defined(__sun)
_ifr_name = "hme0"; _ifr_name = "hme0";
#elif !defined (WIN32) #elif !defined (_WIN32)
_ifr_name = "ef0"; _ifr_name = "ef0";
#endif #endif
_port = 0; _port = 0;
@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void ) Broadcaster::~Broadcaster( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so); closesocket( _so);
#else #else
close( _so ); close( _so );
@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void ) bool Broadcaster::init( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1); WORD version = MAKEWORD(1,1);
WSADATA wsaData; WSADATA wsaData;
// First, we start up Winsock // First, we start up Winsock
@ -111,13 +111,13 @@ bool Broadcaster::init( void )
perror( "Socket" ); perror( "Socket" );
return false; return false;
} }
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE; const BOOL on = TRUE;
#else #else
int on = 1; int on = 1;
#endif #endif
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int)); setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else #else
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
@ -127,17 +127,17 @@ bool Broadcaster::init( void )
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
if( _address == 0 ) if( _address == 0 )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int)); setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else #else
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif #endif
#if !defined (WIN32) || defined(__CYGWIN__) #if !defined (_WIN32) || defined(__CYGWIN__)
struct ifreq ifr; struct ifreq ifr;
strcpy( ifr.ifr_name, _ifr_name.c_str()); strcpy( ifr.ifr_name, _ifr_name.c_str());
#endif #endif
#if defined (WIN32) // get the server address #if defined (_WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
} }
#else #else
@ -202,7 +202,7 @@ void Broadcaster::sync( void )
return; return;
} }
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN ); unsigned int size = sizeof( SOCKADDR_IN );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
int err = WSAGetLastError (); int err = WSAGetLastError ();

View File

@ -29,7 +29,7 @@
// Class definition for broadcasting a buffer to a LAN // Class definition for broadcasting a buffer to a LAN
// //
#if !defined(WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
@ -65,7 +65,7 @@ class Broadcaster
std::string _ifr_name; std::string _ifr_name;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
SOCKET _so; SOCKET _so;
#else #else
int _so; int _so;
@ -74,7 +74,7 @@ class Broadcaster
short _port; short _port;
void *_buffer; void *_buffer;
unsigned int _buffer_size; unsigned int _buffer_size;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr; SOCKADDR_IN saddr;
#else #else
struct sockaddr_in saddr; struct sockaddr_in saddr;

View File

@ -36,7 +36,7 @@
#include <iostream> #include <iostream>
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h> #include <winsock.h>
#endif #endif

View File

@ -19,7 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h> #include <winsock.h>
#else #else
#include <unistd.h> #include <unistd.h>
@ -46,7 +46,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void ) Receiver::~Receiver( void )
{ {
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so); closesocket( _so);
#else #else
close( _so ); close( _so );
@ -55,7 +55,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void ) bool Receiver::init( void )
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1); WORD version = MAKEWORD(1,1);
WSADATA wsaData; WSADATA wsaData;
// First, we start up Winsock // First, we start up Winsock
@ -73,7 +73,7 @@ bool Receiver::init( void )
perror( "Socket" ); perror( "Socket" );
return false; return false;
} }
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE; // const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else #else
@ -84,7 +84,7 @@ bool Receiver::init( void )
// struct sockaddr_in saddr; // struct sockaddr_in saddr;
saddr.sin_family = AF_INET; saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port ); saddr.sin_port = htons( _port );
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY); saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else #else
saddr.sin_addr.s_addr = 0; saddr.sin_addr.s_addr = 0;
@ -137,7 +137,7 @@ unsigned int Receiver::sync( void )
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 0; tv.tv_usec = 0;
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port ); // saddr.sin_port = htons( _port );
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)

View File

@ -28,7 +28,7 @@
// Class definition for the recipient of a broadcasted message // Class definition for the recipient of a broadcasted message
// //
#if !defined(WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
@ -53,7 +53,7 @@ class Receiver
bool init( void ); bool init( void );
private : private :
#if defined (WIN32) && !defined(__CYGWIN__) #if defined (_WIN32) && !defined(__CYGWIN__)
SOCKET _so; SOCKET _so;
SOCKADDR_IN saddr; SOCKADDR_IN saddr;
#else #else

View File

@ -18,7 +18,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors. // disable the double to float errors.
#pragma warning( disable : 4305 ) #pragma warning( disable : 4305 )
#endif #endif

View File

@ -18,7 +18,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors. // disable the double to float errors.
#pragma warning( disable : 4305 ) #pragma warning( disable : 4305 )
#endif #endif

View File

@ -18,7 +18,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors. // disable the double to float errors.
#pragma warning( disable : 4305 ) #pragma warning( disable : 4305 )
#endif #endif

View File

@ -417,7 +417,7 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video."); 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("--interactive","Use camera manipulator to allow movement around movie.");
arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom."); 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."); arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
#endif #endif
@ -433,7 +433,7 @@ int main(int argc, char** argv)
return 1; return 1;
} }
#if defined(WIN32) || defined(__APPLE__) #if defined(_WIN32) || defined(__APPLE__)
// if user requests devices video capability. // if user requests devices video capability.
if (arguments.read("-devices") || arguments.read("--devices")) if (arguments.read("-devices") || arguments.read("--devices"))
{ {

View File

@ -18,7 +18,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors. // disable the double to float errors.
#pragma warning( disable : 4305 ) #pragma warning( disable : 4305 )
#endif #endif

View File

@ -16,7 +16,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Disable unavoidable warning messages: // Disable unavoidable warning messages:
@ -32,7 +32,7 @@
#pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786) #pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786)
#endif // WIN32 #endif // _WIN32
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers> #include <osgViewer/ViewerEventHandlers>

View File

@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const
TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl): TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl):
_traceLevel(tl), _traceLevel(tl),
_outputStreamPtr(&o), _outputStreamPtr(&o),
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) #if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
_nullStream("nul") _nullStream("nul")
#else #else
_nullStream("/dev/null") _nullStream("/dev/null")

View File

@ -10,7 +10,7 @@
#endif #endif
// For wxCURSOR_BLANK below, but isn't used a.t.m. // For wxCURSOR_BLANK below, but isn't used a.t.m.
//#ifdef WIN32 //#ifdef _WIN32
//#include "wx/msw/wx.rc" //#include "wx/msw/wx.rc"
//#endif //#endif

View File

@ -16,7 +16,7 @@
#include <OpenThreads/Config> #include <OpenThreads/Config>
#ifndef WIN32 #ifndef _WIN32
#define OPENTHREAD_EXPORT_DIRECTIVE #define OPENTHREAD_EXPORT_DIRECTIVE
#else #else
#if defined( OT_LIBRARY_STATIC ) #if defined( OT_LIBRARY_STATIC )

View File

@ -126,7 +126,7 @@ public:
void notify(osg::NotifySeverity severity, const char *message); 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 /** Redirects notification stream to windows debugger with use of
* OuputDebugString functions. * OuputDebugString functions.

View File

@ -18,7 +18,7 @@
namespace osg { namespace osg {
#if defined(_MSC_VER) #if defined(_MSC_VER) && !defined(__clang__)
typedef unsigned __int64 Timer_t; typedef unsigned __int64 Timer_t;
#else #else
typedef unsigned long long Timer_t; typedef unsigned long long Timer_t;

View File

@ -198,7 +198,7 @@ ArgumentParser::ArgumentParser(int* argc,char **argv):
} }
#endif #endif
#ifdef WIN32 #ifdef _WIN32
// Remove linefeed from last argument if it exist // Remove linefeed from last argument if it exist
char* lastline = argc==0 ? 0 : _argv[*argc-1]; char* lastline = argc==0 ? 0 : _argv[*argc-1];
if (lastline) if (lastline)

View File

@ -25,7 +25,7 @@
using namespace osg; using namespace osg;
using namespace std; using namespace std;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#include<windows.h> #include<windows.h>
extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; }
#else #else
@ -719,7 +719,7 @@ void DisplaySettings::readEnvironmentalVariables()
if (getEnvVar("OSG_KEYSTONE_FILES", value)) if (getEnvVar("OSG_KEYSTONE_FILES", value))
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
char delimitor = ';'; char delimitor = ';';
#else #else
char delimitor = ':'; char delimitor = ':';

View File

@ -42,7 +42,7 @@
#define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@" #define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@"
#ifndef WIN32 #ifndef _WIN32
// Required for compatibility with glext.h style function definitions of // Required for compatibility with glext.h style function definitions of
// OpenGL extensions, such as in src/osg/Point.cpp. // OpenGL extensions, such as in src/osg/Point.cpp.
@ -50,7 +50,7 @@
#define APIENTRY #define APIENTRY
#endif #endif
#else // WIN32 #else // _WIN32
#if defined(__CYGWIN__) || defined(__MINGW32__) #if defined(__CYGWIN__) || defined(__MINGW32__)
@ -103,7 +103,7 @@
#define _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED
#endif #endif
#endif // WIN32 #endif // _WIN32
#if defined(OSG_GL3_AVAILABLE) #if defined(OSG_GL3_AVAILABLE)
#define GL3_PROTOTYPES 1 #define GL3_PROTOTYPES 1

View File

@ -27,7 +27,7 @@
#include <set> #include <set>
#include <sstream> #include <sstream>
#if defined(WIN32) #if defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif // 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 (*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 // add WGL extensions to the list
@ -340,7 +340,7 @@ OSG_INIT_SINGLETON_PROXY(GLExtensionDisableStringInitializationProxy, osg::getGL
#endif #endif
return dlsym(handle, funcName); return dlsym(handle, funcName);
#elif defined(WIN32) #elif defined(_WIN32)
#if defined(OSG_GLES2_AVAILABLE) #if defined(OSG_GLES2_AVAILABLE)
static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll")); static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll"));

View File

@ -241,7 +241,7 @@ void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char
fputs(message, stdout); fputs(message, stdout);
} }
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN

View File

@ -98,7 +98,7 @@ void PagedLOD::setDatabasePath(const std::string& path)
/* /*
// make sure the last character is the appropriate slash // make sure the last character is the appropriate slash
#ifdef WIN32 #ifdef _WIN32
if (lastCharacter==unixSlash) if (lastCharacter==unixSlash)
{ {
lastCharacter = winSlash; lastCharacter = winSlash;

View File

@ -20,7 +20,7 @@
using namespace osg; using namespace osg;
// follows are the constructors of the Timer class, once version // 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. // and the rest of the world.
// //
// all the rest of the timer methods are implemented within the header. // all the rest of the timer methods are implemented within the header.
@ -32,7 +32,7 @@ Timer* Timer::instance()
return &s_timer; return &s_timer;
} }
#ifdef WIN32 #ifdef _WIN32
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -17,7 +17,7 @@
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#endif #endif
@ -39,7 +39,7 @@ std::string convertStringFromUTF8toCurrentCodePage(const char* s){return convert
std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength) std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
if (sourceLength == 0) if (sourceLength == 0)
{ {
return std::string(); return std::string();
@ -71,7 +71,7 @@ std::string convertUTF16toUTF8(const wchar_t* source, unsigned sourceLength)
std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength) std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
if (sourceLength == 0) if (sourceLength == 0)
{ {
return std::wstring(); return std::wstring();
@ -103,7 +103,7 @@ std::wstring convertUTF8toUTF16(const char* source, unsigned sourceLength)
std::string convertStringFromCurrentCodePageToUTF8(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) if (sourceLength == 0)
{ {
return std::string(); return std::string();
@ -132,7 +132,7 @@ std::string convertStringFromCurrentCodePageToUTF8(const char* source, unsigned
std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned sourceLength) std::string convertStringFromUTF8toCurrentCodePage(const char* source, unsigned sourceLength)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
if (sourceLength == 0) if (sourceLength == 0)
{ {
return std::string(); return std::string();

View File

@ -34,7 +34,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#else #else
#include <unistd.h> #include <unistd.h>

View File

@ -19,7 +19,7 @@
#endif #endif
#endif #endif
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
#include <winbase.h> #include <winbase.h>
@ -59,7 +59,7 @@ DynamicLibrary::~DynamicLibrary()
if (_handle) if (_handle)
{ {
OSG_INFO<<"Closing DynamicLibrary "<<_name<<std::endl; OSG_INFO<<"Closing DynamicLibrary "<<_name<<std::endl;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
FreeLibrary((HMODULE)_handle); FreeLibrary((HMODULE)_handle);
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3) #elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
NSUnLinkModule(static_cast<NSModule>(_handle), FALSE); NSUnLinkModule(static_cast<NSModule>(_handle), FALSE);
@ -95,7 +95,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
{ {
HANDLE handle = NULL; HANDLE handle = NULL;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#ifdef OSG_USE_UTF8_FILENAME #ifdef OSG_USE_UTF8_FILENAME
handle = LoadLibraryW( convertUTF8toUTF16(libraryName).c_str() ); handle = LoadLibraryW( convertUTF8toUTF16(libraryName).c_str() );
#else #else
@ -150,7 +150,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& procName) DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const std::string& procName)
{ {
if (_handle==NULL) return NULL; if (_handle==NULL) return NULL;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
return osg::convertPointerType<DynamicLibrary::PROC_ADDRESS, FARPROC>( GetProcAddress( (HMODULE)_handle, procName.c_str() ) ); return osg::convertPointerType<DynamicLibrary::PROC_ADDRESS, FARPROC>( GetProcAddress( (HMODULE)_handle, procName.c_str() ) );
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3) #elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
std::string temp("_"); std::string temp("_");

View File

@ -18,13 +18,13 @@
#include <osgDB/FileNameUtils> #include <osgDB/FileNameUtils>
#include <osgDB/FileUtils> #include <osgDB/FileUtils>
#ifdef WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif
#if defined(__sgi) #if defined(__sgi)
#include <ctype.h> #include <ctype.h>
#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__) #elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__)
#include <cctype> #include <cctype>
using std::tolower; using std::tolower;
#endif #endif
@ -98,7 +98,7 @@ std::string osgDB::convertFileNameToUnixStyle(const std::string& fileName)
char osgDB::getNativePathSeparator() char osgDB::getNativePathSeparator()
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
return WINDOWS_PATH_SEPARATOR; return WINDOWS_PATH_SEPARATOR;
#else #else
return UNIX_PATH_SEPARATOR; return UNIX_PATH_SEPARATOR;
@ -107,7 +107,7 @@ char osgDB::getNativePathSeparator()
bool osgDB::isFileNameNativeStyle(const std::string& fileName) 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 return fileName.find(UNIX_PATH_SEPARATOR) == std::string::npos; // return true if no unix style slash exist
#else #else
return fileName.find(WINDOWS_PATH_SEPARATOR) == std::string::npos; // return true if no windows style backslash exist 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) std::string osgDB::convertFileNameToNativeStyle(const std::string& fileName)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
return convertFileNameToWindowsStyle(fileName); return convertFileNameToWindowsStyle(fileName);
#else #else
return convertFileNameToUnixStyle(fileName); 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) 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 delimiterNative = WINDOWS_PATH_SEPARATOR;
const char delimiterForeign = UNIX_PATH_SEPARATOR; const char delimiterForeign = UNIX_PATH_SEPARATOR;
#else #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) std::string osgDB::getRealPath(const std::string& path)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#ifdef OSG_USE_UTF8_FILENAME #ifdef OSG_USE_UTF8_FILENAME

View File

@ -24,7 +24,7 @@ typedef char TCHAR;
// the mac version will change soon to reflect the path scheme under osx, but // 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. // 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 <io.h> #include <io.h>
#define WINBASE_DECLARE_GET_MODULE_HANDLE_EX #define WINBASE_DECLARE_GET_MODULE_HANDLE_EX
#include <windows.h> #include <windows.h>
@ -204,7 +204,7 @@ bool osgDB::makeDirectory( const std::string &path )
{ {
std::string dir = paths.top(); std::string dir = paths.top();
#if defined(WIN32) #if defined(_WIN32)
//catch drive name //catch drive name
if (dir.size() == 2 && dir.c_str()[1] == ':') { if (dir.size() == 2 && dir.c_str()[1] == ':') {
paths.pop(); paths.pop();
@ -274,7 +274,7 @@ bool osgDB::setCurrentWorkingDirectory( const std::string &newCurrentWorkingDire
void osgDB::convertStringPathIntoFilePathList(const std::string& paths,FilePathList& filepath) void osgDB::convertStringPathIntoFilePathList(const std::string& paths,FilePathList& filepath)
{ {
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
char delimitor = ';'; char delimitor = ';';
#else #else
char delimitor = ':'; char delimitor = ':';
@ -342,7 +342,7 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
OSG_DEBUG << "itr='" <<*itr<< "'\n"; OSG_DEBUG << "itr='" <<*itr<< "'\n";
std::string path = itr->empty() ? filename : concatPaths(*itr, filename); 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 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; if (path.length()>MAX_PATH) continue;
#endif #endif
@ -355,7 +355,7 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
OSG_DEBUG << "FindFileInPath() : USING " << path << "\n"; OSG_DEBUG << "FindFileInPath() : USING " << path << "\n";
return path; return path;
} }
#ifndef WIN32 #ifndef _WIN32
// windows already case insensitive so no need to retry.. // windows already case insensitive so no need to retry..
else if (caseSensitivity==CASE_INSENSITIVE) else if (caseSensitivity==CASE_INSENSITIVE)
{ {
@ -395,7 +395,7 @@ std::string osgDB::findFileInDirectory(const std::string& fileName,const std::st
std::string realFileName = fileName; std::string realFileName = fileName;
// Skip case-insensitive recursion if on Windows // Skip case-insensitive recursion if on Windows
#ifdef WIN32 #ifdef _WIN32
bool win32 = true; bool win32 = true;
#else #else
bool win32 = false; bool win32 = false;
@ -535,7 +535,7 @@ static void appendInstallationLibraryFilePaths(osgDB::FilePathList& filepath)
#endif #endif
} }
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
#include <io.h> #include <io.h>
#include <direct.h> #include <direct.h>
@ -763,7 +763,7 @@ bool osgDB::containsCurrentWorkingDirectoryReference(const FilePathList& paths)
convertStringPathIntoFilePathList("/usr/bin/:/usr/local/bin/",filepath); convertStringPathIntoFilePathList("/usr/bin/:/usr/local/bin/",filepath);
} }
#elif defined(WIN32) #elif defined(_WIN32)
void osgDB::appendPlatformSpecificLibraryFilePaths(FilePathList& filepath) void osgDB::appendPlatformSpecificLibraryFilePaths(FilePathList& filepath)
{ {

View File

@ -39,7 +39,7 @@
#if defined(__sgi) #if defined(__sgi)
#include <ctype.h> #include <ctype.h>
#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__) #elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__)
#include <cctype> #include <cctype>
using std::tolower; using std::tolower;
#endif #endif
@ -53,7 +53,7 @@
using namespace osg; using namespace osg;
using namespace osgDB; 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>[:path]..","Paths for locating datafiles"); static osg::ApplicationUsageProxy Registry_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FILE_PATH <path>[:path]..","Paths for locating datafiles");
static osg::ApplicationUsageProxy Registry_e1(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_LIBRARY_PATH <path>[:path]..","Paths for locating libraries/ plugins"); static osg::ApplicationUsageProxy Registry_e1(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_LIBRARY_PATH <path>[:path]..","Paths for locating libraries/ plugins");
#else #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"; return prepend+"cygwin_"+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll";
#elif defined(__MINGW32__) #elif defined(__MINGW32__)
return prepend+"mingw_"+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; 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"; return prepend+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll";
#elif macintosh #elif macintosh
return prepend+"osgdb_"+lowercase_ext+OSG_LIBRARY_POSTFIX_WITH_QUOTES; 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"; return "cyg"+name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll";
#elif defined(__MINGW32__) #elif defined(__MINGW32__)
return "lib"+name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; return "lib"+name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll";
#elif defined(WIN32) #elif defined(_WIN32)
return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll"; return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES+".dll";
#elif macintosh #elif macintosh
return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES; return name+OSG_LIBRARY_POSTFIX_WITH_QUOTES;

View File

@ -24,7 +24,7 @@
/// \brief header file for creating osgdb plugin for IGES format /// \brief header file for creating osgdb plugin for IGES format
/// \author Abhishek Bansal, Engineer Graphics, vizExperts India Pvt. Ltd. /// \author Abhishek Bansal, Engineer Graphics, vizExperts India Pvt. Ltd.
#ifdef WIN32 #ifdef _WIN32
/// \brief preproccessor macro required for compilation with open cascade /// \brief preproccessor macro required for compilation with open cascade
/// \todo not sure what it does /// \todo not sure what it does
#define WNT #define WNT

View File

@ -11,7 +11,7 @@
* OpenSceneGraph Public License for more details. * OpenSceneGraph Public License for more details.
*/ */
#ifdef WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif

View File

@ -29,7 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <iostream>
#ifndef WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#endif #endif

View File

@ -210,7 +210,7 @@
#ifndef WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <stdlib.h> #include <stdlib.h>
@ -218,7 +218,7 @@
#endif #endif
#if 0 #if 0
#ifndef WIN32 #ifndef _WIN32
#define SUPPORT_CPP 1 #define SUPPORT_CPP 1
#endif #endif
#endif #endif

View File

@ -221,7 +221,7 @@ void RenderSurface::setDisplay( Display *dpy )
Producer::Display *RenderSurface::getDisplay() Producer::Display *RenderSurface::getDisplay()
{ {
#ifdef WIN32 #ifdef _WIN32
return &_hdc; return &_hdc;
#else #else
return _dpy; return _dpy;
@ -230,7 +230,7 @@ Producer::Display *RenderSurface::getDisplay()
const Producer::Display *RenderSurface::getDisplay() const const Producer::Display *RenderSurface::getDisplay() const
{ {
#ifdef WIN32 #ifdef _WIN32
return &_hdc; return &_hdc;
#else #else
return _dpy; return _dpy;
@ -434,7 +434,7 @@ void RenderSurface::setWindow( const Window win )
return; return;
} }
_win = win; _win = win;
#ifdef WIN32 #ifdef _WIN32
_ownWindow = false; _ownWindow = false;
#endif #endif
} }

View File

@ -26,7 +26,7 @@
#include "daeReader.h" #include "daeReader.h"
#include "daeWriter.h" #include "daeWriter.h"
#ifdef WIN32 #ifdef _WIN32
#include "windows.h" #include "windows.h"
#endif #endif

View File

@ -907,7 +907,7 @@ std::string daeReader::processImagePath(const domImage* pDomImage) const
OSG_WARN << "Unable to get path from URI." << std::endl; OSG_WARN << "Unable to get path from URI." << std::endl;
return std::string(); return std::string();
} }
#ifdef WIN32 #ifdef _WIN32
// If the path has a drive specifier or a UNC name then strip the leading / // 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] == '/'))) if (path.size() > 2 && (path[2] == ':' || (path[1] == '/' && path[2] == '/')))
return path.substr(1, std::string::npos); return path.substr(1, std::string::npos);

View File

@ -27,7 +27,7 @@
//#include <dom/domLibrary_effects.h> //#include <dom/domLibrary_effects.h>
//#include <dom/domLibrary_materials.h> //#include <dom/domLibrary_materials.h>
#ifdef WIN32 #ifdef _WIN32
#include "windows.h" #include "windows.h"
#endif #endif

View File

@ -62,7 +62,7 @@
#define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE4_ALPHA4 0x8043
#endif #endif
// NOTICE ON WIN32: // NOTICE ON _WIN32:
// typedef DWORD unsigned long; // typedef DWORD unsigned long;
// sizeof(DWORD) = 4 // sizeof(DWORD) = 4

View File

@ -1,6 +1,6 @@
#include <sstream> #include <sstream>
#include <memory> #include <memory>
#ifndef WIN32 #ifndef _WIN32
#include <strings.h>//for strncasecmp #include <strings.h>//for strncasecmp
#endif #endif
@ -339,7 +339,7 @@ ReaderWriterFBX::readNode(const std::string& filenameInit,
for (unsigned int i = 0; i < sizeof(authoringTools) / sizeof(authoringTools[0]); ++i) for (unsigned int i = 0; i < sizeof(authoringTools) / sizeof(authoringTools[0]); ++i)
{ {
if (0 == if (0 ==
#ifdef WIN32 #ifdef _WIN32
_strnicmp _strnicmp
#else #else
strncasecmp strncasecmp

View File

@ -29,7 +29,7 @@
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
# include <io.h> # include <io.h>
#else #else
# include <unistd.h> # include <unistd.h>

View File

@ -42,7 +42,7 @@
// you can define one of the above symbols from the command line // you can define one of the above symbols from the command line
// then you don't have to edit this file. // 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 // assume that __WIN32__ is only defined on little endian systems

View File

@ -33,7 +33,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#if defined(__WIN32__) || defined(WIN32) #if defined(__WIN32__) || defined(_WIN32)
#include <malloc.h> // for alloca #include <malloc.h> // for alloca
#endif #endif

View File

@ -35,7 +35,7 @@ namespace osc{
// basic types // basic types
#if defined(__BORLANDC__) || defined(_MSC_VER) #if defined(__BORLANDC__) || (defined(_MSC_VER) && !defined(__clang__))
typedef __int64 int64; typedef __int64 int64;
typedef unsigned __int64 uint64; typedef unsigned __int64 uint64;

View File

@ -121,7 +121,7 @@ class PopplerPdfImage : public osgWidget::PdfImage
foundFile = osgDB::getRealPath(foundFile); foundFile = osgDB::getRealPath(foundFile);
OSG_NOTICE<<"foundFile = "<<foundFile<<std::endl; OSG_NOTICE<<"foundFile = "<<foundFile<<std::endl;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
std::string uri = std::string("file:///") + foundFile; std::string uri = std::string("file:///") + foundFile;
#else #else
std::string uri = std::string("file:") + foundFile; std::string uri = std::string("file:") + foundFile;

View File

@ -55,7 +55,7 @@ WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#pragma warning( disable : 4996 ) #pragma warning( disable : 4996 )
#endif #endif
#ifdef WIN32 #ifdef _WIN32
# ifndef LITTLE_ENDIAN # ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN # define LITTLE_ENDIAN
# endif # endif

View File

@ -2,7 +2,7 @@
#define OSG_SHAPE_H #define OSG_SHAPE_H
#include <stdio.h> #include <stdio.h>
#ifndef WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <osg/Referenced> #include <osg/Referenced>

View File

@ -20,7 +20,7 @@ ESRIShapeParser::ESRIShapeParser(const std::string fileName, bool useDouble, boo
int fd = 0; int fd = 0;
if( !fileName.empty() ) if( !fileName.empty() )
{ {
#ifdef WIN32 #ifdef _WIN32
if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 ) if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 )
#else #else
if( (fd = open( fileName.c_str(), O_RDONLY )) < 0 ) if( (fd = open( fileName.c_str(), O_RDONLY )) < 0 )

View File

@ -87,7 +87,7 @@ XBaseParser::XBaseParser(const std::string& fileName):
if (!fileName.empty()) if (!fileName.empty())
{ {
int fd = 0; int fd = 0;
#ifdef WIN32 #ifdef _WIN32
if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 ) if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 )
#else #else
if( (fd = ::open( fileName.c_str(), O_RDONLY )) < 0 ) if( (fd = ::open( fileName.c_str(), O_RDONLY )) < 0 )

View File

@ -102,7 +102,7 @@ std::string osgText::findFontFile(const std::string& str)
if (!initialized) if (!initialized)
{ {
initialized = true; initialized = true;
#if defined(WIN32) #if defined(_WIN32)
osgDB::convertStringPathIntoFilePathList( osgDB::convertStringPathIntoFilePathList(
".;C:/winnt/fonts;C:/windows/fonts", ".;C:/winnt/fonts;C:/windows/fonts",
s_FontFilePath); s_FontFilePath);

View File

@ -1101,7 +1101,7 @@ bool Win32WindowingSystem::changeScreenSettings( const osg::GraphicsContext::Scr
// Start by testing if the change would be successful (without applying it) // 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) if (result==DISP_CHANGE_SUCCESSFUL)
{ {
result = ::ChangeDisplaySettingsEx(displayDevice.DeviceName, &deviceMode, NULL, 0, NULL); result = ::ChangeDisplaySettingsEx(displayDevice.DeviceName, &deviceMode, NULL, 0, NULL);

View File

@ -5,7 +5,7 @@
#include <osgWidget/Input> #include <osgWidget/Input>
#include <iterator> #include <iterator>
#ifdef WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif
@ -512,7 +512,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*)
{ {
std::string data; std::string data;
// Data from clipboard // Data from clipboard
#ifdef WIN32 #ifdef _WIN32
if (::OpenClipboard(NULL)) if (::OpenClipboard(NULL))
{ {
HANDLE hData = ::GetClipboardData( CF_TEXT ); HANDLE hData = ::GetClipboardData( CF_TEXT );
@ -571,7 +571,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*)
data = selection.createUTF8EncodedString(); data = selection.createUTF8EncodedString();
// Data to clipboard // Data to clipboard
#ifdef WIN32 #ifdef _WIN32
if(::OpenClipboard(NULL)) if(::OpenClipboard(NULL))
{ {
::EmptyClipboard(); ::EmptyClipboard();