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

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