diff options
author | Darkvater <darkvater@openttd.org> | 2006-12-09 23:55:56 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-12-09 23:55:56 +0000 |
commit | 74106ce6e90c2871ac78f21390ce01da6ec4f209 (patch) | |
tree | db4b5a398448256d50bf2166c258937fe8f07aa7 /win32.h | |
parent | 5f8f0e4e47bda12d75239977a7519ceae9518a75 (diff) | |
download | openttd-74106ce6e90c2871ac78f21390ce01da6ec4f209.tar.xz |
(svn r7460) -Fix (r7337): [win32] If the underlying OS didn't have support for SHGetFolderPath the
application failed to run. Now test if the function exists and if not try a different
approach using our own OTTDSHGetFolderPath wrapper.
Diffstat (limited to 'win32.h')
-rw-r--r-- | win32.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3,6 +3,7 @@ #ifndef WIN32_H #define WIN32_H +#include <windows.h> bool MyShowCursor(bool show); typedef void (*Function)(int); @@ -23,6 +24,14 @@ wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen); # define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str) #endif +/* Override SHGetFolderPath with our custom implementation */ +#if defined(SHGetFolderPath) +#undef SHGetFolderPath +#endif +#define SHGetFolderPath OTTDSHGetFolderPath + +HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR); + #if defined(__MINGW32__) #define SHGFP_TYPE_CURRENT 0 #endif /* __MINGW32__ */ |