From 4b912e2c094e4062c589c540c8f500c441a7dc91 Mon Sep 17 00:00:00 2001 From: seelenkuchen <10817856+seelenkuchen@users.noreply.github.com> Date: Sat, 31 Oct 2026 16:37:40 +0100 Subject: [PATCH 1/4] Fix include path case for case-sensitive hosts 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. --- Jones3D/Display/JonesHud.c | 4 ++-- Jones3D/Display/jonesConfig.c | 2 +- Jones3D/Main/JonesMain.c | 4 ++-- Jones3D/Play/JonesControl.c | 2 +- Jones3D/types.h | 4 ++-- Libs/rdroid/Engine/rdQClip.c | 2 +- Libs/sith/Cog/sithCogFunctionSector.c | 2 +- Libs/sith/Cog/sithCogFunctionSound.c | 2 +- Libs/sith/Cog/sithCogFunctionSurface.c | 2 +- Libs/sith/Dss/sithDSSCog.c | 2 +- Libs/smush/Tests/SmushSoundTest.c | 4 ++-- Libs/smush/insane/Sound/Dsnd.c | 4 ++-- Libs/sound/types.h | 2 +- Libs/std/General/Tests/stdPlatformTest.c | 4 ++-- Libs/std/General/stdHashtbl.c | 2 +- Libs/std/General/stdPlatform.c | 2 +- Libs/std/Win95/DX9/stdControlDX9.c | 2 +- Libs/std/Win95/DX9/stdShaderDX9.c | 2 +- Libs/std/Win95/stdControl.h | 2 +- Libs/std/Win95/stdGob.c | 2 +- Libs/w32util/wuRegistry.h | 2 +- Libs/wkernel/wkernel.c | 2 +- 22 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Jones3D/Display/JonesHud.c b/Jones3D/Display/JonesHud.c index d2b8b0bb8..bda981723 100644 --- a/Jones3D/Display/JonesHud.c +++ b/Jones3D/Display/JonesHud.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/Jones3D/Display/jonesConfig.c b/Jones3D/Display/jonesConfig.c index 510532d16..109ed3eb9 100644 --- a/Jones3D/Display/jonesConfig.c +++ b/Jones3D/Display/jonesConfig.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/Jones3D/Main/JonesMain.c b/Jones3D/Main/JonesMain.c index ad968a410..8d428ce8e 100644 --- a/Jones3D/Main/JonesMain.c +++ b/Jones3D/Main/JonesMain.c @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/Jones3D/Play/JonesControl.c b/Jones3D/Play/JonesControl.c index 42731603a..9bcfcf2da 100644 --- a/Jones3D/Play/JonesControl.c +++ b/Jones3D/Play/JonesControl.c @@ -1,7 +1,7 @@ #include "JonesControl.h" #include -#include +#include #include #include #include diff --git a/Jones3D/types.h b/Jones3D/types.h index c72fb7010..267fdc0c8 100644 --- a/Jones3D/types.h +++ b/Jones3D/types.h @@ -1,8 +1,8 @@ #ifndef JONES3D_TYPES_H #define JONES3D_TYPES_H #define STRICT -#include -#include +#include +#include #include #include diff --git a/Libs/rdroid/Engine/rdQClip.c b/Libs/rdroid/Engine/rdQClip.c index bb5555283..727aae1b1 100644 --- a/Libs/rdroid/Engine/rdQClip.c +++ b/Libs/rdroid/Engine/rdQClip.c @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/Libs/sith/Cog/sithCogFunctionSector.c b/Libs/sith/Cog/sithCogFunctionSector.c index 60e54e01a..6ef817ca8 100644 --- a/Libs/sith/Cog/sithCogFunctionSector.c +++ b/Libs/sith/Cog/sithCogFunctionSector.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libs/sith/Cog/sithCogFunctionSound.c b/Libs/sith/Cog/sithCogFunctionSound.c index 967495a34..5ed2860c7 100644 --- a/Libs/sith/Cog/sithCogFunctionSound.c +++ b/Libs/sith/Cog/sithCogFunctionSound.c @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libs/sith/Cog/sithCogFunctionSurface.c b/Libs/sith/Cog/sithCogFunctionSurface.c index 2d1d0a369..ceee4eeef 100644 --- a/Libs/sith/Cog/sithCogFunctionSurface.c +++ b/Libs/sith/Cog/sithCogFunctionSurface.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libs/sith/Dss/sithDSSCog.c b/Libs/sith/Dss/sithDSSCog.c index 0d50ab20f..bae0b283a 100644 --- a/Libs/sith/Dss/sithDSSCog.c +++ b/Libs/sith/Dss/sithDSSCog.c @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/Libs/smush/Tests/SmushSoundTest.c b/Libs/smush/Tests/SmushSoundTest.c index 9a0748bc4..2818764bf 100644 --- a/Libs/smush/Tests/SmushSoundTest.c +++ b/Libs/smush/Tests/SmushSoundTest.c @@ -7,9 +7,9 @@ #include #include -#include +#include #include -#include +#include #if defined (J3D_DIRECTX6) #include #elif defined (J3D_DIRECTX9) diff --git a/Libs/smush/insane/Sound/Dsnd.c b/Libs/smush/insane/Sound/Dsnd.c index f7da18fe5..db5eba0c9 100644 --- a/Libs/smush/insane/Sound/Dsnd.c +++ b/Libs/smush/insane/Sound/Dsnd.c @@ -9,9 +9,9 @@ #include #include -#include +#include #include -#include +#include #include #include diff --git a/Libs/sound/types.h b/Libs/sound/types.h index 059b1a676..7d5136881 100644 --- a/Libs/sound/types.h +++ b/Libs/sound/types.h @@ -2,7 +2,7 @@ #define SOUND_TYPES_H #include #include -#include +#include #include #include diff --git a/Libs/std/General/Tests/stdPlatformTest.c b/Libs/std/General/Tests/stdPlatformTest.c index 8493ca1fc..6d6d28a8d 100644 --- a/Libs/std/General/Tests/stdPlatformTest.c +++ b/Libs/std/General/Tests/stdPlatformTest.c @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include diff --git a/Libs/std/General/stdHashtbl.c b/Libs/std/General/stdHashtbl.c index e6f7eed19..4103b381d 100644 --- a/Libs/std/General/stdHashtbl.c +++ b/Libs/std/General/stdHashtbl.c @@ -1,6 +1,6 @@ #include "std.h" #include "stdHashtbl.h" -#include "stdLinklist.h" +#include "stdLinkList.h" #include "stdMemory.h" #include "stdUtil.h" diff --git a/Libs/std/General/stdPlatform.c b/Libs/std/General/stdPlatform.c index b3c58bb28..2cb906073 100644 --- a/Libs/std/General/stdPlatform.c +++ b/Libs/std/General/stdPlatform.c @@ -1,6 +1,6 @@ #define STRICT -#include // timeGetTime, include first to avoid undefined warning due to WIN32_LEAN_AND_MEAN +#include // timeGetTime, include first to avoid undefined warning due to WIN32_LEAN_AND_MEAN #include #include diff --git a/Libs/std/Win95/DX9/stdControlDX9.c b/Libs/std/Win95/DX9/stdControlDX9.c index 44357a1b7..fb4b877e3 100644 --- a/Libs/std/Win95/DX9/stdControlDX9.c +++ b/Libs/std/Win95/DX9/stdControlDX9.c @@ -8,7 +8,7 @@ #include #include -#include +#include #pragma comment(lib,"Xinput.lib") #include diff --git a/Libs/std/Win95/DX9/stdShaderDX9.c b/Libs/std/Win95/DX9/stdShaderDX9.c index 2a240aa9d..6a21d2318 100644 --- a/Libs/std/Win95/DX9/stdShaderDX9.c +++ b/Libs/std/Win95/DX9/stdShaderDX9.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #pragma comment(lib,"d3dcompiler.lib") diff --git a/Libs/std/Win95/stdControl.h b/Libs/std/Win95/stdControl.h index 3bec4d5c3..b8e2e6275 100644 --- a/Libs/std/Win95/stdControl.h +++ b/Libs/std/Win95/stdControl.h @@ -12,7 +12,7 @@ # endif #include # if defined(J3D_TEST) -# include +# include # endif #endif diff --git a/Libs/std/Win95/stdGob.c b/Libs/std/Win95/stdGob.c index 2ffc51cc3..c78321320 100644 --- a/Libs/std/Win95/stdGob.c +++ b/Libs/std/Win95/stdGob.c @@ -1,7 +1,7 @@ #include "stdGob.h" #include #include -#include +#include #include #include #include diff --git a/Libs/w32util/wuRegistry.h b/Libs/w32util/wuRegistry.h index 94f455674..d6d89a04b 100644 --- a/Libs/w32util/wuRegistry.h +++ b/Libs/w32util/wuRegistry.h @@ -1,7 +1,7 @@ #ifndef W32UTIL_WUREGISTRY_H #define W32UTIL_WUREGISTRY_H #define STRICT -#include +#include #include #include diff --git a/Libs/wkernel/wkernel.c b/Libs/wkernel/wkernel.c index f88058e96..c513c8844 100644 --- a/Libs/wkernel/wkernel.c +++ b/Libs/wkernel/wkernel.c @@ -4,7 +4,7 @@ #include #include -#include // InitCommonControls +#include // InitCommonControls #include // DEFINE_GUID From 84137a703514b9d046c07939357569635c34199e Mon Sep 17 00:00:00 2001 From: seelenkuchen <10817856+seelenkuchen@users.noreply.github.com> Date: Mon, 2 Nov 2026 21:19:59 +0100 Subject: [PATCH 2/4] Fix Windows.h include case in byacc and flex Same as the engine includes: lowercase windows.h, the name MinGW and case-sensitive hosts ship. No effect on MSVC. --- Programs/byacc/main.c | 2 +- Programs/flex/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Programs/byacc/main.c b/Programs/byacc/main.c index 2eb80b84f..1d6deab10 100644 --- a/Programs/byacc/main.c +++ b/Programs/byacc/main.c @@ -1,5 +1,5 @@ #ifdef _WIN32 -#include +#include #else #include #endif diff --git a/Programs/flex/main.c b/Programs/flex/main.c index b41718905..7698522e2 100644 --- a/Programs/flex/main.c +++ b/Programs/flex/main.c @@ -38,7 +38,7 @@ static char rcsid[] = #endif #ifdef _WIN32 -#include +#include #endif #include "flexdef.h" From a86d14c18fdaa48cd8eaba8222a7b89910cad79f Mon Sep 17 00:00:00 2001 From: seelenkuchen <10817856+seelenkuchen@users.noreply.github.com> Date: Sat, 31 Oct 2026 16:37:40 +0100 Subject: [PATCH 3/4] Make header and file-local inline functions static 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. --- Jones3D/Display/JonesReticle.c | 6 +++--- Jones3D/Main/JonesLevel.h | 2 +- Libs/j3dcore/j3dhook.h | 4 ++-- Libs/rdroid/Engine/rdCamera.c | 2 +- Libs/sith/Main/sithCommand.h | 2 +- Libs/std/General/stdColor.h | 2 +- Libs/std/General/stdConffile.h | 4 ++-- Libs/std/General/stdUtil.h | 12 ++++++------ 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Jones3D/Display/JonesReticle.c b/Jones3D/Display/JonesReticle.c index 105844f35..94e50aaf7 100644 --- a/Jones3D/Display/JonesReticle.c +++ b/Jones3D/Display/JonesReticle.c @@ -123,7 +123,7 @@ JonesAimReticle JonesReticle_reticle = { 0 }; // Add to stdColor.h or a utility header -inline rdVector4 JonesReticle_ColorToVector4(tStdColor color) +static inline rdVector4 JonesReticle_ColorToVector4(tStdColor color) { rdVector4 result; result.red = STD_GETRED(color) / 255.0f; @@ -133,7 +133,7 @@ inline rdVector4 JonesReticle_ColorToVector4(tStdColor color) return result; } -inline tStdColor JonesReticle_ColorFromVector4(const rdVector4* pVector) +static inline tStdColor JonesReticle_ColorFromVector4(const rdVector4* pVector) { return STD_RGBA( (uint8_t)(pVector->red * 255.0f), @@ -275,7 +275,7 @@ bool JonesReticle_IsEnabled(void) /** * Calculate easing function for smooth animation(ease - out) */ -inline float J3DAPI JonesReticle_EaseOut(float t) +static inline float J3DAPI JonesReticle_EaseOut(float t) { // Ease out cubic: 1 - (1-t)^3 float oneMinusT = 1.0f - t; diff --git a/Jones3D/Main/JonesLevel.h b/Jones3D/Main/JonesLevel.h index 84ec0b305..7afad30c9 100644 --- a/Jones3D/Main/JonesLevel.h +++ b/Jones3D/Main/JonesLevel.h @@ -309,7 +309,7 @@ static const JonesLevelInfo JonesMain_aNdyLevelLoadInfos[JONESLEVEL_NUMLEVELS] = } }; -inline bool J3DAPI JonesLevel_IsValidLevelNum(size_t levelNum) +static inline bool J3DAPI JonesLevel_IsValidLevelNum(size_t levelNum) { if ( levelNum != JONESLEVEL_GENERICLEVELNUM && levelNum < JONESLEVEL_NUMLEVELS ) { return true; diff --git a/Libs/j3dcore/j3dhook.h b/Libs/j3dcore/j3dhook.h index 05e17b393..02364fd49 100644 --- a/Libs/j3dcore/j3dhook.h +++ b/Libs/j3dcore/j3dhook.h @@ -97,7 +97,7 @@ J3D_EXTERN_C_START * @param endAddress The end address of the region to modify * @return true if successful, false otherwise */ -inline bool J3DStartHookContext(J3DHookContext* pCtx, uintptr_t startAddress, uintptr_t endAddress) +static inline bool J3DStartHookContext(J3DHookContext* pCtx, uintptr_t startAddress, uintptr_t endAddress) { if ( endAddress <= startAddress ) { return false; @@ -113,7 +113,7 @@ inline bool J3DStartHookContext(J3DHookContext* pCtx, uintptr_t startAddress, ui * @param pCtx The pointer to a J3DHookContext structure * @return true if successful, false otherwise */ -inline bool J3DEndHookContext(J3DHookContext* pCtx) +static inline bool J3DEndHookContext(J3DHookContext* pCtx) { DWORD temp; return VirtualProtect((LPVOID)pCtx->startAddress, pCtx->size, pCtx->oldProtect, &temp); diff --git a/Libs/rdroid/Engine/rdCamera.c b/Libs/rdroid/Engine/rdCamera.c index 5aa0f1f09..687b3ade9 100644 --- a/Libs/rdroid/Engine/rdCamera.c +++ b/Libs/rdroid/Engine/rdCamera.c @@ -57,7 +57,7 @@ void rdCamera_ResetGlobals(void) memset(&rdCamera_g_camMatrix, 0, sizeof(rdCamera_g_camMatrix)); } -inline float rdCamera_ClampFOV(float fov) +static inline float rdCamera_ClampFOV(float fov) { return STDMATH_CLAMP(fov, RDCAMERA_FOVMIN, RDCAMERA_FOVMAX); } diff --git a/Libs/sith/Main/sithCommand.h b/Libs/sith/Main/sithCommand.h index e130dbd6b..a3f1e5288 100644 --- a/Libs/sith/Main/sithCommand.h +++ b/Libs/sith/Main/sithCommand.h @@ -14,7 +14,7 @@ J3D_EXTERN_C_START void sithCommand_RegisterCommands(void); -inline bool sithCommand_ParseBool(const char* pStr, bool* pOut) // Added +static inline bool sithCommand_ParseBool(const char* pStr, bool* pOut) // Added { if ( !pStr || !pOut ) { return false; diff --git a/Libs/std/General/stdColor.h b/Libs/std/General/stdColor.h index f8d0f3a0b..059cfad54 100644 --- a/Libs/std/General/stdColor.h +++ b/Libs/std/General/stdColor.h @@ -300,7 +300,7 @@ void stdColor_DecodeRGBA(uint32_t encoded, const ColorInfo* ci, uint8_t* r, uint uint32_t stdColor_Recode(uint32_t encoded, const ColorInfo* pSrcCI, const ColorInfo* pDestCI); // Added // Added -inline void stdColor_CalcColorBits(uint32_t bitmask, uint32_t* cbpp, int32_t* posShift, int32_t* posShiftRight) +static inline void stdColor_CalcColorBits(uint32_t bitmask, uint32_t* cbpp, int32_t* posShift, int32_t* posShiftRight) { if ( !cbpp || !posShift || !posShiftRight ) { diff --git a/Libs/std/General/stdConffile.h b/Libs/std/General/stdConffile.h index 2cb338b40..beb1e2295 100644 --- a/Libs/std/General/stdConffile.h +++ b/Libs/std/General/stdConffile.h @@ -50,7 +50,7 @@ int J3DAPI stdConffile_Read(void* pData, size_t size); int J3DAPI stdConffile_ReadArgsFromStr(char* pStr); int stdConffile_ReadArgs(void); int stdConffile_ReadLine(void); -int stdConffile_ScanLine(const char* pFormat, ...); // Added +static inline int stdConffile_ScanLine(const char* pFormat, ...); // Added tFileHandle stdConffile_GetFileHandle(void); tFileHandle stdConffile_GetWriteFileHandle(void); // Added @@ -79,7 +79,7 @@ void stdConffile_ResetGlobals(void); * a pointer to the data and the size of the receiving buffer (as an `rsize_t` type), * where the size may be 1 when using `%c` to read a single character. */ -inline int stdConffile_ScanLine(const char* pFormat, ...) +static inline int stdConffile_ScanLine(const char* pFormat, ...) { if ( !stdConffile_ReadLine() ) { diff --git a/Libs/std/General/stdUtil.h b/Libs/std/General/stdUtil.h index 911066303..89facafc5 100644 --- a/Libs/std/General/stdUtil.h +++ b/Libs/std/General/stdUtil.h @@ -261,7 +261,7 @@ uint32_t J3DAPI stdUtil_CalcChecksum(const uint8_t* pData, size_t dataSize, uint * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_StringCopy(char* pDest, size_t destSize, const char* pSrc) +static inline bool J3DAPI stdUtil_StringCopy(char* pDest, size_t destSize, const char* pSrc) { // Added: Release-build guard before calculating destSize - 1. STD_GUARD(pDest && pSrc && destSize, false); @@ -282,7 +282,7 @@ inline bool J3DAPI stdUtil_StringCopy(char* pDest, size_t destSize, const char* * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_WStringCopy(wchar_t* pDest, size_t destSize, const wchar_t* pSrc) +static inline bool J3DAPI stdUtil_WStringCopy(wchar_t* pDest, size_t destSize, const wchar_t* pSrc) { // Added: Release-build guard before calculating destSize - 1. STD_GUARD(pDest && pSrc && destSize, false); @@ -304,7 +304,7 @@ inline bool J3DAPI stdUtil_WStringCopy(wchar_t* pDest, size_t destSize, const wc * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_StringNumCopy(char* pDest, size_t destSize, const char* pSrc, size_t num) +static inline bool J3DAPI stdUtil_StringNumCopy(char* pDest, size_t destSize, const char* pSrc, size_t num) { // Added: Release-build guard before calculating destSize - 1. STD_GUARD(pDest && pSrc && destSize, false); @@ -327,7 +327,7 @@ inline bool J3DAPI stdUtil_StringNumCopy(char* pDest, size_t destSize, const cha * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_WStringNumCopy(wchar_t* pDest, size_t destSize, const wchar_t* pSrc, size_t num) +static inline bool J3DAPI stdUtil_WStringNumCopy(wchar_t* pDest, size_t destSize, const wchar_t* pSrc, size_t num) { // Added: Release-build guard before calculating destSize - 1. STD_GUARD(pDest && pSrc && destSize, false); @@ -348,7 +348,7 @@ inline bool J3DAPI stdUtil_WStringNumCopy(wchar_t* pDest, size_t destSize, const * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_StringCat(char* pDst, size_t destSize, const char* pSrc) +static inline bool J3DAPI stdUtil_StringCat(char* pDst, size_t destSize, const char* pSrc) { // Added: Release-build guard before calculating remaining capacity. STD_GUARD(pDst && pSrc && destSize, false); @@ -375,7 +375,7 @@ inline bool J3DAPI stdUtil_StringCat(char* pDst, size_t destSize, const char* pS * * @return `true` on success, otherwise `false`. */ -inline bool J3DAPI stdUtil_StringNumCat(char* pDst, size_t destSize, const char* pSrc, size_t num) +static inline bool J3DAPI stdUtil_StringNumCat(char* pDst, size_t destSize, const char* pSrc, size_t num) { // Added: Release-build guard before calculating remaining capacity. STD_GUARD(pDst && pSrc && destSize, false); From 1a3b87212a2a94042e7a63882ec06df5c320b19e Mon Sep 17 00:00:00 2001 From: seelenkuchen <10817856+seelenkuchen@users.noreply.github.com> Date: Sat, 31 Oct 2026 16:37:40 +0100 Subject: [PATCH 4/4] Fix source constructs that only MSVC accepts 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. --- Libs/j3dcore/j3d.h.in | 3 ++- Libs/rdroid/Raster/rdCache.c | 1 + Libs/std/General/std.c | 4 ++++ Libs/std/Win95/DX9/Shaders/common.hlsli | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Libs/j3dcore/j3d.h.in b/Libs/j3dcore/j3d.h.in index bdee6af18..7e135b72e 100644 --- a/Libs/j3dcore/j3d.h.in +++ b/Libs/j3dcore/j3d.h.in @@ -1,6 +1,7 @@ #ifndef J3DCORE_H #define J3DCORE_H +#include // static_assert on GCC/MinGW #include #include #include @@ -51,7 +52,7 @@ # define STRICT # endif # define WIN32_LEAN_AND_MEAN -# include +# include # define strcmpi _strcmpi # define strncmpi _strnicmp # define wstrcmpi _wcsicmp diff --git a/Libs/rdroid/Raster/rdCache.c b/Libs/rdroid/Raster/rdCache.c index 5b444dc0a..df9fa15bc 100644 --- a/Libs/rdroid/Raster/rdCache.c +++ b/Libs/rdroid/Raster/rdCache.c @@ -9,6 +9,7 @@ #include #include +#include #include #include diff --git a/Libs/std/General/std.c b/Libs/std/General/std.c index 9ce53f1cf..fdd848fbb 100644 --- a/Libs/std/General/std.c +++ b/Libs/std/General/std.c @@ -76,7 +76,11 @@ void J3DAPI stdStartup(tHostServices* pHS) // TODO: Remove when all round and rand float functions are replaced && updated // TODO: consider setting FE_DOWNWARD for round functions (lrintf); i.e.: fesetround(FE_DOWNWARD) to mimic same behavior as OG short tmp = 0; +#ifdef _MSC_VER __asm fnstcw word ptr[tmp]; +#else + __asm__ __volatile__("fnstcw %0" : "=m"(tmp)); // Altered: GCC/MinGW inline assembler syntax for the same instruction +#endif word_183962C = tmp; // The following flags control in binary (Indy3D.exe) FPU rounding control flags for frndint (floorf, ceilf) and fistp (lrintf) diff --git a/Libs/std/Win95/DX9/Shaders/common.hlsli b/Libs/std/Win95/DX9/Shaders/common.hlsli index 96584bff5..13cfaa329 100644 --- a/Libs/std/Win95/DX9/Shaders/common.hlsli +++ b/Libs/std/Win95/DX9/Shaders/common.hlsli @@ -1,7 +1,8 @@ #ifndef J3D_COMMON_HLSL #define J3D_COMMON_HLSL -#define MERGE_TOKENS(a, b) a##b +#define MERGE_TOKENS_(a, b) a##b +#define MERGE_TOKENS(a, b) MERGE_TOKENS_(a, b) // ===== VERTEX SHADER CONSTANTS (c24-c255) ===== #define VS_VIEWPORT_REGISTER c0