From 948f271730bcf01be3193595f1b13d7b7a96391e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 1 May 2009 08:49:19 +0000 Subject: [PATCH] From Michael Platings, compile fix for the following problem report on osg-users: "the latest SVN revision cannot be build under Windows if ?OSG_USE_UTF8_FILENAME? config option is enabled. The error occurs in ?FileUtils.cpp? file, line 663, since there is no UNICODE-capable version of the ?GetProcAddress? function. The ?OSGDB_WINDOWS_FUNCT_STRING? makro is defined as follows in that case #define OSGDB_WINDOWS_FUNCT_STRING(x) L ## #x L"W" Thus the second parameter cannot be converted from wchar_t to LPCSTR. Should we convert the second parameter from wchar_t* to LPCSTR or use the same definition for the ?OSGDB_WINDOWS_FUNCT_STRING? makro in both cases? The second error occurs in the same file, line 669. The second parameter for the ?pGetModuleHandleEx? function should be defined as wchar_t, but it?s defined as ?static char static_variable? in the line 667." --- src/osgDB/FileUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 0ea325cec..7e1fabd70 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -87,7 +87,7 @@ namespace osgDB #define OSGDB_FILENAME_TO_STRING(s) osgDB::convertUTF16toUTF8(s) #define OSGDB_FILENAME_TEXT(x) L ## x #define OSGDB_WINDOWS_FUNCT(x) x ## W -#define OSGDB_WINDOWS_FUNCT_STRING(x) L ## #x L"W" +#define OSGDB_WINDOWS_FUNCT_STRING(x) #x "W" typedef wchar_t filenamechar; typedef std::wstring filenamestring; #else @@ -663,7 +663,7 @@ static void appendInstallationLibraryFilePaths(osgDB::FilePathList& filepath) if( pGetModuleHandleEx ) { HMODULE thisModule = 0; - static char static_variable = 0; // Variable that is located in DLL address space. + static filenamechar static_variable = 0; // Variable that is located in DLL address space. if( pGetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, &static_variable, &thisModule) ) {