Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/filesystem.cpp b/src/filesystem.cpp
- index 8b5c6c1..ed83bbe 100644
- --- a/src/filesystem.cpp
- +++ b/src/filesystem.cpp
- @@ -540,9 +540,10 @@ void set_preferences_dir(std::string path)
- //allow absolute path override
- game_config::preferences_dir = path;
- } else {
- - WINAPI BOOL (*SHGetSpecialFolderPath)(HWND, LPTSTR, int, BOOL);
- + typedef BOOL (WINAPI *SHGSFPAddress)(HWND, LPTSTR, int, BOOL);
- + SHGSFPAddress SHGetSpecialFolderPath;
- HMODULE module = LoadLibrary("shell32");
- - SHGetSpecialFolderPath = (WINAPI BOOL (*)(HWND, LPTSTR, int, BOOL))GetProcAddress(module, "SHGetSpecialFolderPathA");
- + SHGetSpecialFolderPath = (SHGSFPAddress)GetProcAddress(module, "SHGetSpecialFolderPathA");
- if(SHGetSpecialFolderPath) {
- LOG_FS << "Using SHGetSpecialFolderPath to find My Documents\n";
- char my_documents_path[MAX_PATH];
Advertisement
Add Comment
Please, Sign In to add comment