Dynload winmm, which is weird but it fixes vs2022 builds

This commit is contained in:
IoI_xD 2026-08-08 16:24:23 -07:00
commit 9856979906
5 changed files with 28 additions and 3 deletions

View file

@ -1090,7 +1090,19 @@ int MwLibraryInit(void) {
int i;
#ifdef _WIN32
timeBeginPeriod(10);
/*
There's no Windows configuration that Milsko supports that doesn't have winmm.
However, uhh, Visual Studio 2022. For some fucking reason.
Thanks for coming to my TED Talk.
*/
char winmmPath[MAX_PATH] = {0};
GetSystemDirectory(winmmPath, MAX_PATH);
strcat_s(winmmPath, MAX_PATH, "\\winmm.dll");
MwLL_winmmLib = LoadLibraryA(winmmPath);
MwLL_PFN_timeGetTime = (void *)GetProcAddress(MwLL_winmmLib, "timeGetTime");
MwLL_PFN_timeBeginPeriod = (void *)GetProcAddress(MwLL_winmmLib, "timeBeginPeriod");
MwLL_PFN_timeBeginPeriod(10);
#endif
#ifdef USE_WAYLAND