Files
MINGW-packages/mingw-w64-gnuplot/04-fix-build-with-gcc-15.patch
مهدي شينون (Mehdi Chinoune) ecba46ec78 gnuplot: Fix build with gcc-15
2025-05-30 19:25:52 +01:00

23 lines
678 B
Diff

--- a/src/win/winmain.c
+++ b/src/win/winmain.c
@@ -271,7 +271,9 @@
{
HMODULE hShell32;
FARPROC pSHGetSpecialFolderPath;
- static char dir[MAX_PATH] = "";
+ typedef UINT (CALLBACK* GETFOLDERPATH)
+ (HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate);
+ static char dir[MAX_PATH] = {'\0'};
if (dir[0])
return dir;
@@ -284,7 +286,7 @@
pSHGetSpecialFolderPath =
GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
if (pSHGetSpecialFolderPath)
- (*pSHGetSpecialFolderPath)(NULL, dir, CSIDL_APPDATA, FALSE);
+ (*(GETFOLDERPATH)(pSHGetSpecialFolderPath))(NULL, dir, CSIDL_APPDATA, FALSE);
FreeModule(hShell32);
return dir;
}