From a735c3d1ac9f8963157923452fd60ec95350e3a9 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 7 Mar 2008 21:59:10 +0000 Subject: [PATCH] Possible win95 fix git-svn-id: https://svn.eduke32.com/eduke32@632 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/compat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/polymer/build/src/compat.c b/polymer/build/src/compat.c index ffaf8efe3..989819124 100644 --- a/polymer/build/src/compat.c +++ b/polymer/build/src/compat.c @@ -335,10 +335,13 @@ char *Bgetcwd(char *buf, bsize_t size) char *Bgethomedir(void) { #ifdef _WIN32 + FARPROC aSHGetSpecialFolderPathA; TCHAR appdata[MAX_PATH]; - if (SUCCEEDED(SHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE))) - return strdup(appdata); + aSHGetSpecialFolderPathA = GetProcAddress(GetModuleHandle("shell32.dll"), "SHGetSpecialFolderPathA"); + if (aSHGetSpecialFolderPathA != NULL) + if (SUCCEEDED(aSHGetSpecialFolderPathA(NULL, appdata, CSIDL_APPDATA, FALSE))) + return strdup(appdata); return NULL; #elif defined __APPLE__ FSRef ref;