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

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