From: Rudolf Polzer Date: Mon, 16 May 2011 12:46:06 +0000 (+0200) Subject: fix some compile errors on win32 X-Git-Tag: xonotic-v0.5.0~24 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3e7f1b162fcbb5297de686c92794aefe648f32d2;p=xonotic%2Fnetradiant.git fix some compile errors on win32 --- diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 00b5bad7..b0df68fa 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -190,7 +190,8 @@ const GUID qFOLDERID_SavedGames = {0x4C5C32FF, 0xBB9D, 0x43b0, {0xB5, 0xB4, 0x2D #define qREFKNOWNFOLDERID GUID #define qKF_FLAG_CREATE 0x8000 #define qKF_FLAG_NO_ALIAS 0x1000 -static HRESULT (WINAPI *qSHGetKnownFolderPath) (qREFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath); +typedef HRESULT (WINAPI qSHGetKnownFolderPath_t) (qREFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath); +static qSHGetKnownFolderPath_t *qSHGetKnownFolderPath; #endif void HomePaths_Realise() { @@ -216,14 +217,14 @@ void HomePaths_Realise() wchar_t *mydocsdirw; HMODULE shfolder = LoadLibrary("shfolder.dll"); if(shfolder) - qSHGetKnownFolderPath = GetProcAddress(shfolder, "SHGetKnownFolderPath"); + qSHGetKnownFolderPath = (qSHGetKnownFolderPath_t *) GetProcAddress(shfolder, "SHGetKnownFolderPath"); else qSHGetKnownFolderPath = NULL; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - if(qSHGetKnownFolderPath && qSHGetKnownFolderPath(&qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw) == S_OK) + if(qSHGetKnownFolderPath && qSHGetKnownFolderPath(qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw) == S_OK) { memset(mydocsdir, 0, sizeof(mydocsdir)); - wctombs(mydocsdir, mydocsdirw, sizeof(mydocsdir)-1); + wcstombs(mydocsdir, mydocsdirw, sizeof(mydocsdir)-1); CoTaskMemFree(mydocsdirw); path.clear(); path << DirectoryCleaned(mydocsdir) << (prefix+1) << "/";