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 <errno.h>
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@ -51,7 +51,7 @@
#elif defined (__APPLE__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (WIN32)
#elif defined (_WIN32)
#include <winsock.h>
#include <stdio.h>
#elif defined (__hpux)
@ -63,7 +63,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@ -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 ();

View File

@ -19,7 +19,7 @@
#include <osgViewer/Viewer>
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#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;

View File

@ -21,7 +21,7 @@
#include <sys/types.h>
#include <iostream>
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@ -54,7 +54,7 @@
#elif defined (__APPLE__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (WIN32)
#elif defined (_WIN32)
#include <winsock.h>
#include <stdio.h>
#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 ();

View File

@ -29,7 +29,7 @@
// Class definition for broadcasting a buffer to a LAN
//
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#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;

View File

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

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@ -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)

View File

@ -28,7 +28,7 @@
// Class definition for the recipient of a broadcasted message
//
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#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

View File

@ -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

View File

@ -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

View File

@ -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

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("--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"))
{

View File

@ -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

View File

@ -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 <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>

View File

@ -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")

View File

@ -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

View File

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

View File

@ -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.

View File

@ -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;

View File

@ -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)

View File

@ -25,7 +25,7 @@
using namespace osg;
using namespace std;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include<windows.h>
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 = ':';

View File

@ -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

View File

@ -27,7 +27,7 @@
#include <set>
#include <sstream>
#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"));

View File

@ -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

View File

@ -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;

View File

@ -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 <sys/types.h>
#include <fcntl.h>

View File

@ -17,7 +17,7 @@
#include <string.h>
#include <wchar.h>
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#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();

View File

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

View File

@ -19,7 +19,7 @@
#endif
#endif
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <io.h>
#include <windows.h>
#include <winbase.h>
@ -59,7 +59,7 @@ DynamicLibrary::~DynamicLibrary()
if (_handle)
{
OSG_INFO<<"Closing DynamicLibrary "<<_name<<std::endl;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
FreeLibrary((HMODULE)_handle);
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
NSUnLinkModule(static_cast<NSModule>(_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<DynamicLibrary::PROC_ADDRESS, FARPROC>( GetProcAddress( (HMODULE)_handle, procName.c_str() ) );
#elif defined(__APPLE__) && defined(APPLE_PRE_10_3)
std::string temp("_");

View File

@ -18,13 +18,13 @@
#include <osgDB/FileNameUtils>
#include <osgDB/FileUtils>
#ifdef WIN32
#ifdef _WIN32
#include <windows.h>
#endif
#if defined(__sgi)
#include <ctype.h>
#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__)
#elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__)
#include <cctype>
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

View File

@ -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 <io.h>
#define WINBASE_DECLARE_GET_MODULE_HANDLE_EX
#include <windows.h>
@ -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 <io.h>
#include <direct.h>
@ -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)
{

View File

@ -39,7 +39,7 @@
#if defined(__sgi)
#include <ctype.h>
#elif defined(__GNUC__) || !defined(WIN32) || defined(__MWERKS__)
#elif defined(__GNUC__) || !defined(_WIN32) || defined(__MWERKS__)
#include <cctype>
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>[:path]..","Paths for locating datafiles");
static osg::ApplicationUsageProxy Registry_e1(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_LIBRARY_PATH <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;

View File

@ -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

View File

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

View File

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

View File

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

View File

@ -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
}

View File

@ -26,7 +26,7 @@
#include "daeReader.h"
#include "daeWriter.h"
#ifdef WIN32
#ifdef _WIN32
#include "windows.h"
#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;
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);

View File

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

View File

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

View File

@ -1,6 +1,6 @@
#include <sstream>
#include <memory>
#ifndef WIN32
#ifndef _WIN32
#include <strings.h>//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

View File

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

View File

@ -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

View File

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

View File

@ -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;

View File

@ -121,7 +121,7 @@ class PopplerPdfImage : public osgWidget::PdfImage
foundFile = osgDB::getRealPath(foundFile);
OSG_NOTICE<<"foundFile = "<<foundFile<<std::endl;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
std::string uri = std::string("file:///") + foundFile;
#else
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 )
#endif
#ifdef WIN32
#ifdef _WIN32
# ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN
# endif

View File

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

View File

@ -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 )

View File

@ -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 )

View File

@ -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);

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)
//
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);

View File

@ -5,7 +5,7 @@
#include <osgWidget/Input>
#include <iterator>
#ifdef WIN32
#ifdef _WIN32
#include <windows.h>
#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();