Skip to content

Fix native Windows MSVC build compatibility - #131

Merged
slajerek merged 3 commits into
slajerek:develfrom
c64cryptoboy:fix/msvc-devel-build
Sep 19, 2026
Merged

slajerek merged 3 commits into
slajerek:develfrom
c64cryptoboy:fix/msvc-devel-build

Conversation

@c64cryptoboy

Copy link
Copy Markdown
Contributor

This PR fixes the native Windows MSVC x64 Debug build on my end. I know the SDL3 migration is still in progress, so feel free to simply close this PR if equivalent fixes already exist in your pending work. The tested changes are here for reference.

The changes address compatibility issues without disabling security checks or suppressing runtime-library warnings.

Changes

  • Fix the two ambiguous Hjson string conversions in CGT2Favorites.cpp by first assigning each proxy to an Hjson::Value (C2440).
  • Include the header declaring SYS_Win32GetAvailableDrivesPaths in CViewFileBrowser.cpp. Your newer header-order fix is retained; I've dropped our overlapping include-path change.
  • Use octal escapes in two VICE files to address C4828/C2001. ClangCL accepts these legacy Latin-1 literals, but MSVC rejects them under /utf-8; the byte-preserving escapes let Windows-based contributors use either compiler.
  • Remove explicit msvcrtd.lib/msvcrt.lib entries from configurations already using the static runtime. This clears LNK4098 and removes the unwanted Debug runtime DLL imports.
  • Use _InterlockedExchange for the IDE64 lock when building with MSVC, which doesn't provide the __sync built-ins. GCC and Clang, including ClangCL, keep their existing path. The lock's call sites and protected code are unchanged.

No unrelated refactoring, GUI/MCP startup changes, or logging changes are included.

Testing

Built from a Visual Studio 2026 developer shell:

powershell -ExecutionPolicy Bypass -File .\build-windows.ps1 -Platform x64 -Configuration Debug -Compiler MSVC -SkipCuda

The build and link succeeded without mixed-runtime warnings; other compiler warnings remain. The final executable opened with a fresh settings directory, responded to menus, and closed with exit code 0. The settings override was verified in the runtime log. I also checked the executable's DLL imports and verified that the VICE escapes preserve the original bytes.

The IDE64 listener test reached its connection check but crashed during detach/reset cleanup. I haven't established whether that's related to the MSVC change; the log and symbolized crash report are preserved. No runtime fix for that crash is included here.

For the GUI check, I temporarily moved the legacy LogConsole.exe aside and restored it afterward because it requests .NET Framework 3.5 on this machine. That separate helper requirement is unchanged.

I've only built and run x64 MSVC Debug. The project edits also cover Release and ARM64, but those configurations and the full cross-platform CI matrix still need checking.

Tested on RetroDebugger fba993da55b596d4dc05ce05289a1d9aa01c0b7f and MTEngineSDL 0d40eb9807f1b5b90586fa0673fbedf63e4936c6, with these application changes and the separate two-line libpng fix in the engine checkout.

Companion engine fix: slajerek/MTEngineSDL#9

@slajerek
slajerek merged commit 51d40a7 into slajerek:devel Sep 19, 2026
6 checks passed
@c64cryptoboy
c64cryptoboy deleted the fix/msvc-devel-build branch September 19, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants