mirror of https://github.com/OpenTTD/OpenTTD
(svn r25153) -Fix [FS#5522] (r24487): [Win32] Don't statically link to SHGetFolderPath as it may not exist.
parent
aa2c1ce4b0
commit
d1212e0b1a
|
@ -173,7 +173,7 @@ static FT_Error GetFontByFaceName(const char *font_name, FT_Face *face)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, vbuffer))) {
|
if (!SUCCEEDED(OTTDSHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, vbuffer))) {
|
||||||
DEBUG(freetype, 0, "SHGetFolderPath cannot return fonts directory");
|
DEBUG(freetype, 0, "SHGetFolderPath cannot return fonts directory");
|
||||||
goto folder_error;
|
goto folder_error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,14 +505,14 @@ void DetermineBasePaths(const char *exe)
|
||||||
char tmp[MAX_PATH];
|
char tmp[MAX_PATH];
|
||||||
TCHAR path[MAX_PATH];
|
TCHAR path[MAX_PATH];
|
||||||
#ifdef WITH_PERSONAL_DIR
|
#ifdef WITH_PERSONAL_DIR
|
||||||
SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path);
|
OTTDSHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path);
|
||||||
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
||||||
AppendPathSeparator(tmp, MAX_PATH);
|
AppendPathSeparator(tmp, MAX_PATH);
|
||||||
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
||||||
AppendPathSeparator(tmp, MAX_PATH);
|
AppendPathSeparator(tmp, MAX_PATH);
|
||||||
_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
|
_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
|
||||||
|
|
||||||
SHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, path);
|
OTTDSHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, path);
|
||||||
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
||||||
AppendPathSeparator(tmp, MAX_PATH);
|
AppendPathSeparator(tmp, MAX_PATH);
|
||||||
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
||||||
|
|
|
@ -40,12 +40,6 @@ extern uint _codepage; // local code-page in the system @see win32_v.cpp:WM_INPU
|
||||||
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str)
|
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Override SHGetFolderPath with our custom implementation */
|
|
||||||
#if defined(SHGetFolderPath)
|
|
||||||
#undef SHGetFolderPath
|
|
||||||
#endif
|
|
||||||
#define SHGetFolderPath OTTDSHGetFolderPath
|
|
||||||
|
|
||||||
HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR);
|
HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR);
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
|
|
Loading…
Reference in New Issue