Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
dae4ac7
build(cmake): Add MinGW-w64 toolchain and base configuration
JohnsterID Jan 5, 2026
7010df3
build(cmake): Add widl integration for COM interface generation
JohnsterID Jan 5, 2026
8369890
build(cmake): Add ReactOS ATL and PSEH compatibility layer
JohnsterID Jan 5, 2026
b8265f1
build(cmake): Add ReactOS COM support utilities (comsupp)
JohnsterID Jan 5, 2026
6a09b1a
build(deps): Update external dependencies for MinGW-w64 support
JohnsterID Jan 5, 2026
4f27283
build(cmake): Configure MinGW-specific compiler and linker settings
JohnsterID Jan 5, 2026
d27591a
build(cmake): Add MinGW CMake presets for i686
JohnsterID Jan 5, 2026
28c69e3
fix(precompiled): Add ATL compatibility to precompiled headers
JohnsterID Jan 5, 2026
6e3c408
fix(cmake): Fix CMake dependencies and library linking for MinGW
JohnsterID Jan 5, 2026
2561229
fix(core): Add MinGW-w64 compatibility fixes to Core libraries
JohnsterID Jan 5, 2026
b78a25f
fix(headers): Add missing forward declarations for MinGW
JohnsterID Jan 5, 2026
5d31d67
fix(linkage): Fix static/extern linkage mismatches for MinGW
JohnsterID Jan 5, 2026
527739c
fix(calling-convention): Standardize calling conventions and variadic…
JohnsterID Jan 5, 2026
de2afbf
fix(compatibility): Add compiler guards and GCC inline assembly for S…
JohnsterID Jan 5, 2026
19e5fd0
fix(types): Use uppercase MIN/MAX macros in BaseType.h
JohnsterID Jan 5, 2026
ccc5a10
fix(casts): Add explicit void* casts for function pointers
JohnsterID Jan 5, 2026
34e3a8f
fix(linkage): Fix callback function linkage for MinGW
JohnsterID Jan 5, 2026
2ca794e
fix(debug): Replace nullptr with false in DEBUG_ASSERTCRASH macros
JohnsterID Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ include(cmake/compilers.cmake)

include(FetchContent)

# MinGW-w64 specific configuration
if(MINGW)
include(cmake/mingw.cmake)
include(cmake/reactos-atl.cmake)
include(cmake/widl.cmake)
endif()

# Find/Add build dependencies and stubs shared by all projects
if((WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
include(cmake/miles.cmake)
Expand Down
88 changes: 88 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,37 @@
"inherits": "default-vcpkg",
"hidden": false,
"displayName": "Unix 32bit VCPKG Release"
},
{
"name": "mingw-w64-i686",
"displayName": "MinGW-w64 32-bit (i686) Release",
"generator": "Unix Makefiles",
"hidden": false,
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/cmake/toolchains/mingw-w64-i686.cmake",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "mingw-w64-i686-debug",
"displayName": "MinGW-w64 32-bit (i686) Debug",
"hidden": false,
"inherits": "mingw-w64-i686",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"RTS_BUILD_OPTION_DEBUG": "ON"
}
},
{
"name": "mingw-w64-i686-profile",
"displayName": "MinGW-w64 32-bit (i686) Profile",
"hidden": false,
"inherits": "mingw-w64-i686",
"cacheVariables": {
"RTS_BUILD_OPTION_PROFILE": "ON"
}
}
],
"buildPresets": [
Expand Down Expand Up @@ -240,6 +271,24 @@
"displayName": "Build Unix 32bit VCPKG Release",
"description": "Build Unix 32bit VCPKG Release",
"configuration": "Release"
},
{
"name": "mingw-w64-i686",
"configurePreset": "mingw-w64-i686",
"displayName": "Build MinGW-w64 32-bit (i686) Release",
"description": "Build MinGW-w64 32-bit (i686) Release"
},
{
"name": "mingw-w64-i686-debug",
"configurePreset": "mingw-w64-i686-debug",
"displayName": "Build MinGW-w64 32-bit (i686) Debug",
"description": "Build MinGW-w64 32-bit (i686) Debug"
},
{
"name": "mingw-w64-i686-profile",
"configurePreset": "mingw-w64-i686-profile",
"displayName": "Build MinGW-w64 32-bit (i686) Profile",
"description": "Build MinGW-w64 32-bit (i686) Profile"
}
],
"workflowPresets": [
Expand Down Expand Up @@ -398,6 +447,45 @@
"name": "unix"
}
]
},
{
"name": "mingw-w64-i686",
"steps": [
{
"type": "configure",
"name": "mingw-w64-i686"
},
{
"type": "build",
"name": "mingw-w64-i686"
}
]
},
{
"name": "mingw-w64-i686-debug",
"steps": [
{
"type": "configure",
"name": "mingw-w64-i686-debug"
},
{
"type": "build",
"name": "mingw-w64-i686-debug"
}
]
},
{
"name": "mingw-w64-i686-profile",
"steps": [
{
"type": "configure",
"name": "mingw-w64-i686-profile"
},
{
"type": "build",
"name": "mingw-w64-i686-profile"
}
]
}
]
}
5 changes: 5 additions & 0 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1198,3 +1198,8 @@ target_link_libraries(corei_gameengine_public INTERFACE
gamespy::gamespy
stlport
)

# ReactOS ATL for MinGW-w64 only (MSVC uses native ATL)
if(MINGW)
target_link_libraries(corei_gameengine_public INTERFACE reactos_atl)
endif()
5 changes: 5 additions & 0 deletions Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

#pragma once

#if defined __MINGW32__
#include "Utility/atl_compat.h"
#include "Utility/comsupp_compat.h"
#endif

#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
Expand Down
7 changes: 7 additions & 0 deletions Core/GameEngine/Source/Common/System/MiniDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ void MiniDumper::TriggerMiniDump(DumpType dumpType)
return;
}

#if defined _MSC_VER
// MSVC supports structured exception handling (__try/__except)
__try
{
// Use DebugBreak to raise an exception that can be caught in the __except block
Expand All @@ -102,6 +104,11 @@ void MiniDumper::TriggerMiniDump(DumpType dumpType)
{
TriggerMiniDumpForException(g_dumpException, dumpType);
}
#else
// MinGW/GCC doesn't support MSVC's __try/__except syntax
// Trigger dump directly without SEH support
DEBUG_LOG(("MiniDumper::TriggerMiniDump: SEH not supported on this compiler, skipping manual dump trigger."));
#endif
}

void MiniDumper::TriggerMiniDumpForException(_EXCEPTION_POINTERS* e_info, DumpType dumpType)
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/Common/System/XferCRC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "Common/XferDeepCRC.h"
#include "Common/crc.h"
#include "Common/Snapshot.h"
#include "utility/endian_compat.h"
#include "Utility/endian_compat.h"

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class InputStream;
class OutputStream;
class DataChunkInput;
struct DataChunkInfo;
class TerrainTextureClass;
class AlphaTerrainTextureClass;
class AlphaEdgeTextureClass;

#define NUM_ALPHA_TILES 12
Expand Down
4 changes: 2 additions & 2 deletions Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ void drawDebugCircle( const Coord3D & center, Real radius, Real width, Color col
}
}

void drawDrawableExtents( Drawable *draw, void *userData ); // FORWARD DECLARATION
static void drawDrawableExtents( Drawable *draw, void *userData ); // FORWARD DECLARATION
// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
static void drawContainedDrawable( Object *obj, void *userData )
Expand Down Expand Up @@ -867,7 +867,7 @@ static void drawDrawableExtents( Drawable *draw, void *userData )
}


void drawAudioLocations( Drawable *draw, void *userData );
static void drawAudioLocations( Drawable *draw, void *userData );
// ------------------------------------------------------------------------------------------------
// Helper for drawAudioLocations
// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ extern HWND ApplicationHWnd;
//TODO: Fix editor so it actually draws the wave segment instead of line while editing
//Could freeze all the water while editing? Or keep setting elapsed time on current segment.
//Have to make it so seamless merge of segments at final position.
static void TestWaterUpdate(void)
void TestWaterUpdate(void)
{
static Int doInit=1;
static WaterTracksObj *track=nullptr,*track2=nullptr;
Expand Down
8 changes: 4 additions & 4 deletions Core/Libraries/Include/Lib/BaseTypeCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
//#define abs(x) (((x) < 0) ? -(x) : (x))
//#endif

#ifndef min
#define min(x,y) (((x)<(y)) ? (x) : (y))
#ifndef MIN
#define MIN(x,y) (((x)<(y)) ? (x) : (y))
#endif

#ifndef max
#define max(x,y) (((x)>(y)) ? (x) : (y))
#ifndef MAX
#define MAX(x,y) (((x)>(y)) ? (x) : (y))
#endif

#ifndef TRUE
Expand Down
4 changes: 2 additions & 2 deletions Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Bool CompressFile (char *infile, char *outfile)
compressor = LZHLCreateCompressor();
for ( i = 0; i < rawSize; i += BLOCKSIZE )
{
blocklen = min((UnsignedInt)BLOCKSIZE, rawSize - i);
blocklen = MIN((UnsignedInt)BLOCKSIZE, rawSize - i);
compressed = LZHLCompress(compressor, outBlock + compressedSize, inBlock + i, blocklen);
compressedSize += compressed;
}
Expand Down Expand Up @@ -282,7 +282,7 @@ Bool CompressMemory (void *inBufferVoid, Int inSize, void *outBufferVoid, Int&
compressor = LZHLCreateCompressor();
for ( i = 0; i < rawSize; i += BLOCKSIZE )
{
blocklen = min((UnsignedInt)BLOCKSIZE, rawSize - i);
blocklen = MIN((UnsignedInt)BLOCKSIZE, rawSize - i);
compressed = LZHLCompress(compressor, outBuffer + compressedSize, inBuffer + i, blocklen);
compressedSize += compressed;
}
Expand Down
24 changes: 16 additions & 8 deletions Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
add_library(core_browserdispatch INTERFACE)

if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
add_custom_command(
OUTPUT BrowserDispatch_i.c BrowserDispatch.h
COMMAND midl.exe "${CMAKE_CURRENT_LIST_DIR}\\BrowserDispatch.idl" /header BrowserDispatch.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserDispatch.idl"
VERBATIM
)
add_library(core_browserdispatchwin STATIC BrowserDispatch_i.c)
if(MINGW AND IDL_COMPILER_FOUND)
# Use widl for MinGW builds
add_idl_file(browserdispatch_idl "${CMAKE_CURRENT_LIST_DIR}/BrowserDispatch.idl")
add_library(core_browserdispatchwin STATIC ${browserdispatch_idl_IID} ${browserdispatch_idl_HEADER})
elseif(MSVC)
# Use midl for MSVC builds
add_custom_command(
OUTPUT BrowserDispatch_i.c BrowserDispatch.h
COMMAND midl.exe "${CMAKE_CURRENT_LIST_DIR}\\BrowserDispatch.idl" /header BrowserDispatch.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserDispatch.idl"
VERBATIM
)
add_library(core_browserdispatchwin STATIC BrowserDispatch_i.c)
endif()

set_target_properties(core_browserdispatchwin PROPERTIES OUTPUT_NAME browserdispatchwin)
target_link_libraries(core_browserdispatch INTERFACE core_browserdispatchwin)
endif()
Expand Down
24 changes: 16 additions & 8 deletions Core/Libraries/Source/EABrowserEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
add_library(core_browserengine INTERFACE)

if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
add_custom_command(
OUTPUT BrowserEngine_i.c BrowserEngine.h
COMMAND midl.exe "${CMAKE_CURRENT_LIST_DIR}\\BrowserEngine.idl" /header BrowserEngine.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserEngine.idl"
VERBATIM
)
add_library(core_browserenginewin STATIC BrowserEngine_i.c)
if(MINGW AND IDL_COMPILER_FOUND)
# Use widl for MinGW builds
add_idl_file(browserengine_idl "${CMAKE_CURRENT_LIST_DIR}/BrowserEngine.idl")
add_library(core_browserenginewin STATIC ${browserengine_idl_IID} ${browserengine_idl_HEADER})
elseif(MSVC)
# Use midl for MSVC builds
add_custom_command(
OUTPUT BrowserEngine_i.c BrowserEngine.h
COMMAND midl.exe "${CMAKE_CURRENT_LIST_DIR}\\BrowserEngine.idl" /header BrowserEngine.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserEngine.idl"
VERBATIM
)
add_library(core_browserenginewin STATIC BrowserEngine_i.c)
endif()

set_target_properties(core_browserenginewin PROPERTIES OUTPUT_NAME browserenginewin)
target_link_libraries(core_browserengine INTERFACE core_browserenginewin)
endif()
Expand Down
4 changes: 3 additions & 1 deletion Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,14 @@ add_library(corei_ww3d2 INTERFACE)

target_sources(corei_ww3d2 INTERFACE ${WW3D2_SRC})

if (NOT IS_VS6_BUILD)
if (MSVC AND NOT IS_VS6_BUILD)
target_link_libraries(corei_ww3d2 INTERFACE
comsuppw
)
endif()

target_link_libraries(corei_ww3d2 INTERFACE
core_browserengine
core_wwlib
core_wwmath
)
3 changes: 3 additions & 0 deletions Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@

#else

#ifdef __MINGW32__
#include "Utility/comsupp_compat.h" // MinGW COM support compatibility
#endif
#include <comutil.h>
#include <comip.h>

Expand Down
4 changes: 2 additions & 2 deletions Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void MissingTexture::_Deinit()
_MissingTexture=nullptr;
}

static unsigned int missing_image_palette[]={
unsigned int missing_image_palette[]={
0x7F040204,0x7F048AC4,0x7F84829C,0x7FFC0204,0x7F0442AB,0x7FFCFE04,0x7F444244,0x7F0462FC,
0x7F84CEE4,0x7FC4C6CF,0x7F9CA6B2,0x7FC4E6F4,0x7F04FE04,0x7F4C82D4,0x7F2452A1,0x7F0442D4,
0x7F446AB0,0x7FA4A6B6,0x7F2C62C2,0x7FE4E6E9,0x7F646264,0x7F0402FC,0x7FC4D6E1,0x7F44B6DC,
Expand Down Expand Up @@ -196,7 +196,7 @@ static unsigned int missing_image_palette[]={
0x7FACDEEC,0x7F2CA6D4,0x7F0452E4,0x7FD4D6E4,0x7F849ED4,0x7FB4B6CC,0x7F4C7ACC,0x7FACC6FC,
0x7F9496B4,0x7F042AA4,0x7F1C62E4,0x7F74A6EC,0x7FE4EEFC,0x7F1C72FC,0x7FD4DEEC,0x7F2C5ABC};

static unsigned int missing_image_pixels[]={
unsigned int missing_image_pixels[]={
0x03030303,0x03030303,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,0xA7A7A7A7,
Expand Down
1 change: 1 addition & 0 deletions Core/Libraries/Source/WWVegas/WW3D2/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DX8Wrapper;
class TextureLoader;
class LoaderThreadClass;
class TextureLoadTaskClass;
class TextureClass;
class CubeTextureClass;
class VolumeTextureClass;

Expand Down
1 change: 1 addition & 0 deletions Core/Libraries/Source/WWVegas/WW3D2/textureloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
class StringClass;
struct IDirect3DTexture8;
class TextureLoadTaskClass;
class TextureLoadTaskListClass;

class TextureLoader
{
Expand Down
8 changes: 4 additions & 4 deletions Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ class StringClass;
// Callback declarations. These functions are called when a registered event occurs
// in the sound library/
//
typedef void (_stdcall *LPFNSOSCALLBACK) (SoundSceneObjClass *sound_obj, uint32 user_param);
typedef void (_stdcall *LPFNEOSCALLBACK) (SoundSceneObjClass *sound_obj, uint32 user_param);
typedef void (_stdcall *LPFNHEARDCALLBACK) (LogicalListenerClass *listener, LogicalSoundClass *sound_obj, uint32 user_param);
typedef void (_stdcall *LPFNTEXTCALLBACK) (AudibleSoundClass *sound_obj, const StringClass &text, uint32 user_param);
typedef void (__stdcall *LPFNSOSCALLBACK) (SoundSceneObjClass *sound_obj, uint32 user_param);
typedef void (__stdcall *LPFNEOSCALLBACK) (SoundSceneObjClass *sound_obj, uint32 user_param);
typedef void (__stdcall *LPFNHEARDCALLBACK) (LogicalListenerClass *listener, LogicalSoundClass *sound_obj, uint32 user_param);
typedef void (__stdcall *LPFNTEXTCALLBACK) (AudibleSoundClass *sound_obj, const StringClass &text, uint32 user_param);


/////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class MemoryCounterClass
public:
MemoryCounterClass(void) : CurrentAllocation(0), PeakAllocation(0) { }

void Memory_Allocated(int size) { CurrentAllocation+=size; PeakAllocation = max(PeakAllocation,CurrentAllocation); }
void Memory_Allocated(int size) { CurrentAllocation+=size; PeakAllocation = MAX(PeakAllocation,CurrentAllocation); }
void Memory_Released(int size) { CurrentAllocation-=size; }

int Get_Current_Allocated_Memory(void) { return CurrentAllocation; }
Expand Down
Loading