From 465f72dcd46f506a3e4526d2092546172be8f398 Mon Sep 17 00:00:00 2001 From: "J.Ingram" <26800139+GirianSeed@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:59:22 -0400 Subject: [PATCH] Use PFNGETFOLDERPATHA typedef FARPROC is defined with an empty parameter list, which newer versions of GCC consider equivalent to (void). Compilation fails when qSHGetFolderPath gets called with arguments. --- code/sys/sys_win32.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/sys/sys_win32.c b/code/sys/sys_win32.c index f1749ca2..28f9ef34 100644 --- a/code/sys/sys_win32.c +++ b/code/sys/sys_win32.c @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #include #include #include @@ -103,7 +104,7 @@ Sys_DefaultHomePath char *Sys_DefaultHomePath( void ) { TCHAR szPath[MAX_PATH]; - FARPROC qSHGetFolderPath; + PFNSHGETFOLDERPATHA qSHGetFolderPath; HMODULE shfolder = LoadLibrary("shfolder.dll"); if(shfolder == NULL) @@ -114,7 +115,7 @@ char *Sys_DefaultHomePath( void ) if(!*homePath && com_homepath) { - qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA"); + qSHGetFolderPath = (PFNSHGETFOLDERPATHA)GetProcAddress(shfolder, "SHGetFolderPathA"); if(qSHGetFolderPath == NULL) { Com_Printf("Unable to find SHGetFolderPath in SHFolder.dll\n"); @@ -239,7 +240,7 @@ char* Sys_MicrosoftStorePath(void) if (!microsoftStorePath[0]) { TCHAR szPath[MAX_PATH]; - FARPROC qSHGetFolderPath; + PFNSHGETFOLDERPATHA qSHGetFolderPath; HMODULE shfolder = LoadLibrary("shfolder.dll"); if(shfolder == NULL) @@ -248,7 +249,7 @@ char* Sys_MicrosoftStorePath(void) return microsoftStorePath; } - qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA"); + qSHGetFolderPath = (PFNSHGETFOLDERPATHA)GetProcAddress(shfolder, "SHGetFolderPathA"); if(qSHGetFolderPath == NULL) { Com_Printf("Unable to find SHGetFolderPath in SHFolder.dll\n");