Repository navigation
Fix include case and MSVC-only constructs for other compilers - #67
Merged
Merged
Conversation
seelenkuchen
marked this pull request as ready for review
November 2, 2026 22:38
Include paths now match the case on disk, and Windows SDK headers use the lowercase names MinGW ships. No effect on case-insensitive Windows builds. Validation (whole series, MinGW-w64 i686 GCC 13, DX9 Debug, under Wine 10): - Pass: j3dcore.Macros 7/7, rdroid.Math 9/9, sound 37/37, smush 181 + 1 ignored, sith 38/38, sith.DSS 32 + 1 ignored. - Fail: std 263/265. stdConffile %a scan and the Printf __LINE__ text, both known from the toolchain trial. - Not run: MSVC builds (not possible on this host), DX6, Release, guard and QOL profiles, std.System, the game itself. byacc does not build under MinGW (Windows.h case in Programs/byacc/main.c), so programs are off. - Only the final commit of the series can be built with MinGW; earlier ones were not built individually.
Same as the engine includes: lowercase windows.h, the name MinGW and case-sensitive hosts ship. No effect on MSVC.
C99 plain inline needs an external definition elsewhere, which MSVC does not require and GCC does. None of these functions has one, is hooked, or has its address taken, per a repo search. MSVC build of this change is unverified. Validation (whole series, MinGW-w64 i686 GCC 13, DX9 Debug, under Wine 10): - Pass: j3dcore.Macros 7/7, rdroid.Math 9/9, sound 37/37, smush 181 + 1 ignored, sith 38/38, sith.DSS 32 + 1 ignored. - Fail: std 263/265. stdConffile %a scan and the Printf __LINE__ text, both known from the toolchain trial. - Not run: MSVC builds (not possible on this host), DX6, Release, guard and QOL profiles, std.System, the game itself. byacc does not build under MinGW (Windows.h case in Programs/byacc/main.c), so programs are off. - Only the final commit of the series can be built with MinGW; earlier ones were not built individually.
Adds missing assert.h and float.h includes, GCC syntax for the fnstcw in stdStartup, and LPDIRECT3DDEVICE9 in place of the same-typed PDIRECT3DDEVICE9. MERGE_TOKENS gains a second level so its arguments expand as the C preprocessor requires. That form is verified with Wine's shader compiler only, not with Microsoft's FXC, and the MSVC build is unverified. Validation (whole series, MinGW-w64 i686 GCC 13, DX9 Debug, under Wine 10): - Pass: j3dcore.Macros 7/7, rdroid.Math 9/9, sound 37/37, smush 181 + 1 ignored, sith 38/38, sith.DSS 32 + 1 ignored. - Fail: std 263/265. stdConffile %a scan and the Printf __LINE__ text, both known from the toolchain trial. - Not run: MSVC builds (not possible on this host), DX6, Release, guard and QOL profiles, std.System, the game itself. byacc does not build under MinGW (Windows.h case in Programs/byacc/main.c), so programs are off. - Only the final commit of the series can be built with MinGW; earlier ones were not built individually.
seelenkuchen
force-pushed
the
fix/include-path-case
branch
from
November 8, 2026 12:17
6ede0a4 to
1a3b872
Compare
Author
Done |
smlu
approved these changes
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small source fixes so the code also builds with compilers other than MSVC, and on hosts with case-sensitive file systems. None of them changes what MSVC builds.
Commits
sithCogexec.hforsithCogExec.horsith/DSS/forsith/Dss/. They also use Windows SDK names likeWindows.h,Xinput.handD3Dcommon.hin the capitalization MinGW doesn't ship. Windows ignores case, so MSVC doesn't notice. After this PR, a scan of every project include finds no mismatch.Windows.hinclude case in byacc and flex. The same fix for the 2 build tools underPrograms/.inlinefunction needs an external definition in some other file. MSVC doesn't require one, but GCC does. None of these functions has one, is hooked, or has its address taken.assert.handfloat.hincludes.fnstcwinstdStartup. The MSVC__asmpath is unchanged.LPDIRECT3DDEVICE9in place of the same-typedPDIRECT3DDEVICE9.MERGE_TOKENSincommon.hlslia second level. Its argument (VS_CONSTANTS_START_<n>) is a macro, and standard preprocessing glues the unexpanded name with one level. With two levels it expands first, giving the intendedc<n>register.Validation
This was tested on my fork with a MinGW-w64 i686 build (GCC 13, DX9 Debug, under Wine 10). That build isn't part of this PR.
j3dcore.Macros7/7,rdroid.Math9/9,sound37/37,smush181 (1 ignored),sith38/38,sith.DSS32 (1 ignored). The fork has since run the full suite with these changes in place, also natively on Linux.std263/265 under MinGW/Wine (astdConffile%ascan, and the__LINE__value in a Printf message).The
MERGE_TOKENSchange is the one to watch in CI: it has been verified with Wine's shader compiler only.Draft until CI has run.