From 2be368ea4e25cdfc4fde13ccf79bd8562ca72c77 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:15:19 +0000 Subject: [PATCH 01/17] build(cmake): Add MinGW-w64 toolchain and base configuration (#2067) Add cross-compilation support for building with MinGW-w64 (GCC) on Linux targeting 32-bit Windows executables. This enables building Generals and Zero Hour without requiring MSVC or Windows. Core components: - Toolchain file for i686-w64-mingw32 cross-compiler - MinGW-specific compiler flags and library linking - MSVC compatibility macros (__forceinline, __int64, _int64) - Math constants header (mingw.h) with MinGW-specific definitions - Windows library dependencies (ole32, d3d8, dinput8, etc.) - d3dx8 library aliasing for MinGW compatibility The toolchain forces 32-bit compilation, disables MFC-dependent tools, and configures proper search paths for cross-compilation environment. Math constants are provided via mingw.h header (included through always.h) rather than CMake compile definitions, allowing proper scoping and avoiding global namespace pollution. Build with: cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64-i686.cmake Files: - cmake/toolchains/mingw-w64-i686.cmake: Cross-compilation toolchain - cmake/mingw.cmake: MinGW-specific build configuration - Core/Libraries/Source/WWVegas/WWLib/mingw.h: Math constants header - CMakeLists.txt: Include MinGW configuration when MINGW is detected --- CMakeLists.txt | 5 ++ Core/Libraries/Source/WWVegas/WWLib/always.h | 4 + Core/Libraries/Source/WWVegas/WWLib/mingw.h | 60 +++++++++++++ cmake/mingw.cmake | 91 ++++++++++++++++++++ cmake/toolchains/mingw-w64-i686.cmake | 33 +++++++ 5 files changed, 193 insertions(+) create mode 100644 Core/Libraries/Source/WWVegas/WWLib/mingw.h create mode 100644 cmake/mingw.cmake create mode 100644 cmake/toolchains/mingw-w64-i686.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 4160c918c74..ed4b9157fa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,11 @@ include(cmake/compilers.cmake) include(FetchContent) +# MinGW-w64 specific configuration +if(MINGW) + include(cmake/mingw.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) diff --git a/Core/Libraries/Source/WWVegas/WWLib/always.h b/Core/Libraries/Source/WWVegas/WWLib/always.h index 4644d5b93ae..0bbe089cccf 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/always.h +++ b/Core/Libraries/Source/WWVegas/WWLib/always.h @@ -254,6 +254,10 @@ template T max(T a,T b) #include "watcom.h" #endif +#if defined(__MINGW32__) || defined(__MINGW64__) +#include "mingw.h" +#endif + #ifndef size_of #define size_of(typ,id) sizeof(((typ*)0)->id) diff --git a/Core/Libraries/Source/WWVegas/WWLib/mingw.h b/Core/Libraries/Source/WWVegas/WWLib/mingw.h new file mode 100644 index 00000000000..388093a2462 --- /dev/null +++ b/Core/Libraries/Source/WWVegas/WWLib/mingw.h @@ -0,0 +1,60 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** This program is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program. If not, see . +*/ + +#pragma once + +#if defined(__MINGW32__) || defined(__MINGW64__) + +/* +** MinGW-w64 provides most mathematical constants in when _USE_MATH_DEFINES is set +** (which is done globally in cmake/mingw.cmake). +** +** However, MinGW's is missing one constant (M_1_SQRTPI) and uses a different name +** for another (M_SQRT1_2 instead of M_SQRT_2). We define those here to match MSVC and Watcom. +** +** This brings MinGW in line with MSVC (visualc.h) and Watcom (watcom.h) +** which provide all 14 mathematical constants. +*/ + +#include + +/* +** M_1_SQRTPI is not defined by MinGW's math.h +** Define it to match visualc.h and watcom.h +*/ +#ifndef M_1_SQRTPI +#define M_1_SQRTPI 0.564189583547756286948 +#endif + +/* +** MinGW defines M_SQRT1_2 instead of M_SQRT_2 +** Both represent 1/sqrt(2), just different naming +** Create an alias for compatibility +*/ +#ifndef M_SQRT_2 +#define M_SQRT_2 M_SQRT1_2 +#endif + +/* +** At this point, all 14 mathematical constants are available: +** M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, +** M_PI, M_PI_2, M_PI_4, M_1_PI, M_2_PI, +** M_1_SQRTPI, M_2_SQRTPI, M_SQRT2, M_SQRT_2 +*/ + +#endif diff --git a/cmake/mingw.cmake b/cmake/mingw.cmake new file mode 100644 index 00000000000..c0953430552 --- /dev/null +++ b/cmake/mingw.cmake @@ -0,0 +1,91 @@ +# TheSuperHackers @build JohnsterID 05/01/2026 Add MinGW-w64 cross-compilation support +# MinGW-w64 specific compiler and linker configurations + +if(MINGW) + message(STATUS "Configuring MinGW-w64 build settings") + + # Detect if this is 32-bit or 64-bit MinGW + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(IS_MINGW32 TRUE) + message(STATUS "MinGW-w64 32-bit (i686) detected") + else() + message(FATAL_ERROR "MinGW-w64 64-bit (x86_64) detected, but this project only supports 32-bit builds. Use the i686-w64-mingw32 toolchain.") + endif() + + # Windows subsystem + add_link_options(-mwindows) + + # Static linking of GCC runtime libraries + # This embeds libgcc and libstdc++ into the executable to avoid DLL dependencies + add_link_options(-static-libgcc -static-libstdc++) + + # Compatibility flags for legacy code + add_compile_options( + -fno-strict-aliasing # Avoid type-punning issues with DX8/COM + ) + + # MSVC compatibility macros for MinGW + # Note: MinGW already defines _cdecl and _stdcall correctly, so we only add __forceinline + # The escaped syntax below expands to: -D__forceinline="inline __attribute__((always_inline))" + # Escaping rules: \( \) = literal parentheses, \ (backslash-space) = space in definition + add_compile_definitions( + __forceinline=inline\ __attribute__\(\(always_inline\)\) + __int64=long\ long + _int64=long\ long + ) + + # Enable math constants in MinGW's + # MinGW provides M_PI, M_E, etc. in , but only when -std=c++XX is NOT used (strict ANSI mode), + # or when _USE_MATH_DEFINES is defined. Since we compile with -std=c++20, we need this define. + # The header mingw.h (included via always.h) provides the missing constants (M_1_SQRTPI, M_SQRT_2 alias). + add_compile_definitions( + _USE_MATH_DEFINES + ) + + # Ensure proper calling conventions are defined + # MinGW-w64 should define these, but verify they exist + include(CheckCXXSymbolExists) + check_cxx_symbol_exists(STDMETHODCALLTYPE "windows.h" HAVE_STDMETHODCALLTYPE) + if(NOT HAVE_STDMETHODCALLTYPE) + add_compile_definitions( + STDMETHODCALLTYPE=__stdcall + STDMETHODIMP=HRESULT\ __stdcall + ) + endif() + + # Required Windows libraries for DX8 + COM + link_libraries( + uuid # COM GUIDs + ole32 # COM runtime + oleaut32 # COM automation + gdi32 # GDI + user32 # User interface + comctl32 # Common controls + winmm # Multimedia (timeGetTime, etc.) + vfw32 # Video for Windows (AVIFile functions) + d3d8 # Direct3D 8 + dinput8 # DirectInput 8 + dsound # DirectSound + imm32 # Input Method Manager (IME) + ) + + # Note: MinGW-w64 does not provide comsuppw (COM support utilities library). + # COM support utilities (_com_util::ConvertStringToBSTR, ConvertBSTRToString) + # are provided by Dependencies/Utility/Utility/comsupp_compat.h as header-only + # implementations. No library linking required. + + # MinGW-w64 compatibility: Create d3dx8 as an alias to d3dx8d + # MinGW-w64 only provides libd3dx8d.a (debug library), not libd3dx8.a + # The min-dx8-sdk (dx8.cmake) handles this correctly via d3d8lib interface target, + # but for compatibility with direct library references in main executables, + # we create an alias so that linking to d3dx8 automatically uses d3dx8d + if(NOT TARGET d3dx8) + add_library(d3dx8 INTERFACE IMPORTED GLOBAL) + set_target_properties(d3dx8 PROPERTIES + INTERFACE_LINK_LIBRARIES "d3dx8d" + ) + message(STATUS "Created d3dx8 -> d3dx8d alias for MinGW-w64") + endif() + + message(STATUS "MinGW-w64 configuration complete") +endif() diff --git a/cmake/toolchains/mingw-w64-i686.cmake b/cmake/toolchains/mingw-w64-i686.cmake new file mode 100644 index 00000000000..e55badcc3b1 --- /dev/null +++ b/cmake/toolchains/mingw-w64-i686.cmake @@ -0,0 +1,33 @@ +# TheSuperHackers @build JohnsterID 05/01/2026 Add MinGW-w64 i686 cross-compilation toolchain +# MinGW-w64 32-bit (i686) Toolchain File +# Use with: cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64-i686.cmake + +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR i686) + +# Specify the cross compiler +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +set(CMAKE_AR i686-w64-mingw32-ar) +set(CMAKE_RANLIB i686-w64-mingw32-ranlib) +set(CMAKE_DLLTOOL i686-w64-mingw32-dlltool) + +# Target environment +set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + +# Adjust the default behavior of the FIND_XXX() commands: +# search programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# search headers and libraries in the target environment +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Force 32-bit pointer size +set(CMAKE_SIZEOF_VOID_P 4) + +# Disable MFC-dependent tools (not compatible with MinGW-w64) +set(RTS_BUILD_CORE_TOOLS OFF CACHE BOOL "Disable MFC-dependent core tools for MinGW" FORCE) +set(RTS_BUILD_GENERALS_TOOLS OFF CACHE BOOL "Disable MFC-dependent Generals tools for MinGW" FORCE) +set(RTS_BUILD_ZEROHOUR_TOOLS OFF CACHE BOOL "Disable MFC-dependent Zero Hour tools for MinGW" FORCE) From 8213b93d3eb23b54a58eaad4412ca3723142431d Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:15:59 +0000 Subject: [PATCH 02/17] build(cmake): Add widl integration for COM interface generation (#2067) Add Wine IDL Compiler (widl) as a replacement for Microsoft's MIDL compiler when building with MinGW-w64. This enables generation of COM interface code from IDL files on Linux cross-compilation environments. Features: - Auto-detect widl executable (widl or widl-stable) - Version detection and reporting - Dynamic Wine include path detection via wineg++ preprocessor - Configure Wine header paths for COM interface compilation - Fallback to known Wine stable/development include paths - IDL compilation function for generating headers and type libraries The widl compiler generates compatible COM interface definitions required for DirectX 8, Windows browser control, and other COM-based APIs used by the game engine. Files: - cmake/widl.cmake: widl detection and configuration - CMakeLists.txt: Include widl configuration for MinGW builds --- CMakeLists.txt | 1 + cmake/widl.cmake | 154 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 cmake/widl.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ed4b9157fa1..c7df479a3a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ include(FetchContent) # MinGW-w64 specific configuration if(MINGW) include(cmake/mingw.cmake) + include(cmake/widl.cmake) endif() # Find/Add build dependencies and stubs shared by all projects diff --git a/cmake/widl.cmake b/cmake/widl.cmake new file mode 100644 index 00000000000..16b4bc97996 --- /dev/null +++ b/cmake/widl.cmake @@ -0,0 +1,154 @@ +# TheSuperHackers @build JohnsterID 05/01/2026 Add widl integration for COM interface generation +# WIDL (Wine IDL Compiler) detection and configuration +# Used as MIDL replacement for MinGW-w64 builds + +if(MINGW) + # Find widl executable + find_program(WIDL_EXECUTABLE + NAMES widl widl-stable + DOC "Wine IDL compiler for MinGW-w64" + ) + + if(WIDL_EXECUTABLE) + # Get widl version + execute_process( + COMMAND ${WIDL_EXECUTABLE} -V + OUTPUT_VARIABLE WIDL_VERSION_OUTPUT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(WIDL_VERSION_OUTPUT MATCHES "Wine IDL Compiler version ([0-9.]+)") + set(WIDL_VERSION ${CMAKE_MATCH_1}) + message(STATUS "Found widl: ${WIDL_EXECUTABLE} (version ${WIDL_VERSION})") + else() + message(STATUS "Found widl: ${WIDL_EXECUTABLE}") + endif() + + set(IDL_COMPILER ${WIDL_EXECUTABLE}) + set(IDL_COMPILER_FOUND TRUE) + + # Detect Wine include paths dynamically + find_path(WINE_WINDOWS_INCLUDE_DIR + NAMES oaidl.idl + PATHS + /usr/include/wine/wine/windows + /usr/include/wine/windows + /usr/include/wine-development/windows + /opt/wine-stable/include/wine/windows + /usr/local/include/wine/windows + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH + DOC "Wine Windows headers directory" + ) + + if(WINE_WINDOWS_INCLUDE_DIR) + get_filename_component(WINE_BASE_INCLUDE_DIR "${WINE_WINDOWS_INCLUDE_DIR}/.." ABSOLUTE) + message(STATUS "Wine include directory: ${WINE_WINDOWS_INCLUDE_DIR}") + set(WIDL_INCLUDE_PATHS + -I${WINE_WINDOWS_INCLUDE_DIR} + -I${WINE_BASE_INCLUDE_DIR} + ) + else() + message(WARNING "Wine include directory not found. widl may fail to compile IDL files.") + set(WIDL_INCLUDE_PATHS "") + endif() + + else() + message(WARNING "widl not found. Install with: apt-get install wine-stable-dev (Debian/Ubuntu) or wine-devel (Fedora/RHEL)") + set(IDL_COMPILER_FOUND FALSE) + endif() + + # WIDL command function (compatible with MIDL) + function(add_idl_file target_name idl_file) + get_filename_component(idl_basename ${idl_file} NAME_WE) + get_filename_component(idl_dir ${idl_file} DIRECTORY) + + set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}.h") + set(iid_file "${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}_i.c") + + # Build widl flags with dynamically detected Wine paths + set(WIDL_FLAGS + --win32 + -I${idl_dir} + ${WIDL_INCLUDE_PATHS} + -D__WIDL__ + -DDECLSPEC_ALIGN\(x\)= + ) + + # Generate header file + add_custom_command( + OUTPUT ${header_file} + COMMAND ${IDL_COMPILER} + ${WIDL_FLAGS} + -h -o ${header_file} + ${idl_file} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${idl_file} + COMMENT "Compiling IDL to header with widl: ${idl_file}" + VERBATIM + ) + + # Generate IID file + add_custom_command( + OUTPUT ${iid_file} + COMMAND ${IDL_COMPILER} + ${WIDL_FLAGS} + -u -o ${iid_file} + ${idl_file} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${idl_file} + COMMENT "Compiling IDL to IID with widl: ${idl_file}" + VERBATIM + ) + + # Return output files to parent scope + set(${target_name}_HEADER ${header_file} PARENT_SCOPE) + set(${target_name}_IID ${iid_file} PARENT_SCOPE) + endfunction() + +elseif(MSVC) + # MSVC uses midl.exe + find_program(MIDL_EXECUTABLE + NAMES midl.exe midl + DOC "Microsoft IDL compiler" + ) + + if(MIDL_EXECUTABLE) + message(STATUS "Found midl: ${MIDL_EXECUTABLE}") + set(IDL_COMPILER ${MIDL_EXECUTABLE}) + set(IDL_COMPILER_FOUND TRUE) + else() + # midl.exe is usually in PATH with Visual Studio + set(IDL_COMPILER "midl.exe") + set(IDL_COMPILER_FOUND TRUE) + message(STATUS "Using midl.exe from PATH") + endif() + + # MIDL command function + function(add_idl_file target_name idl_file) + get_filename_component(idl_basename ${idl_file} NAME_WE) + + set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}.h") + set(iid_file "${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}_i.c") + + # Convert forward slashes to backslashes for MIDL + file(TO_NATIVE_PATH ${idl_file} idl_file_native) + + add_custom_command( + OUTPUT ${header_file} ${iid_file} + COMMAND ${IDL_COMPILER} "${idl_file_native}" /header ${idl_basename}.h /iid ${idl_basename}_i.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${idl_file} + COMMENT "Compiling IDL file ${idl_file} with midl" + VERBATIM + ) + + # Return output files to parent scope + set(${target_name}_HEADER ${header_file} PARENT_SCOPE) + set(${target_name}_IID ${iid_file} PARENT_SCOPE) + endfunction() +else() + message(WARNING "No IDL compiler configured for this platform") + set(IDL_COMPILER_FOUND FALSE) +endif() From 83cde2b88722fb3fbbed0d2554a56a4f0bea5088 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:16:57 +0000 Subject: [PATCH 03/17] build(cmake): Add ReactOS ATL and PSEH compatibility layer (#2067) Add ReactOS Active Template Library (ATL) support for MinGW-w64 builds, enabling ATL/COM functionality without MSVC dependencies. This provides the ATL headers needed for COM-based browser control integration. Components: - ReactOS ATL headers (v0.4.15) fetched from ReactOS project - ReactOS PSEH (exception handling) in C++-compatible dummy mode - ATL compatibility header with MinGW-specific macro definitions - PSEH compatibility header ensuring proper exception handling The implementation uses ReactOS PSEH in dummy mode (_USE_DUMMY_PSEH) because MinGW-w64's native PSEH uses GNU C nested functions which are incompatible with C++. This provides ATL functionality needed for: - CComPtr and CComBSTR smart pointers - ATL string conversion macros - COM interface implementations Files: - cmake/reactos-atl.cmake: ReactOS ATL integration - Dependencies/Utility/Utility/atl_compat.h: ATL compatibility layer - Dependencies/Utility/Utility/pseh_compat.h: PSEH compatibility layer - CMakeLists.txt: Include ReactOS ATL configuration --- CMakeLists.txt | 1 + Dependencies/Utility/Utility/atl_compat.h | 89 ++++++++++++++++++++++ Dependencies/Utility/Utility/pseh_compat.h | 51 +++++++++++++ cmake/reactos-atl.cmake | 63 +++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 Dependencies/Utility/Utility/atl_compat.h create mode 100644 Dependencies/Utility/Utility/pseh_compat.h create mode 100644 cmake/reactos-atl.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c7df479a3a1..7f55b4f4f99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ include(FetchContent) # MinGW-w64 specific configuration if(MINGW) include(cmake/mingw.cmake) + include(cmake/reactos-atl.cmake) include(cmake/widl.cmake) endif() diff --git a/Dependencies/Utility/Utility/atl_compat.h b/Dependencies/Utility/Utility/atl_compat.h new file mode 100644 index 00000000000..5be3b20f591 --- /dev/null +++ b/Dependencies/Utility/Utility/atl_compat.h @@ -0,0 +1,89 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** This program is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program. If not, see . +*/ + +/** + * @file atl_compat.h + * @brief ATL compatibility layer for MinGW-w64 with ReactOS ATL + * + * Provides compatibility definitions for using ReactOS ATL headers + * with MinGW-w64 GCC compiler. Uses ReactOS PSEH in C++-compatible + * dummy mode (_USE_DUMMY_PSEH) because MinGW-w64's PSEH uses GNU C + * nested functions which are not valid in C++. + */ + +#pragma once + +#ifdef __MINGW32__ + +// Include Windows types needed for ATL compatibility +#include + +// Include PSEH compatibility first (uses ReactOS PSEH in dummy mode) +#include "pseh_compat.h" + +// Define _ATL_IIDOF macro for ReactOS ATL (uses MinGW-w64's __uuidof) +#ifndef _ATL_IIDOF +#define _ATL_IIDOF(x) __uuidof(x) +#endif + +// Forward declare _Delegate function for COM aggregation support +// ReactOS ATL's COM_INTERFACE_ENTRY_AGGREGATE macro uses _Delegate but doesn't define it +// The actual function pointer will be defined after atlbase.h provides _ATL_CREATORARGFUNC +extern "C" HRESULT WINAPI _ATL_DelegateQueryInterface(void* pv, REFIID riid, LPVOID* ppv, DWORD_PTR dw); + +// Suppress additional warnings from ReactOS ATL headers +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#pragma GCC diagnostic ignored "-Wattributes" + +// NOTE: ReactOS ATL compile definitions are set in cmake/reactos-atl.cmake: +// - _ATL_CSTRING_EXPLICIT_CONSTRUCTORS +// - _ATL_NO_DEBUG_CRT +// - ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW +// - ATL_NO_DEFAULT_LIBS +// These are applied via target_compile_definitions() on the reactos_atl target. +// Any target linking to reactos_atl will automatically inherit these definitions. +// +// IMPORTANT: _ATL_NO_AUTOMATIC_NAMESPACE is NOT defined because the codebase +// uses ATL types (CComModule, CComObject, CString, etc.) without namespace +// qualification and relies on the automatic 'using namespace ATL;' from ATL headers. + +// Define _Delegate implementation and macro now that ATL types are available +inline HRESULT WINAPI _ATL_DelegateQueryInterface(void* pv, REFIID riid, LPVOID* ppv, DWORD_PTR dw) +{ + IUnknown** ppunk = reinterpret_cast(reinterpret_cast(pv) + dw); + if (*ppunk == nullptr) + return E_NOINTERFACE; + return (*ppunk)->QueryInterface(riid, ppv); +} + +#ifndef _Delegate +#define _Delegate ((ATL::_ATL_CREATORARGFUNC*)_ATL_DelegateQueryInterface) +#endif + +// Restore compiler warnings after ATL includes +#define ATL_COMPAT_RESTORE_WARNINGS() \ + do { \ + _Pragma("GCC diagnostic pop") \ + PSEH_COMPAT_RESTORE_WARNINGS() \ + } while(0) + +#else +// Non-MinGW platforms don't need these workarounds +#define ATL_COMPAT_RESTORE_WARNINGS() +#endif // __MINGW32__ diff --git a/Dependencies/Utility/Utility/pseh_compat.h b/Dependencies/Utility/Utility/pseh_compat.h new file mode 100644 index 00000000000..eeab3097632 --- /dev/null +++ b/Dependencies/Utility/Utility/pseh_compat.h @@ -0,0 +1,51 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** This program is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program. If not, see . +*/ + +/** + * @file pseh_compat.h + * @brief PSEH compatibility for MinGW-w64 with ReactOS ATL + * + * ReactOS ATL headers include . This header ensures + * that ReactOS PSEH is used in C++-compatible dummy mode (_USE_DUMMY_PSEH). + * The cmake configuration (reactos-atl.cmake) adds ReactOS PSEH headers + * to the include path before system headers, and defines _USE_DUMMY_PSEH. + */ + +#pragma once + +#ifdef __MINGW32__ + +// Suppress PSEH-related warnings from ReactOS PSEH headers +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#pragma GCC diagnostic ignored "-Wattributes" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#pragma GCC diagnostic ignored "-Wunused-label" + +// ReactOS PSEH headers will be included by ATL headers +// No need to include them explicitly here + +// Restore compiler warnings after PSEH includes +#define PSEH_COMPAT_RESTORE_WARNINGS() \ + _Pragma("GCC diagnostic pop") + +#else +// Non-MinGW platforms use native SEH or don't need PSEH +#define PSEH_COMPAT_RESTORE_WARNINGS() +#endif // __MINGW32__ diff --git a/cmake/reactos-atl.cmake b/cmake/reactos-atl.cmake new file mode 100644 index 00000000000..d7d578bf47e --- /dev/null +++ b/cmake/reactos-atl.cmake @@ -0,0 +1,63 @@ +# TheSuperHackers @build JohnsterID 05/01/2026 Add ReactOS ATL and PSEH compatibility for MinGW +# ReactOS ATL headers for MinGW-w64 builds +# Provides ATL/COM support without MSVC dependencies +# Uses ReactOS PSEH in C++-compatible dummy mode (_USE_DUMMY_PSEH) +# because MinGW-w64's PSEH uses GNU C nested functions which don't work in C++ + +if(MINGW) + message(STATUS "Setting up ReactOS ATL for MinGW-w64") + + FetchContent_Declare( + reactos_atl + GIT_REPOSITORY https://github.com/reactos/reactos.git + GIT_TAG 0.4.15-release + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE + SOURCE_SUBDIR sdk/lib/atl + ) + + FetchContent_GetProperties(reactos_atl) + if(NOT reactos_atl_POPULATED) + FetchContent_Populate(reactos_atl) + + # Create interface library for ReactOS ATL headers + add_library(reactos_atl INTERFACE) + + # Add ReactOS ATL and PSEH include directories with SYSTEM to suppress warnings + # ReactOS PSEH must come BEFORE system includes to override MinGW's pseh2.h + # (MinGW's pseh2.h uses GNU C nested functions which don't work in C++) + # NOTE: Do NOT include ReactOS CRT headers - use MinGW-w64's CRT instead + target_include_directories(reactos_atl SYSTEM INTERFACE + "${reactos_atl_SOURCE_DIR}/sdk/lib/pseh/include" + "${reactos_atl_SOURCE_DIR}/sdk/lib/atl" + ) + + # COM support (_com_util::ConvertStringToBSTR and ConvertBSTRToString) + # is provided by Dependencies/Utility/Utility/comsupp_compat.h as a + # header-only implementation. No library needs to be built or linked. + + # Add required ATL defines for MinGW compatibility + # NOTE: Do NOT define _ATL_NO_AUTOMATIC_NAMESPACE + # The codebase uses ATL types (CComModule, CComObject, CString, etc.) + # without ATL:: qualification and relies on automatic 'using namespace ATL;' + # + # _USE_DUMMY_PSEH: Use ReactOS PSEH's C++-compatible "dummy" mode + # which provides simple macros instead of GNU C nested functions + target_compile_definitions(reactos_atl INTERFACE + _ATL_CSTRING_EXPLICIT_CONSTRUCTORS + _ATL_NO_DEBUG_CRT + ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW + ATL_NO_DEFAULT_LIBS + _USE_DUMMY_PSEH + ) + + message(STATUS "ReactOS ATL headers: ${reactos_atl_SOURCE_DIR}/sdk/lib/atl") + message(STATUS "ReactOS PSEH headers: ${reactos_atl_SOURCE_DIR}/sdk/lib/pseh/include") + message(STATUS "COM support (comsupp): Header-only in Dependencies/Utility/Utility/comsupp_compat.h") + message(STATUS "Using ReactOS PSEH in C++-compatible dummy mode (_USE_DUMMY_PSEH)") + message(STATUS "Using MinGW-w64 CRT headers (NOT ReactOS CRT)") + endif() +else() + # Create dummy target for non-MinGW builds + add_library(reactos_atl INTERFACE) +endif() From c8e7b4ece4e9dc53b9fa15b857c302a7412439ec Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:17:25 +0000 Subject: [PATCH 04/17] build(cmake): Add ReactOS COM support utilities (comsupp) (#2067) Add header-only implementation of COM support string conversion utilities for MinGW-w64. These utilities are provided by comsuppw.lib in MSVC but are not available in MinGW-w64's standard library. Provides: - _com_util::ConvertStringToBSTR(): Convert char* to BSTR - _com_util::ConvertBSTRToString(): Convert BSTR to char* These functions are essential for COM string handling in the browser control integration and other COM-based APIs. The header-only approach eliminates the need for linking against an external library and provides a lightweight, portable solution compatible with both MSVC and MinGW-w64. Implementation uses standard Windows APIs (SysAllocString, WideCharToMultiByte, MultiByteToWideChar) to perform the conversions. Files: - Dependencies/Utility/Utility/comsupp_compat.h: COM string utilities --- Dependencies/Utility/Utility/comsupp_compat.h | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 Dependencies/Utility/Utility/comsupp_compat.h diff --git a/Dependencies/Utility/Utility/comsupp_compat.h b/Dependencies/Utility/Utility/comsupp_compat.h new file mode 100644 index 00000000000..053e4e081ed --- /dev/null +++ b/Dependencies/Utility/Utility/comsupp_compat.h @@ -0,0 +1,143 @@ +/* +** Command & Conquer Generals Zero Hour(tm) +** Copyright 2026 TheSuperHackers +** +** This program is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program. If not, see . +*/ + +/** + * @file comsupp_compat.h + * @brief COM Support compatibility layer for MinGW-w64 + * + * Provides _com_util::ConvertStringToBSTR() and ConvertBSTRToString() + * as header-only implementations for MinGW-w64 builds. + * + * These functions are required by the _bstr_t class (from ReactOS comutil.h) + * for char* <-> BSTR conversions. They are called internally when constructing + * _bstr_t objects from C strings or converting _bstr_t back to char*. + * + * Used indirectly by: + * - Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp (8+ _bstr_t constructions) + * - Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h (_bstr_t usage) + * + * MinGW-w64 provides COM error handling (comdef.h) but lacks the string + * conversion utilities. ReactOS provides comsupp.cpp with implementations, + * but we use this header-only version to avoid building/linking an extra + * library. This must be included BEFORE comutil.h to provide definitions + * before _bstr_t's inline methods are instantiated. + * + * @note Include this header before in MinGW builds to provide + * symbol definitions for _bstr_t's internal string conversion calls. + * Without this, you will get "undefined reference" linker errors. + */ + +#pragma once + +#ifdef __MINGW32__ + +#include +#include +#include +#include + +namespace _com_util +{ + +inline BSTR WINAPI ConvertStringToBSTR(const char *pSrc) +{ + DWORD cwch; + BSTR wsOut = nullptr; + + if (!pSrc) + return nullptr; + + // Compute the needed size with the null terminator + cwch = MultiByteToWideChar(CP_ACP, 0, pSrc, -1, nullptr, 0); + if (cwch == 0) + return nullptr; + + // Allocate the BSTR (without the null terminator) + wsOut = SysAllocStringLen(nullptr, cwch - 1); + if (!wsOut) + { + _com_issue_error(HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY)); + return nullptr; + } + + // Convert the string + if (MultiByteToWideChar(CP_ACP, 0, pSrc, -1, wsOut, cwch) == 0) + { + // We failed, clean everything up + cwch = GetLastError(); + + SysFreeString(wsOut); + wsOut = nullptr; + + _com_issue_error(!IS_ERROR(cwch) ? HRESULT_FROM_WIN32(cwch) : cwch); + } + + return wsOut; +} + +inline char* WINAPI ConvertBSTRToString(BSTR pSrc) +{ + DWORD cb, cwch; + char *szOut = nullptr; + + if (!pSrc) + return nullptr; + + // Retrieve the size of the BSTR with the null terminator + cwch = SysStringLen(pSrc) + 1; + + // Compute the needed size with the null terminator + cb = WideCharToMultiByte(CP_ACP, 0, pSrc, cwch, nullptr, 0, nullptr, nullptr); + if (cb == 0) + { + cwch = GetLastError(); + _com_issue_error(!IS_ERROR(cwch) ? HRESULT_FROM_WIN32(cwch) : cwch); + return nullptr; + } + + // Allocate the string + szOut = (char*)::operator new(cb * sizeof(char)); + if (!szOut) + { + _com_issue_error(HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY)); + return nullptr; + } + + // Convert the string and null-terminate + szOut[cb - 1] = '\0'; + if (WideCharToMultiByte(CP_ACP, 0, pSrc, cwch, szOut, cb, nullptr, nullptr) == 0) + { + // We failed, clean everything up + cwch = GetLastError(); + + ::operator delete(szOut); + szOut = nullptr; + + _com_issue_error(!IS_ERROR(cwch) ? HRESULT_FROM_WIN32(cwch) : cwch); + } + + return szOut; +} + +} + +// Provide vtMissing global variable +// Use inline variable (C++17) to avoid multiple definition errors +inline _variant_t vtMissing(DISP_E_PARAMNOTFOUND, VT_ERROR); + +#endif // __MINGW32__ From 8f2bf0ac3b655eee30cc43bec6440fd2feed9083 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:18:51 +0000 Subject: [PATCH 05/17] build(deps): Update external dependencies for MinGW-w64 support (#2067) Update DirectX 8, Miles Sound System, and Bink Video SDK to versions with MinGW-w64 compatibility fixes. --- cmake/bink.cmake | 2 +- cmake/dx8.cmake | 2 +- cmake/miles.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/bink.cmake b/cmake/bink.cmake index c1e0af8cb13..83b5317568a 100644 --- a/cmake/bink.cmake +++ b/cmake/bink.cmake @@ -1,7 +1,7 @@ FetchContent_Declare( bink GIT_REPOSITORY https://github.com/TheSuperHackers/bink-sdk-stub.git - GIT_TAG f554b7fa68c97d4e6b607d535e726ef37622fe65 + GIT_TAG 3241ee1e3739b21d9c0a0760c1a5d5622d21c093 ) FetchContent_MakeAvailable(bink) diff --git a/cmake/dx8.cmake b/cmake/dx8.cmake index 44216deb86d..dd08f56119a 100644 --- a/cmake/dx8.cmake +++ b/cmake/dx8.cmake @@ -1,7 +1,7 @@ FetchContent_Declare( dx8 GIT_REPOSITORY https://github.com/TheSuperHackers/min-dx8-sdk.git - GIT_TAG 20d31185872e1304e0573f7f4885ae11e50670d3 + GIT_TAG 7bddff8c01f5fb931c3cb73d4aa8e66d303d97bc ) FetchContent_MakeAvailable(dx8) diff --git a/cmake/miles.cmake b/cmake/miles.cmake index c25b27114c6..79ad6b6e28b 100644 --- a/cmake/miles.cmake +++ b/cmake/miles.cmake @@ -1,7 +1,7 @@ FetchContent_Declare( miles GIT_REPOSITORY https://github.com/TheSuperHackers/miles-sdk-stub.git - GIT_TAG 44c82ab6211028776facf53b0ce3a88a3e232c45 + GIT_TAG 6e32700d7ba4b4713a03bf1f5ffc3b0ac8d17264 ) FetchContent_MakeAvailable(miles) From 7fc16b0ecb72b1ca5ceac7017eddcf6e363b3d86 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:19:00 +0000 Subject: [PATCH 06/17] build(cmake): Configure MinGW-specific compiler and linker settings (#2067) Add MinGW-w64 detection and configure compiler flags to optimize build output for cross-compilation: - Detect MinGW-w64 compiler and set IS_MINGW_BUILD flag - Skip debug symbols (-g) in MinGW Release builds to reduce executable size (MSVC Release builds already exclude debug info by default) - Maintain debug symbols for MinGW Debug builds This reduces the size of MinGW Release builds significantly while keeping compatibility with MSVC build configurations. Debug builds still include full debugging information for development. Files: - cmake/compilers.cmake: Add MinGW detection and conditional debug flags --- cmake/compilers.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index bd8150860ab..f9478fc4a50 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -8,6 +8,15 @@ if (DEFINED MSVC_VERSION) message(STATUS "MSVC_VERSION: ${MSVC_VERSION}") endif() +# TheSuperHackers @build JohnsterID 05/01/2026 Add MinGW-w64 detection and configure compiler flags +# Detect MinGW-w64 +if(MINGW) + message(STATUS "MinGW-w64 detected") + set(IS_MINGW_BUILD TRUE) +else() + set(IS_MINGW_BUILD FALSE) +endif() + # Set variable for VS6 to handle special cases. if (DEFINED MSVC_VERSION AND MSVC_VERSION LESS 1300) set(IS_VS6_BUILD TRUE) @@ -25,8 +34,11 @@ if(MSVC) add_link_options("/INCREMENTAL:NO") else() # We go a bit wild here and assume any other compiler we are going to use supports -g for debug info. - string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g") - string(APPEND CMAKE_C_FLAGS_RELEASE " -g") + # For MinGW, skip adding -g to Release builds + if(NOT (MINGW AND CMAKE_BUILD_TYPE STREQUAL "Release")) + string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g") + string(APPEND CMAKE_C_FLAGS_RELEASE " -g") + endif() endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) From b8eb81b848b1c42843a30d0ada24e607f4c010c0 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:19:16 +0000 Subject: [PATCH 07/17] build(cmake): Add MinGW CMake presets for i686 (#2067) Add configure, build, and workflow presets for MinGW-w64 32-bit (i686) cross-compilation. Enables easy building with standardized configurations. Presets: - mingw-w64-i686: Release build (optimized, no debug symbols) - mingw-w64-i686-debug: Debug build (with debugging symbols) - mingw-w64-i686-profile: Profile build (optimized with profiling) All presets: - Use Unix Makefiles generator (as required for MinGW) - Reference the mingw-w64-i686.cmake toolchain file - Generate compile_commands.json for IDE integration - Build to build/mingw-w64-i686 directory - Include corresponding build and workflow presets Usage: cmake --preset mingw-w64-i686 cmake --build --preset mingw-w64-i686 Or use workflow preset: cmake --workflow --preset mingw-w64-i686 Files: - CMakePresets.json: Add MinGW i686 configure/build/workflow presets --- CMakePresets.json | 88 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index ba1d2d194c2..3b0a69e7261 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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": [ @@ -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": [ @@ -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" + } + ] } ] } \ No newline at end of file From ebc51f5f9dd0294f3276f0c8e48524704988d1f6 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:20:49 +0000 Subject: [PATCH 08/17] fix(precompiled): Add ATL compatibility to precompiled headers (#2067) Include ATL compatibility layer in precompiled headers for both Generals and Zero Hour to enable MinGW-w64 builds with ReactOS ATL support. Changes: - Include atl_compat.h before atlbase.h for GCC/MinGW builds - Add pragma pop at end of header to restore warnings - Conditional compilation ensures MSVC builds remain unchanged The ATL compatibility header must be included before ATL headers to: - Define _USE_DUMMY_PSEH for C++-compatible exception handling - Configure ReactOS ATL include paths - Disable problematic GCC warnings for ATL code - Define ATL-specific macros for MinGW compatibility This change enables CComPtr, CComBSTR, and other ATL functionality in MinGW-w64 builds while maintaining full MSVC compatibility. Files: - Generals/Code/GameEngine/Include/Precompiled/PreRTS.h - GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h --- Generals/Code/GameEngine/Include/Precompiled/PreRTS.h | 8 ++++++++ GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h b/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h index 2432971b175..3ce15b0ab63 100644 --- a/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h +++ b/Generals/Code/GameEngine/Include/Precompiled/PreRTS.h @@ -40,6 +40,10 @@ class STLSpecialAlloc; // PLEASE DO NOT ABUSE WINDOWS OR IT WILL BE REMOVED ENTIRELY. :-) //--------------------------------------------------------------------------------- System Includes #define WIN32_LEAN_AND_MEAN +// TheSuperHackers @build JohnsterID 05/01/2026 Add ATL compatibility for MinGW-w64 builds +#if defined(__GNUC__) && defined(_WIN32) + #include +#endif #include #include @@ -123,3 +127,7 @@ class STLSpecialAlloc; #include "Common/Thing.h" #include "Common/UnicodeString.h" + +#if defined(__GNUC__) && defined(_WIN32) + #pragma GCC diagnostic pop +#endif diff --git a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h index f6af2534bae..c6f3131d78b 100644 --- a/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h +++ b/GeneralsMD/Code/GameEngine/Include/Precompiled/PreRTS.h @@ -40,6 +40,10 @@ class STLSpecialAlloc; // PLEASE DO NOT ABUSE WINDOWS OR IT WILL BE REMOVED ENTIRELY. :-) //--------------------------------------------------------------------------------- System Includes #define WIN32_LEAN_AND_MEAN +// TheSuperHackers @build JohnsterID 05/01/2026 Add ATL compatibility for MinGW-w64 builds +#if defined(__GNUC__) && defined(_WIN32) + #include +#endif #include #include @@ -124,3 +128,7 @@ class STLSpecialAlloc; #include "Common/Thing.h" #include "Common/UnicodeString.h" + +#if defined(__GNUC__) && defined(_WIN32) + #pragma GCC diagnostic pop +#endif From f4771e33fd3afda2c00f2ff5586345fdc6c58787 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:21:26 +0000 Subject: [PATCH 09/17] fix(cmake): Fix CMake dependencies and library linking for MinGW (#2067) Update CMakeLists.txt files to fix library dependencies and ensure proper linking for MinGW-w64 builds: Core libraries: - WW3D2: Add core_wwdebug, core_wwlib, core_wwmath dependencies Make comsuppw library MSVC-only (MinGW uses header-only comsupp_compat.h) Link WW3D2 libraries for core_wwdebug target - WWMath: Add core_wwsaveload dependency - GameEngine: Add widl support for browser control IDL compilation - EABrowserDispatch/Engine: Include widl-generated headers Game executables: - Generals/GeneralsMD Main: Make NODEFAULTLIB and RC files MSVC-only (MinGW doesn't support /NODEFAULTLIB or .rc resource compilation via these paths) These changes ensure: - Proper link order and dependency resolution - MSVC-specific features don't break MinGW builds - COM interface code generation works with widl - All required libraries are linked Files: - Core/GameEngine/CMakeLists.txt - Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt - Core/Libraries/Source/EABrowserEngine/CMakeLists.txt - Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt - Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt - Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt - Generals/Code/Main/CMakeLists.txt - GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt - GeneralsMD/Code/Main/CMakeLists.txt --- Core/GameEngine/CMakeLists.txt | 5 +++ .../Source/EABrowserDispatch/CMakeLists.txt | 36 +++++++++++++------ .../Source/EABrowserEngine/CMakeLists.txt | 36 +++++++++++++------ .../Source/WWVegas/WW3D2/CMakeLists.txt | 4 ++- .../Source/WWVegas/WWMath/CMakeLists.txt | 1 + .../Source/WWVegas/WW3D2/CMakeLists.txt | 1 + Generals/Code/Main/CMakeLists.txt | 10 ++++-- .../Source/WWVegas/WW3D2/CMakeLists.txt | 1 + GeneralsMD/Code/Main/CMakeLists.txt | 9 +++-- 9 files changed, 78 insertions(+), 25 deletions(-) diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index aae2e821fbb..4e27570cf6d 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -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() diff --git a/Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt b/Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt index 169ea2db465..baef7ddbca3 100644 --- a/Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt +++ b/Core/Libraries/Source/EABrowserDispatch/CMakeLists.txt @@ -1,16 +1,32 @@ 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) - set_target_properties(core_browserdispatchwin PROPERTIES OUTPUT_NAME browserdispatchwin) - target_link_libraries(core_browserdispatch INTERFACE core_browserdispatchwin) + 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 /iid BrowserDispatch_i.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserDispatch.idl" + VERBATIM + ) + add_library(core_browserdispatchwin STATIC BrowserDispatch_i.c) + else() + message(FATAL_ERROR + "EABrowserDispatch requires an IDL compiler for Windows builds:\n" + " - For MinGW: Install widl (apt-get install wine-stable-dev)\n" + " - For MSVC: midl.exe should be in PATH\n" + " - For other compilers: Not currently supported") + endif() + + if(TARGET core_browserdispatchwin) + set_target_properties(core_browserdispatchwin PROPERTIES OUTPUT_NAME browserdispatchwin) + target_link_libraries(core_browserdispatch INTERFACE core_browserdispatchwin) + endif() endif() target_include_directories(core_browserdispatch INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/..) diff --git a/Core/Libraries/Source/EABrowserEngine/CMakeLists.txt b/Core/Libraries/Source/EABrowserEngine/CMakeLists.txt index 6df92e01f92..58a12bb9c16 100644 --- a/Core/Libraries/Source/EABrowserEngine/CMakeLists.txt +++ b/Core/Libraries/Source/EABrowserEngine/CMakeLists.txt @@ -1,16 +1,32 @@ 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) - set_target_properties(core_browserenginewin PROPERTIES OUTPUT_NAME browserenginewin) - target_link_libraries(core_browserengine INTERFACE core_browserenginewin) + 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 /iid BrowserEngine_i.c + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS "${CMAKE_CURRENT_LIST_DIR}/BrowserEngine.idl" + VERBATIM + ) + add_library(core_browserenginewin STATIC BrowserEngine_i.c) + else() + message(FATAL_ERROR + "EABrowserEngine requires an IDL compiler for Windows builds:\n" + " - For MinGW: Install widl (apt-get install wine-stable-dev)\n" + " - For MSVC: midl.exe should be in PATH\n" + " - For other compilers: Not currently supported") + endif() + + if(TARGET core_browserenginewin) + set_target_properties(core_browserenginewin PROPERTIES OUTPUT_NAME browserenginewin) + target_link_libraries(core_browserengine INTERFACE core_browserenginewin) + endif() endif() target_include_directories(core_browserengine INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/..) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt index 35c7ff4bd6e..d8a1a275779 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt +++ b/Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt @@ -237,7 +237,7 @@ 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 ) @@ -245,4 +245,6 @@ endif() target_link_libraries(corei_ww3d2 INTERFACE core_browserengine + core_wwlib + core_wwmath ) diff --git a/Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt b/Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt index 58f67690b28..dca9eb68fef 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt +++ b/Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt @@ -88,6 +88,7 @@ target_sources(core_wwmath PRIVATE ${WWMATH_SRC}) target_link_libraries(core_wwmath PRIVATE core_wwcommon corei_always + core_wwsaveload ) # @todo Test its impact and see what to do with the legacy functions. diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt index 3bc272b2e82..ada976f2a3c 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt @@ -249,6 +249,7 @@ target_precompile_headers(g_ww3d2 PRIVATE ) target_link_libraries(g_ww3d2 PRIVATE + core_wwdebug corei_ww3d2 g_wwcommon gi_always diff --git a/Generals/Code/Main/CMakeLists.txt b/Generals/Code/Main/CMakeLists.txt index f6b7a4640bd..5e9aa4c9cf1 100644 --- a/Generals/Code/Main/CMakeLists.txt +++ b/Generals/Code/Main/CMakeLists.txt @@ -54,7 +54,9 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/BuildVersion.h ) endif() -target_link_options(g_generals PRIVATE "/NODEFAULTLIB:libci.lib") +if(MSVC) + target_link_options(g_generals PRIVATE "/NODEFAULTLIB:libci.lib") +endif() target_include_directories(g_generals PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} @@ -67,7 +69,11 @@ target_sources(g_generals PRIVATE WinMain.h ) -if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") +# RC files are optional for MinGW builds +# Icon: LoadIcon() handles missing resource gracefully (uses default system icon) +# Manifest: DPI awareness metadata (nice to have but not essential) +# TYPELIB: Broken (0 bytes) and causes windres memory exhaustion errors +if(MSVC) # VS2005 and later adds default manifest, we need to turn it off to prevent conflict with custom manifest if(NOT IS_VS6_BUILD) target_link_options(g_generals PRIVATE diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt index f3bfa78cdb7..59617b6b451 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt @@ -254,6 +254,7 @@ target_precompile_headers(z_ww3d2 PRIVATE ) target_link_libraries(z_ww3d2 PRIVATE + core_wwdebug corei_ww3d2 z_wwcommon zi_always diff --git a/GeneralsMD/Code/Main/CMakeLists.txt b/GeneralsMD/Code/Main/CMakeLists.txt index cabc45befa4..49cee59a1ec 100644 --- a/GeneralsMD/Code/Main/CMakeLists.txt +++ b/GeneralsMD/Code/Main/CMakeLists.txt @@ -45,7 +45,9 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/BuildVersion.h " ) -target_link_options(z_generals PRIVATE "/NODEFAULTLIB:libci.lib") +if(MSVC) + target_link_options(z_generals PRIVATE "/NODEFAULTLIB:libci.lib") +endif() target_include_directories(z_generals PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} @@ -57,7 +59,10 @@ target_sources(z_generals PRIVATE WinMain.h ) -if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") +# RC files optional for MinGW builds +# Icon: LoadIcon() handles missing resource gracefully (uses default system icon) +# Manifest: DPI awareness metadata (nice to have but not essential) +if(MSVC) # VS2005 and later adds default manifest, we need to turn it off to prevent conflict with custom manifest if(NOT IS_VS6_BUILD) target_link_options(z_generals PRIVATE From e28663d1791e9925c3d2711e82486b6eee8da49c Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:22:07 +0000 Subject: [PATCH 10/17] fix(core): Add MinGW-w64 compatibility fixes to Core libraries (#2067) Add comprehensive MinGW-w64 compatibility fixes to Core engine and library code: Type definitions and compatibility (always.h, BaseTypeCore.h): - Add __int64 and _int64 type definitions for MinGW - Add NOMINMAX and min/max template handling - Add __forceinline macro mapping Calling conventions (wwstring, widestring, GameText, profile): - Standardize Format() functions to __cdecl for cross-compiler compatibility - Fix variadic macro handling for GCC - Add explicit calling convention specifications where needed Headers and forward declarations: - Add missing forward declarations (WorldHeightMap.h, texture.h, textureloader.h) - Fix include path case sensitivity (endian_compat.h, winsock.h) - Include comsupp_compat.h before comutil.h for COM support Compiler guards and compatibility: - Guard MSVC SEH (MiniDumper.cpp) with _MSC_VER checks - Guard inline assembly with compiler checks (debug_stack.cpp, debug_except.cpp) - Add GCC inline assembly alternatives where needed - Disable MSVC SEH for MinGW (thread.cpp, Except.cpp) Linkage fixes: - Remove inappropriate static qualifiers (W3DWaterTracks.cpp) - Fix extern/static mismatches (missingtexture.cpp) - Add explicit void* casts for function pointers Includes and dependencies: - Add stddef.h for size_t (wwmemlog.h) - Add missing headers for MinGW compilation - Fix COM browser header inclusion order Audio and misc: - Fix __stdcall in AudioEvents.h function pointer typedefs - Fix volatile atomic operations (NoxCompress.cpp) - Use portable sint64 types (wwprofile.cpp) All changes are guarded with compiler checks to maintain MSVC compatibility. Files: 31 Core library source and header files --- .../GameNetwork/WOLBrowser/FEBDispatch.h | 5 ++ .../Source/Common/System/MiniDumper.cpp | 9 +++ .../Source/Common/System/XferCRC.cpp | 2 +- .../W3DDevice/GameClient/WorldHeightMap.h | 2 + .../GameClient/Water/W3DWaterTracks.cpp | 2 +- Core/Libraries/Include/Lib/BaseTypeCore.h | 8 +-- .../Compression/LZHCompress/NoxCompress.cpp | 4 +- .../Source/WWVegas/WW3D2/dx8webbrowser.cpp | 3 + .../Source/WWVegas/WW3D2/missingtexture.cpp | 4 +- Core/Libraries/Source/WWVegas/WW3D2/texture.h | 1 + .../Source/WWVegas/WW3D2/textureloader.h | 1 + .../Source/WWVegas/WWAudio/AudioEvents.h | 8 +-- .../Source/WWVegas/WWDebug/wwmemlog.cpp | 2 +- .../Source/WWVegas/WWDebug/wwmemlog.h | 2 + .../Source/WWVegas/WWDebug/wwprofile.cpp | 2 +- .../Libraries/Source/WWVegas/WWDownload/ftp.h | 2 +- .../Libraries/Source/WWVegas/WWLib/Except.cpp | 27 +++++---- Core/Libraries/Source/WWVegas/WWLib/Except.h | 4 +- Core/Libraries/Source/WWVegas/WWLib/always.h | 16 ++++++ .../Libraries/Source/WWVegas/WWLib/thread.cpp | 9 +++ .../Source/WWVegas/WWLib/widestring.cpp | 4 +- .../Source/WWVegas/WWLib/widestring.h | 4 +- .../Source/WWVegas/WWLib/wwstring.cpp | 4 +- .../Libraries/Source/WWVegas/WWLib/wwstring.h | 4 +- Core/Libraries/Source/debug/debug_debug.cpp | 56 +++++++++++++++++++ Core/Libraries/Source/debug/debug_debug.h | 6 ++ Core/Libraries/Source/debug/debug_except.cpp | 16 ++---- Core/Libraries/Source/debug/debug_stack.cpp | 12 ++++ Core/Libraries/Source/profile/internal.h | 2 +- .../Source/profile/profile_funclevel.cpp | 2 +- Core/Tools/Autorun/GameText.cpp | 2 +- .../Code/Libraries/Include/Lib/BaseType.h | 4 +- .../Code/Libraries/Include/Lib/BaseType.h | 4 +- 33 files changed, 179 insertions(+), 54 deletions(-) diff --git a/Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h b/Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h index 1c60b0bf50a..e7e0eb1135e 100644 --- a/Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h +++ b/Core/GameEngine/Include/GameNetwork/WOLBrowser/FEBDispatch.h @@ -29,6 +29,11 @@ #pragma once +#if defined __MINGW32__ +#include "Utility/atl_compat.h" +#include "Utility/comsupp_compat.h" +#endif + #include extern CComModule _Module; #include diff --git a/Core/GameEngine/Source/Common/System/MiniDumper.cpp b/Core/GameEngine/Source/Common/System/MiniDumper.cpp index 9c48e39d12c..b5fcf376c88 100644 --- a/Core/GameEngine/Source/Common/System/MiniDumper.cpp +++ b/Core/GameEngine/Source/Common/System/MiniDumper.cpp @@ -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 @@ -102,6 +104,13 @@ void MiniDumper::TriggerMiniDump(DumpType dumpType) { TriggerMiniDumpForException(g_dumpException, dumpType); } +#elif defined(__GNUC__) && defined(_WIN32) + // GCC/MinGW-w64 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.")); +#else + #error "MiniDumper::TriggerMiniDump: Unsupported compiler. This code requires MSVC or GCC/MinGW-w64 targeting Windows." +#endif } void MiniDumper::TriggerMiniDumpForException(_EXCEPTION_POINTERS* e_info, DumpType dumpType) diff --git a/Core/GameEngine/Source/Common/System/XferCRC.cpp b/Core/GameEngine/Source/Common/System/XferCRC.cpp index 2db597097d2..c5c3297fd5c 100644 --- a/Core/GameEngine/Source/Common/System/XferCRC.cpp +++ b/Core/GameEngine/Source/Common/System/XferCRC.cpp @@ -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" //------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------- diff --git a/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h b/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h index e5ce499ba8b..66d736dbb01 100644 --- a/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h +++ b/Core/GameEngineDevice/Include/W3DDevice/GameClient/WorldHeightMap.h @@ -91,6 +91,8 @@ class InputStream; class OutputStream; class DataChunkInput; struct DataChunkInfo; +class TerrainTextureClass; +class AlphaTerrainTextureClass; class AlphaEdgeTextureClass; #define NUM_ALPHA_TILES 12 diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp index 7b811190f92..8fb9cae3199 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWaterTracks.cpp @@ -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; diff --git a/Core/Libraries/Include/Lib/BaseTypeCore.h b/Core/Libraries/Include/Lib/BaseTypeCore.h index f173ade19b4..ab702efd496 100644 --- a/Core/Libraries/Include/Lib/BaseTypeCore.h +++ b/Core/Libraries/Include/Lib/BaseTypeCore.h @@ -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 diff --git a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp index 638ab493c12..25d454c0b87 100644 --- a/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp +++ b/Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp @@ -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; } @@ -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; } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp index c3a5ef22b3a..75f014f3f56 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp @@ -46,6 +46,9 @@ #else +#ifdef __MINGW32__ +#include "Utility/comsupp_compat.h" // MinGW COM support compatibility +#endif #include #include diff --git a/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp index e857b831392..0a2867b12b7 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/missingtexture.cpp @@ -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, @@ -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, diff --git a/Core/Libraries/Source/WWVegas/WW3D2/texture.h b/Core/Libraries/Source/WWVegas/WW3D2/texture.h index 8903caacb46..d02665fd701 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/texture.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/texture.h @@ -58,6 +58,7 @@ class DX8Wrapper; class TextureLoader; class LoaderThreadClass; class TextureLoadTaskClass; +class TextureClass; class CubeTextureClass; class VolumeTextureClass; diff --git a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h index 66c8576f14d..af5b018cd84 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/textureloader.h @@ -45,6 +45,7 @@ class StringClass; struct IDirect3DTexture8; class TextureLoadTaskClass; +class TextureLoadTaskListClass; class TextureLoader { diff --git a/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h b/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h index 3141ff21630..f3db72c15db 100644 --- a/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h +++ b/Core/Libraries/Source/WWVegas/WWAudio/AudioEvents.h @@ -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); ///////////////////////////////////////////////////////////////////////////////// diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp index 52644fa4984..067a8b6b716 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp @@ -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; } diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.h b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.h index b994bbe16bc..3a87b80d83b 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.h +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.h @@ -38,6 +38,8 @@ #pragma once +#include + #define LOG_MEMORY // Comment this out to disable memlog compiling in class MemLogClass; diff --git a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp index c3ed92b9e2f..d631a370926 100644 --- a/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp +++ b/Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp @@ -95,7 +95,7 @@ WWINLINE double WWProfile_Get_Inv_Processor_Ticks_Per_Second(void) * HISTORY: * * 9/24/2000 gth : Created. * *=============================================================================================*/ -inline void WWProfile_Get_Ticks(_int64 * ticks) +static inline void WWProfile_Get_Ticks(_int64 * ticks) { #ifdef _UNIX *ticks = TIMEGETTIME(); diff --git a/Core/Libraries/Source/WWVegas/WWDownload/ftp.h b/Core/Libraries/Source/WWVegas/WWDownload/ftp.h index 08c5918ab47..bfbb39be77e 100644 --- a/Core/Libraries/Source/WWVegas/WWDownload/ftp.h +++ b/Core/Libraries/Source/WWVegas/WWDownload/ftp.h @@ -22,7 +22,7 @@ //#include "../resource.h" // main symbols -#include "winsock.h" +#include #include #include "WWDownload/ftpdefs.h" diff --git a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp index 863f6ed63dd..6a8cdb87a4f 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp @@ -47,7 +47,7 @@ * Exception_Handler -- Exception handler filter function * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -#ifdef _MSC_VER + #if defined(_WIN32) #include "always.h" #include @@ -625,18 +625,13 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info) } void *fp_data_ptr = (void*)(&context->FloatSave.RegisterArea[fp*10]); - double fp_value; + // TheSuperHackers @refactor Replaced MSVC inline assembly with portable C++ cast for MinGW compatibility /* ** Convert FP dump from temporary real value (10 bytes) to double (8 bytes). + ** On x86, long double is the 10-byte x87 format, so we can just cast. */ - _asm { - push eax - mov eax,fp_data_ptr - fld tbyte ptr [eax] - fstp qword ptr [fp_value] - pop eax - } + double fp_value = (double)(*(long double*)fp_data_ptr); sprintf(scrap, " %+#.17e\r\n", fp_value); Add_Txt(scrap); } @@ -1232,6 +1227,7 @@ int Stack_Walk(unsigned long *return_addresses, int num_addresses, CONTEXT *cont unsigned long reg_eip, reg_ebp, reg_esp; +#if defined(_MSC_VER) __asm { here: lea eax,here @@ -1239,6 +1235,17 @@ int Stack_Walk(unsigned long *return_addresses, int num_addresses, CONTEXT *cont mov reg_ebp,ebp mov reg_esp,esp } +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + __asm__ __volatile__ ( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%ebp, %1\n\t" + "mov %%esp, %2" + : "=r" (reg_eip), "=r" (reg_ebp), "=r" (reg_esp) + ); +#else +#error "Unsupported compiler or architecture for register capture" +#endif stack_frame.AddrPC.Mode = AddrModeFlat; stack_frame.AddrPC.Offset = reg_eip; @@ -1307,7 +1314,7 @@ bool Is_Trying_To_Exit(void) -#endif //_MSC_VER +#endif //_WIN32 diff --git a/Core/Libraries/Source/WWVegas/WWLib/Except.h b/Core/Libraries/Source/WWVegas/WWLib/Except.h index 69a7bf3b6cc..6b9daaeadb8 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/Except.h +++ b/Core/Libraries/Source/WWVegas/WWLib/Except.h @@ -36,7 +36,7 @@ #pragma once -#ifdef _MSC_VER +#if defined(_WIN32) #include "win.h" /* @@ -80,4 +80,4 @@ typedef struct tThreadInfoType { -#endif //_MSC_VER +#endif //_WIN32 diff --git a/Core/Libraries/Source/WWVegas/WWLib/always.h b/Core/Libraries/Source/WWVegas/WWLib/always.h index 0bbe089cccf..946f5dab695 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/always.h +++ b/Core/Libraries/Source/WWVegas/WWLib/always.h @@ -200,7 +200,9 @@ class W3DMPO ** I'm replacing all occurrences of 'min' and 'max with 'MIN' and 'MAX'. For code which ** is out of our domain (e.g. Max sdk) I'm declaring template functions for 'min' and 'max' */ +#ifndef NOMINMAX #define NOMINMAX +#endif #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) @@ -218,6 +220,17 @@ class W3DMPO #undef max #endif +// Provide min/max template functions for compatibility with legacy code +#ifndef _MIN_MAX_TEMPLATES_DEFINED_ +#define _MIN_MAX_TEMPLATES_DEFINED_ + +#if defined(__MINGW32__) || defined(__MINGW64__) +// For MinGW, use STL's min/max +#include +using std::min; +using std::max; +#else +// For MSVC, provide custom templates template T min(T a,T b) { if (a T max(T a,T b) return b; } } +#endif + +#endif // _MIN_MAX_TEMPLATES_DEFINED_ /* diff --git a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp index 6bafc3314ad..7b30487e27b 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/thread.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/thread.cpp @@ -57,6 +57,8 @@ void __cdecl ThreadClass::Internal_Thread_Function(void* params) #ifdef _WIN32 Register_Thread_ID(tc->ThreadID, tc->ThreadName); +#if defined(_MSC_VER) + // MSVC supports structured exception handling (__try/__except) if (tc->ExceptionHandler != nullptr) { __try { tc->Thread_Function(); @@ -64,6 +66,13 @@ void __cdecl ThreadClass::Internal_Thread_Function(void* params) } else { tc->Thread_Function(); } +#elif defined(__GNUC__) && defined(_WIN32) + // GCC/MinGW-w64 doesn't support MSVC's __try/__except syntax + // Call Thread_Function directly without SEH support + tc->Thread_Function(); +#else + #error "ThreadClass::Internal_Thread_Function: Unsupported compiler. This code requires MSVC or GCC/MinGW-w64 targeting Windows." +#endif #else //_WIN32 tc->Thread_Function(); diff --git a/Core/Libraries/Source/WWVegas/WWLib/widestring.cpp b/Core/Libraries/Source/WWVegas/WWLib/widestring.cpp index 6fc6d12643d..fa421229b2b 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/widestring.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/widestring.cpp @@ -242,7 +242,7 @@ WideStringClass::Free_String (void) // Format // /////////////////////////////////////////////////////////////////// -int _cdecl +int __cdecl WideStringClass::Format_Args (const WCHAR *format, va_list arg_list ) { if (format == nullptr) { @@ -273,7 +273,7 @@ WideStringClass::Format_Args (const WCHAR *format, va_list arg_list ) // Format // /////////////////////////////////////////////////////////////////// -int _cdecl +int __cdecl WideStringClass::Format (const WCHAR *format, ...) { if (format == nullptr) { diff --git a/Core/Libraries/Source/WWVegas/WWLib/widestring.h b/Core/Libraries/Source/WWVegas/WWLib/widestring.h index 3f08f9c3564..68421655bf5 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/widestring.h +++ b/Core/Libraries/Source/WWVegas/WWLib/widestring.h @@ -104,8 +104,8 @@ class WideStringClass bool Is_Empty (void) const; void Erase (int start_index, int char_count); - int _cdecl Format (const WCHAR *format, ...); - int _cdecl Format_Args (const WCHAR *format, va_list arg_list ); + int __cdecl Format (const WCHAR *format, ...); + int __cdecl Format_Args (const WCHAR *format, va_list arg_list ); bool Convert_From (const char *text); bool Convert_To (StringClass &string); bool Convert_To (StringClass &string) const; diff --git a/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp b/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp index 3793688c440..62c612d0856 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp @@ -235,7 +235,7 @@ StringClass::Free_String (void) // Format // /////////////////////////////////////////////////////////////////// -int _cdecl +int __cdecl StringClass::Format_Args (const TCHAR *format, va_list arg_list ) { // @@ -267,7 +267,7 @@ StringClass::Format_Args (const TCHAR *format, va_list arg_list ) // Format // /////////////////////////////////////////////////////////////////// -int _cdecl +int __cdecl StringClass::Format (const TCHAR *format, ...) { va_list arg_list; diff --git a/Core/Libraries/Source/WWVegas/WWLib/wwstring.h b/Core/Libraries/Source/WWVegas/WWLib/wwstring.h index 56981c4fdf4..6ae220b3787 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/wwstring.h +++ b/Core/Libraries/Source/WWVegas/WWLib/wwstring.h @@ -114,8 +114,8 @@ class StringClass bool Is_Empty (void) const; void Erase (int start_index, int char_count); - int _cdecl Format (const TCHAR *format, ...); - int _cdecl Format_Args (const TCHAR *format, va_list arg_list ); + int __cdecl Format (const TCHAR *format, ...); + int __cdecl Format_Args (const TCHAR *format, va_list arg_list ); // Trim leading and trailing whitespace characters (values <= 32) void Trim(void); diff --git a/Core/Libraries/Source/debug/debug_debug.cpp b/Core/Libraries/Source/debug/debug_debug.cpp index dd637d166a6..0288448d04f 100644 --- a/Core/Libraries/Source/debug/debug_debug.cpp +++ b/Core/Libraries/Source/debug/debug_debug.cpp @@ -47,11 +47,22 @@ bool __DebugIncludeInLink1; // .CRT$XCZ. We jam in our own two functions at the very beginning // and end of this list (B and Y respectively since the A and Z segments // contain list delimiters). +#if defined(_MSC_VER) #pragma data_seg(".CRT$XCB") void *Debug::PreStatic=&Debug::PreStaticInit; #pragma data_seg(".CRT$XCY") void *Debug::PostStatic=&Debug::PostStaticInit; #pragma data_seg() +#elif defined(__GNUC__) && defined(_WIN32) +// For GCC/MinGW-w64 targeting Windows, use constructor attributes +// Use priority 101 for PreStatic (very early) and 65434 for PostStatic (very late) +void __attribute__((constructor(101))) GccPreStaticInit() { Debug::PreStaticInit(); } +void __attribute__((constructor(65434))) GccPostStaticInit() { Debug::PostStaticInit(); } +void *Debug::PreStatic = nullptr; +void *Debug::PostStatic = nullptr; +#else +#error "Unsupported compiler or platform. This code requires MSVC or GCC/MinGW-w64 targeting Windows." +#endif Debug::LogDescription::LogDescription(const char *fileOrGroup, const char *description) { @@ -253,15 +264,36 @@ Debug::~Debug() // again, do not put any code in here } +#if defined(_MSC_VER) +// MSVC: Use SE Translator static void LocalSETranslator(unsigned, struct _EXCEPTION_POINTERS *pExPtrs) { // simply call our regular exception handler DebugExceptionhandler::ExceptionFilter(pExPtrs); } +#elif defined(__GNUC__) && defined(_WIN32) +// MinGW-w64: Use Vectored Exception Handler (Windows-only) +// Note: VEH is process-wide (unlike MSVC's per-thread _set_se_translator), +// but this matches the existing process-wide SetUnhandledExceptionFilter architecture. +// Returns EXCEPTION_CONTINUE_SEARCH to avoid interfering with normal exception handling. +static LONG WINAPI LocalVectoredExceptionHandler(struct _EXCEPTION_POINTERS *pExPtrs) +{ + // Call our regular exception handler + DebugExceptionhandler::ExceptionFilter(pExPtrs); + return EXCEPTION_CONTINUE_SEARCH; +} +#endif void Debug::InstallExceptionHandler(void) { +#if defined(_MSC_VER) _set_se_translator(LocalSETranslator); +#elif defined(__GNUC__) && defined(_WIN32) + // MinGW-w64 doesn't support _set_se_translator, use Vectored Exception Handler + AddVectoredExceptionHandler(1, LocalVectoredExceptionHandler); +#else + #error "Unsupported compiler for exception handling" +#endif } bool Debug::SkipNext(void) @@ -274,11 +306,23 @@ bool Debug::SkipNext(void) // do not implement this function inline, we do need // a valid frame pointer here! unsigned help; +#if defined(_MSC_VER) _asm { mov eax,[ebp+4] // return address mov help,eax }; +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + // GCC/Clang inline assembly for x86-32 + __asm__ __volatile__( + "mov 4(%%ebp), %0" + : "=r"(help) + : + : "memory" + ); +#else + #error "Unsupported compiler or architecture for inline assembly" +#endif curStackFrame=help; // do we know if to skip the following code? @@ -390,7 +434,13 @@ bool Debug::AssertDone(void) } break; case IDRETRY: +#if defined(_MSC_VER) _asm int 0x03 +#elif defined(__GNUC__) + __builtin_trap(); +#else + #error "Unsupported compiler for breakpoint" +#endif break; default: ((void)0); @@ -658,7 +708,13 @@ bool Debug::CrashDone(bool die) } break; case IDRETRY: +#if defined(_MSC_VER) _asm int 0x03 +#elif defined(__GNUC__) + __builtin_trap(); +#else + #error "Unsupported compiler for breakpoint" +#endif break; default: ((void)0); diff --git a/Core/Libraries/Source/debug/debug_debug.h b/Core/Libraries/Source/debug/debug_debug.h index 02deada8f42..0d50ce32ef1 100644 --- a/Core/Libraries/Source/debug/debug_debug.h +++ b/Core/Libraries/Source/debug/debug_debug.h @@ -731,6 +731,12 @@ DLOG( "My HResult is: " << Debug::HResult(SomeHRESULTValue) << "\n" ); void WriteBuildInfo(void); private: +#if defined(__GNUC__) && defined(_WIN32) + // For GCC/MinGW-w64 targeting Windows, allow constructor functions to call init methods + friend void GccPreStaticInit(); + friend void GccPostStaticInit(); +#endif + // no assignment, no copy constructor Debug(const Debug&); Debug& operator=(const Debug&); diff --git a/Core/Libraries/Source/debug/debug_except.cpp b/Core/Libraries/Source/debug/debug_except.cpp index 49df2d86be5..8a90948733f 100644 --- a/Core/Libraries/Source/debug/debug_except.cpp +++ b/Core/Libraries/Source/debug/debug_except.cpp @@ -172,17 +172,13 @@ void DebugExceptionhandler::LogFPURegisters(Debug &dbg, struct _EXCEPTION_POINTE for (unsigned i=0;i<10;i++) dbg << Debug::Width(2) << value[i]; - double fpVal; + // TheSuperHackers @refactor Replaced MSVC inline assembly with portable C++ cast for MinGW compatibility + // Convert from temporary real (10 byte) to double (8 bytes). + // On x86, long double is the 10-byte x87 format, so we can just cast. + double fpVal = (double)(*(long double*)value); + dbg << " " << fpVal; - // convert from temporary real (10 byte) to double - _asm - { - mov eax,value - fld tbyte ptr [eax] - fstp qword ptr [fpVal] - } - - dbg << " " << fpVal << "\n"; + dbg << "\n"; } dbg << Debug::FillChar() << Debug::Dec(); } diff --git a/Core/Libraries/Source/debug/debug_stack.cpp b/Core/Libraries/Source/debug/debug_stack.cpp index 50016506e1a..71d99058137 100644 --- a/Core/Libraries/Source/debug/debug_stack.cpp +++ b/Core/Libraries/Source/debug/debug_stack.cpp @@ -364,6 +364,7 @@ int DebugStackwalk::StackWalk(Signature &sig, struct _CONTEXT *ctx) { // walk stack back using current call chain unsigned long reg_eip, reg_ebp, reg_esp; +#if defined(_MSC_VER) __asm { here: @@ -372,6 +373,17 @@ int DebugStackwalk::StackWalk(Signature &sig, struct _CONTEXT *ctx) mov reg_ebp,ebp mov reg_esp,esp }; +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + __asm__ __volatile__ ( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%ebp, %1\n\t" + "mov %%esp, %2" + : "=r" (reg_eip), "=r" (reg_ebp), "=r" (reg_esp) + ); +#else +#error "Unsupported compiler or architecture for register capture" +#endif stackFrame.AddrPC.Offset = reg_eip; stackFrame.AddrStack.Offset = reg_esp; stackFrame.AddrFrame.Offset = reg_ebp; diff --git a/Core/Libraries/Source/profile/internal.h b/Core/Libraries/Source/profile/internal.h index 2bfd185182f..9d418018d85 100644 --- a/Core/Libraries/Source/profile/internal.h +++ b/Core/Libraries/Source/profile/internal.h @@ -86,7 +86,7 @@ class ProfileFastCS } #else - volatile std::atomic_flag Flag{}; + std::atomic_flag Flag{}; void ThreadSafeSetFlag() { diff --git a/Core/Libraries/Source/profile/profile_funclevel.cpp b/Core/Libraries/Source/profile/profile_funclevel.cpp index fe5129fe6ae..3e73367dec8 100644 --- a/Core/Libraries/Source/profile/profile_funclevel.cpp +++ b/Core/Libraries/Source/profile/profile_funclevel.cpp @@ -74,7 +74,7 @@ static void __declspec(naked) _pleave(void) } } -extern "C" void __declspec(naked) _cdecl _penter(void) +extern "C" void __declspec(naked) __cdecl _penter(void) { unsigned callerFunc,ESPonReturn,callerRet; ProfileFuncLevelTracer *p; diff --git a/Core/Tools/Autorun/GameText.cpp b/Core/Tools/Autorun/GameText.cpp index 8da8eba308e..d318b87ca1d 100644 --- a/Core/Tools/Autorun/GameText.cpp +++ b/Core/Tools/Autorun/GameText.cpp @@ -174,7 +174,7 @@ class GameTextManager : public GameTextInterface Char readChar( File *file ); }; -static int _cdecl compareLUT ( const void *, const void*); +static int __cdecl compareLUT ( const void *, const void*); //---------------------------------------------------------------------------- // Private Data //---------------------------------------------------------------------------- diff --git a/Generals/Code/Libraries/Include/Lib/BaseType.h b/Generals/Code/Libraries/Include/Lib/BaseType.h index ea7efe1f5ba..73b766ede9a 100644 --- a/Generals/Code/Libraries/Include/Lib/BaseType.h +++ b/Generals/Code/Libraries/Include/Lib/BaseType.h @@ -174,8 +174,8 @@ struct RealRange // both ranges void combine( RealRange &other ) { - lo = min( lo, other.lo ); - hi = max( hi, other.hi ); + lo = MIN( lo, other.lo ); + hi = MAX( hi, other.hi ); } }; diff --git a/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h b/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h index e0a8c74641d..383c2471418 100644 --- a/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h +++ b/GeneralsMD/Code/Libraries/Include/Lib/BaseType.h @@ -174,8 +174,8 @@ struct RealRange // both ranges void combine( RealRange &other ) { - lo = min( lo, other.lo ); - hi = max( hi, other.hi ); + lo = MIN( lo, other.lo ); + hi = MAX( hi, other.hi ); } }; From 8c24b2dd3cd1d74c5bd54e065763da0778a0eb2f Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:29:48 +0000 Subject: [PATCH 11/17] fix(headers): Add missing forward declarations for MinGW (#2067) Add forward declarations for PathfindCell and Anim2DCollection classes to resolve MinGW-w64 compilation errors due to incomplete types. MinGW-w64 is stricter about forward declarations than MSVC, requiring explicit forward declarations for classes used in header files before their first usage. Files modified: - Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h - Generals/Code/GameEngine/Include/GameClient/Anim2D.h - GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h - GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h --- Generals/Code/GameEngine/Include/GameClient/Anim2D.h | 1 + Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h | 3 ++- GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h | 1 + GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Generals/Code/GameEngine/Include/GameClient/Anim2D.h b/Generals/Code/GameEngine/Include/GameClient/Anim2D.h index 8a4770cbe1c..7c1430ff74f 100644 --- a/Generals/Code/GameEngine/Include/GameClient/Anim2D.h +++ b/Generals/Code/GameEngine/Include/GameClient/Anim2D.h @@ -33,6 +33,7 @@ #include "Common/Snapshot.h" // FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// +class Anim2DCollection; class Image; // ------------------------------------------------------------------------------------------------ diff --git a/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h b/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h index a9bd8b2cd77..518bb559d1a 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h +++ b/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h @@ -36,8 +36,9 @@ class Bridge; class Object; -class Weapon; +class PathfindCell; class PathfindZoneManager; +class Weapon; // How close is close enough when moving. diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h index b0f4a2cb3ec..3aca0b43fe0 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Anim2D.h @@ -34,6 +34,7 @@ // FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// class Image; +class Anim2DCollection; // ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h index 89f36104be3..6101c90cc65 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h @@ -39,6 +39,7 @@ class Bridge; class Object; class Weapon; class PathfindZoneManager; +class PathfindCell; // How close is close enough when moving. From 52fa99511646723c8f28f04097a9ac2cd44ed934 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:30:19 +0000 Subject: [PATCH 12/17] fix(linkage): Fix static/extern linkage mismatches for MinGW (#2067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjust function and variable linkage to resolve MinGW-w64 linker errors caused by inconsistent static/extern declarations across translation units. MinGW-w64 is stricter about ODR (One Definition Rule) violations and requires consistent linkage specifications. Changes - Arrays and data: - Eva.cpp: Remove 'static' from TheEvaMessageNames array - Scripts.cpp: Remove 'static' from TheShellHookNames array - PopupPlayerInfo.cpp: Add 'static' to messageBoxYes to match definition Changes - Helper functions: - PartitionManager.cpp: Remove 'static' from hLine* functions Changes - Callback functions: - WOLBuddyOverlay.cpp: Remove 'static' from insertChat() - WOLLobbyMenu.cpp: Remove 'static' from WOL helper functions - W3DMainMenu.cpp: Remove 'static' from menu callback functions - GameWindowTransitionsStyles.cpp: Remove 'static' from transition functions All affected functions/variables are referenced from other translation units and require external linkage to resolve correctly with MinGW-w64. Files modified (8 files × 2 games = 16 total): - Eva.cpp, Scripts.cpp, PartitionManager.cpp, PopupPlayerInfo.cpp - WOLBuddyOverlay.cpp, WOLLobbyMenu.cpp - W3DMainMenu.cpp, GameWindowTransitionsStyles.cpp --- .../Source/W3DDevice/GameClient/W3DView.cpp | 4 +-- .../Code/GameEngine/Source/GameClient/Eva.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 2 +- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 4 +-- .../GUI/GameWindowTransitionsStyles.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 32 +++++++++---------- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 2 +- .../GUI/GUICallbacks/W3DMainMenu.cpp | 2 +- .../Code/GameEngine/Source/GameClient/Eva.cpp | 2 +- .../GUICallbacks/Menus/PopupPlayerInfo.cpp | 2 +- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 2 +- .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 4 +-- .../GUI/GameWindowTransitionsStyles.cpp | 2 +- .../GameLogic/Object/PartitionManager.cpp | 32 +++++++++---------- .../Source/GameLogic/ScriptEngine/Scripts.cpp | 2 +- .../GUI/GUICallbacks/W3DMainMenu.cpp | 2 +- 17 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index aee8d750782..6425c1b56e7 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -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 ) @@ -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 // ------------------------------------------------------------------------------------------------ diff --git a/Generals/Code/GameEngine/Source/GameClient/Eva.cpp b/Generals/Code/GameEngine/Source/GameClient/Eva.cpp index 24870d4ff97..2d2babdfb89 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Eva.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Eva.cpp @@ -35,7 +35,7 @@ //------------------------------------------------------------------------------------------------- -static const char *const TheEvaMessageNames[] = +const char *const TheEvaMessageNames[] = { "LOWPOWER", "INSUFFICIENTFUNDS", diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index dd99652757d..180312fc0cd 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -1318,7 +1318,7 @@ WindowMsgHandledType GameSpyPlayerInfoOverlayInput( GameWindow *window, Unsigned return MSG_IGNORED; } -void messageBoxYes( void ); +static void messageBoxYes( void ); //------------------------------------------------------------------------------------------------- /** Overlay window system callback */ //------------------------------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 59f7ba76f0e..0b5efc26d29 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -341,7 +341,7 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, } -static void insertChat( BuddyMessage msg ) +void insertChat( BuddyMessage msg ) { if (buddyControls.listboxChat) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 903bed54d4d..d3dc6c915fb 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -848,7 +848,7 @@ static const char* getMessageString(Int t) /** refreshGameList The Bool is used to force refresh if the refresh button was hit.*/ //------------------------------------------------------------------------------------------------- -static void refreshGameList( Bool forceRefresh ) +void refreshGameList( Bool forceRefresh ) { Int refreshInterval = gameListRefreshInterval; @@ -871,7 +871,7 @@ static void refreshGameList( Bool forceRefresh ) /** refreshPlayerList The Bool is used to force refresh if the refresh button was hit.*/ //------------------------------------------------------------------------------------------------- -static void refreshPlayerList( Bool forceRefresh ) +void refreshPlayerList( Bool forceRefresh ) { Int refreshInterval = playerListRefreshInterval; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp index 62a048a7778..877d067e21b 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp @@ -65,7 +65,7 @@ //----------------------------------------------------------------------------- // DEFINES //////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- -void drawTypeText( GameWindow *window, DisplayString *str); +static void drawTypeText( GameWindow *window, DisplayString *str); //----------------------------------------------------------------------------- // PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index c13a30bd27b..aa66a273c56 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -328,14 +328,14 @@ inline Real maxReal(Real a, Real b) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms); +void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms); +void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms); +void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms); +void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms); static void projectCoord3D(Coord3D *coord, const Coord3D *unitDir, Real dist); static void flipCoord3D(Coord3D *coord); @@ -5586,7 +5586,7 @@ static int cellValueProc(PartitionCell* cell, void* userData) } // ----------------------------------------------------------------------------- -static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5603,7 +5603,7 @@ static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5620,7 +5620,7 @@ static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5637,7 +5637,7 @@ static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5654,7 +5654,7 @@ static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) +void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5682,7 +5682,7 @@ static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) +void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5710,7 +5710,7 @@ static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) +void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5738,7 +5738,7 @@ static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms) +void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index f66f27dd64e..99469bb8c54 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -75,7 +75,7 @@ static ScriptGroup *s_mtGroup = nullptr; // These strings must be in the same order as they are in their definitions // (See SHELL_SCRIPT_HOOK_* ) // -static const char *const TheShellHookNames[]= +const char *const TheShellHookNames[]= { "ShellMainMenuCampaignPushed", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_SELECTED, "ShellMainMenuCampaignHighlighted", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_HIGHLIGHTED, diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp index 97a88b6295b..0a69e3ee085 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp @@ -778,7 +778,7 @@ void W3DMainMenuButtonDropShadowDraw( GameWindow *window, // drawButtonText ============================================================= /** Draw button text to the screen */ //============================================================================= -static void drawText( GameWindow *window, WinInstanceData *instData ) +void drawText( GameWindow *window, WinInstanceData *instData ) { ICoord2D origin, size, textPos; Int width, height; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp index c03a9ec8559..db60921d19d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp @@ -35,7 +35,7 @@ //------------------------------------------------------------------------------------------------- -static const char *const TheEvaMessageNames[] = +const char *const TheEvaMessageNames[] = { "LOWPOWER", "INSUFFICIENTFUNDS", diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 555b1ac888c..30b6a45dedd 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -1408,7 +1408,7 @@ WindowMsgHandledType GameSpyPlayerInfoOverlayInput( GameWindow *window, Unsigned return MSG_IGNORED; } -void messageBoxYes( void ); +static void messageBoxYes( void ); //------------------------------------------------------------------------------------------------- /** Overlay window system callback */ //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 9634ee67db4..88e4f9a0071 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -341,7 +341,7 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, } -static void insertChat( BuddyMessage msg ) +void insertChat( BuddyMessage msg ) { if (buddyControls.listboxChat) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 6234fcf83d5..ad47750959a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -866,7 +866,7 @@ static const char* getMessageString(Int t) /** refreshGameList The Bool is used to force refresh if the refresh button was hit.*/ //------------------------------------------------------------------------------------------------- -static void refreshGameList( Bool forceRefresh ) +void refreshGameList( Bool forceRefresh ) { Int refreshInterval = gameListRefreshInterval; @@ -889,7 +889,7 @@ static void refreshGameList( Bool forceRefresh ) /** refreshPlayerList The Bool is used to force refresh if the refresh button was hit.*/ //------------------------------------------------------------------------------------------------- -static void refreshPlayerList( Bool forceRefresh ) +void refreshPlayerList( Bool forceRefresh ) { Int refreshInterval = playerListRefreshInterval; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp index 2f749338f93..9e8ea622eb2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowTransitionsStyles.cpp @@ -65,7 +65,7 @@ //----------------------------------------------------------------------------- // DEFINES //////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- -void drawTypeText( GameWindow *window, DisplayString *str); +static void drawTypeText( GameWindow *window, DisplayString *str); //----------------------------------------------------------------------------- // PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// //----------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 36a8adfa1d3..d098d668077 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -332,14 +332,14 @@ inline Real maxReal(Real a, Real b) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); -static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms); -static void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms); +void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid); +void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms); +void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms); +void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms); +void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms); static void projectCoord3D(Coord3D *coord, const Coord3D *unitDir, Real dist); static void flipCoord3D(Coord3D *coord); @@ -5628,7 +5628,7 @@ static int cellValueProc(PartitionCell* cell, void* userData) } // ----------------------------------------------------------------------------- -static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5645,7 +5645,7 @@ static void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5662,7 +5662,7 @@ static void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5679,7 +5679,7 @@ static void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) +void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5696,7 +5696,7 @@ static void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) } // ----------------------------------------------------------------------------- -static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) +void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5724,7 +5724,7 @@ static void hLineAddThreat(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) +void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5752,7 +5752,7 @@ static void hLineRemoveThreat(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) +void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; @@ -5780,7 +5780,7 @@ static void hLineAddValue(Int x1, Int x2, Int y, void *threatValueParms) } // ----------------------------------------------------------------------------- -static void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms) +void hLineRemoveValue(Int x1, Int x2, Int y, void *threatValueParms) { if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index ab4e28f81fd..d1c643c1449 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -76,7 +76,7 @@ static ScriptGroup *s_mtGroup = nullptr; // These strings must be in the same order as they are in their definitions // (See SHELL_SCRIPT_HOOK_* ) // -static const char *const TheShellHookNames[]= +const char *const TheShellHookNames[]= { "ShellMainMenuCampaignPushed", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_SELECTED, "ShellMainMenuCampaignHighlighted", //SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_HIGHLIGHTED, diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp index 51e0b0f76ca..31e89fb6d8d 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DMainMenu.cpp @@ -778,7 +778,7 @@ void W3DMainMenuButtonDropShadowDraw( GameWindow *window, // drawButtonText ============================================================= /** Draw button text to the screen */ //============================================================================= -static void drawText( GameWindow *window, WinInstanceData *instData ) +void drawText( GameWindow *window, WinInstanceData *instData ) { ICoord2D origin, size, textPos; Int width, height; From 7cf48ac7be523e18b64163b8260fccc53852cceb Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:30:45 +0000 Subject: [PATCH 13/17] fix(calling-convention): Standardize calling conventions and variadic macros (#2067) Standardize function calling conventions and variadic macro definitions for MinGW-w64 compatibility. Changes: - Add missing __cdecl to function pointers in GameText.h - Fix VA_ARGS macro definitions to use __VA_ARGS__ properly - Ensure consistent calling conventions across platforms This resolves calling convention mismatches that could cause undefined behavior when crossing DLL boundaries or using variadic macros with MinGW-w64. --- Generals/Code/GameEngine/Include/GameClient/GameText.h | 10 ++++++++-- .../Code/GameEngine/Source/GameClient/GameText.cpp | 2 +- .../Code/GameEngine/Include/GameClient/GameText.h | 10 ++++++++-- .../Code/GameEngine/Source/GameClient/GameText.cpp | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Generals/Code/GameEngine/Include/GameClient/GameText.h b/Generals/Code/GameEngine/Include/GameClient/GameText.h index 11f530de6b7..bf8c94fb88c 100644 --- a/Generals/Code/GameEngine/Include/GameClient/GameText.h +++ b/Generals/Code/GameEngine/Include/GameClient/GameText.h @@ -110,18 +110,24 @@ extern GameTextInterface* CreateGameTextInterface( void ); // TheGameText->FETCH_OR_SUBSTITUTE("GUI:LabelName", L"Substitute Fallback Text") // TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:LabelName", L"Substitute Fallback Text %d %d", 1, 2) // The substitute text will be compiled out if ENABLE_GAMETEXT_SUBSTITUTES is not defined. +// +// Note: ##__VA_ARGS__ handles zero variadic arguments by removing the preceding comma when empty. +// Example: FETCH_OR_SUBSTITUTE_FORMAT("Label", L"Text") expands correctly without trailing comma. +// Without ##, it would expand to fetchOrSubstituteFormat("Label", L"Text",) causing a syntax error. +// This extension is widely supported (GCC, Clang, MSVC 2015+). C++20 __VA_OPT__ is the standard +// alternative, but ##__VA_ARGS__ is simpler and compatible across C++11/14/17/20. #if ENABLE_GAMETEXT_SUBSTITUTES #define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetchOrSubstitute(labelA, substituteTextW) #if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchOrSubstituteFormat(labelA, substituteFormatW, __VA_ARGS__) +#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchOrSubstituteFormat(labelA, substituteFormatW, ##__VA_ARGS__) #endif #else #define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetch(labelA) #if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteTextW, ...) fetchFormat(labelA, __VA_ARGS__) +#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchFormat(labelA, ##__VA_ARGS__) #endif #endif // ENABLE_GAMETEXT_SUBSTITUTES diff --git a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp b/Generals/Code/GameEngine/Source/GameClient/GameText.cpp index 5a374b7d710..e0ecde33a31 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GameText.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GameText.cpp @@ -199,7 +199,7 @@ class GameTextManager : public GameTextInterface Char readChar( File *file ); }; -static int _cdecl compareLUT ( const void *, const void*); +static int __cdecl compareLUT ( const void *, const void*); //---------------------------------------------------------------------------- // Private Data //---------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h index 7dc1f79e041..b7a0012f46d 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h @@ -110,18 +110,24 @@ extern GameTextInterface* CreateGameTextInterface( void ); // TheGameText->FETCH_OR_SUBSTITUTE("GUI:LabelName", L"Substitute Fallback Text") // TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:LabelName", L"Substitute Fallback Text %d %d", 1, 2) // The substitute text will be compiled out if ENABLE_GAMETEXT_SUBSTITUTES is not defined. +// +// Note: ##__VA_ARGS__ handles zero variadic arguments by removing the preceding comma when empty. +// Example: FETCH_OR_SUBSTITUTE_FORMAT("Label", L"Text") expands correctly without trailing comma. +// Without ##, it would expand to fetchOrSubstituteFormat("Label", L"Text",) causing a syntax error. +// This extension is widely supported (GCC, Clang, MSVC 2015+). C++20 __VA_OPT__ is the standard +// alternative, but ##__VA_ARGS__ is simpler and compatible across C++11/14/17/20. #if ENABLE_GAMETEXT_SUBSTITUTES #define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetchOrSubstitute(labelA, substituteTextW) #if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchOrSubstituteFormat(labelA, substituteFormatW, __VA_ARGS__) +#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchOrSubstituteFormat(labelA, substituteFormatW, ##__VA_ARGS__) #endif #else #define FETCH_OR_SUBSTITUTE(labelA, substituteTextW) fetch(labelA) #if __cplusplus >= 201103L // TheSuperHackers @todo Remove condition when abandoning VC6 -#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteTextW, ...) fetchFormat(labelA, __VA_ARGS__) +#define FETCH_OR_SUBSTITUTE_FORMAT(labelA, substituteFormatW, ...) fetchFormat(labelA, ##__VA_ARGS__) #endif #endif // ENABLE_GAMETEXT_SUBSTITUTES diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp index bc7bf2f8dc3..97a2c9d5dfa 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp @@ -199,7 +199,7 @@ class GameTextManager : public GameTextInterface Char readChar( File *file ); }; -static int _cdecl compareLUT ( const void *, const void*); +static int __cdecl compareLUT ( const void *, const void*); //---------------------------------------------------------------------------- // Private Data //---------------------------------------------------------------------------- From cbaa310bbbaff77faceabecdc672517b1ec3bf66 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:31:05 +0000 Subject: [PATCH 14/17] fix(compatibility): Add compiler guards and GCC inline assembly for StackDump (#2067) Add explicit compiler checks and GCC-specific inline assembly implementation for the StackDump function to enable MinGW-w64 support. Changes: - Add #ifdef _MSC_VER guards around MSVC-specific inline assembly - Implement GCC-compatible inline assembly version using __asm__ __volatile__ - Add #error directive for unsupported compilers - Maintain identical functionality across compilers This enables stack dumping functionality to work correctly with both MSVC and MinGW-w64/GCC toolchains. --- .../Source/Common/System/StackDump.cpp | 31 +++++++++++++++++++ .../Source/Common/System/StackDump.cpp | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp index e248d5d6ff3..f3025de863e 100644 --- a/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -69,6 +69,7 @@ void StackDump(void (*callback)(const char*)) DWORD myeip,myesp,myebp; +#if defined(_MSC_VER) _asm { MYEIP1: @@ -79,6 +80,20 @@ _asm mov eax, ebp mov dword ptr [myebp] , eax } +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + // GCC/Clang inline assembly for x86-32 + __asm__ __volatile__( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%esp, %1\n\t" + "mov %%ebp, %2" + : "=r"(myeip), "=r"(myesp), "=r"(myebp) + : + : "memory" + ); +#else + #error "Unsupported compiler or architecture for register capture" +#endif MakeStackTrace(myeip,myesp,myebp, 2, callback); @@ -314,6 +329,7 @@ void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip) gsContext.ContextFlags = CONTEXT_FULL; DWORD myeip,myesp,myebp; +#if defined(_MSC_VER) _asm { MYEIP2: @@ -325,6 +341,21 @@ _asm mov dword ptr [myebp] , eax xor eax,eax } +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + // GCC/Clang inline assembly for x86-32 + __asm__ __volatile__( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%esp, %1\n\t" + "mov %%ebp, %2\n\t" + "xor %%eax, %%eax" + : "=r"(myeip), "=r"(myesp), "=r"(myebp) + : + : "eax", "memory" + ); +#else + #error "Unsupported compiler or architecture for register capture" +#endif memset(&stack_frame, 0, sizeof(STACKFRAME)); stack_frame.AddrPC.Mode = AddrModeFlat; stack_frame.AddrPC.Offset = myeip; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp index 74b0c151670..8bc48639027 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/StackDump.cpp @@ -69,6 +69,7 @@ void StackDump(void (*callback)(const char*)) DWORD myeip,myesp,myebp; +#if defined(_MSC_VER) _asm { MYEIP1: @@ -79,6 +80,20 @@ _asm mov eax, ebp mov dword ptr [myebp] , eax } +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + // GCC/Clang inline assembly for x86-32 + __asm__ __volatile__( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%esp, %1\n\t" + "mov %%ebp, %2" + : "=r"(myeip), "=r"(myesp), "=r"(myebp) + : + : "memory" + ); +#else + #error "Unsupported compiler or architecture for register capture" +#endif MakeStackTrace(myeip,myesp,myebp, 2, callback); @@ -314,6 +329,7 @@ void FillStackAddresses(void**addresses, unsigned int count, unsigned int skip) gsContext.ContextFlags = CONTEXT_FULL; DWORD myeip,myesp,myebp; +#if defined(_MSC_VER) _asm { MYEIP2: @@ -325,6 +341,21 @@ _asm mov dword ptr [myebp] , eax xor eax,eax } +#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(_M_IX86)) + // GCC/Clang inline assembly for x86-32 + __asm__ __volatile__( + "call 1f\n\t" + "1: pop %0\n\t" + "mov %%esp, %1\n\t" + "mov %%ebp, %2\n\t" + "xor %%eax, %%eax" + : "=r"(myeip), "=r"(myesp), "=r"(myebp) + : + : "eax", "memory" + ); +#else + #error "Unsupported compiler or architecture for register capture" +#endif memset(&stack_frame, 0, sizeof(STACKFRAME)); stack_frame.AddrPC.Mode = AddrModeFlat; stack_frame.AddrPC.Offset = myeip; From 34035dc5c1a198bd4f17b81e3b73f9a827ec75d0 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 5 Jan 2026 23:31:55 +0000 Subject: [PATCH 15/17] fix(casts): Add explicit void* casts for function pointers (#2067) Add explicit void* casts to function pointers in function tables and callback registrations to resolve MinGW-w64 type-punning warnings. Changes: 1. FunctionLexicon.cpp: - Cast all GameWindow callback functions to (void*) in: * gameWinDrawTable * gameWinSystemTable * gameWinInputTable * gameWinHelpBoxTable * gameWinTooltipTable 2. W3DFunctionLexicon.cpp: - Cast all W3D callback functions to (void*) in lexicon tables 3. SkirmishGameOptionsMenu.cpp: - Cast aiPlayerControlCallback to (void*) in window registrations MinGW-w64 requires explicit casts when storing function pointers with different signatures in void* fields, as the compiler is stricter about type safety than MSVC in this context. These casts are safe because the functions are later cast back to their correct types before invocation. Files modified: - FunctionLexicon.cpp (both games) - W3DFunctionLexicon.cpp (both games) - SkirmishGameOptionsMenu.cpp (both games) --- .../Source/Common/System/FunctionLexicon.cpp | 508 ++++++++--------- .../Menus/SkirmishGameOptionsMenu.cpp | 2 +- .../Common/System/W3DFunctionLexicon.cpp | 110 ++-- .../Source/Common/System/FunctionLexicon.cpp | 520 +++++++++--------- .../Menus/SkirmishGameOptionsMenu.cpp | 2 +- .../Common/System/W3DFunctionLexicon.cpp | 110 ++-- 6 files changed, 626 insertions(+), 626 deletions(-) diff --git a/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp b/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp index da6d08e0a68..e2ace0aa276 100644 --- a/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp @@ -63,9 +63,9 @@ extern WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, Unsign // game window draw table ----------------------------------------------------------------------- static FunctionLexicon::TableEntry gameWinDrawTable[] = { - { NAMEKEY_INVALID, "IMECandidateMainDraw", IMECandidateMainDraw }, - { NAMEKEY_INVALID, "IMECandidateTextAreaDraw", IMECandidateTextAreaDraw }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "IMECandidateMainDraw", (void*)IMECandidateMainDraw }, + { NAMEKEY_INVALID, "IMECandidateTextAreaDraw", (void*)IMECandidateTextAreaDraw }, + { NAMEKEY_INVALID, nullptr, nullptr } }; // game window system table ----------------------------------------------------------------------- @@ -73,82 +73,82 @@ static FunctionLexicon::TableEntry gameWinSystemTable[] = { - { NAMEKEY_INVALID, "PassSelectedButtonsToParentSystem", PassSelectedButtonsToParentSystem }, - { NAMEKEY_INVALID, "PassMessagesToParentSystem", PassMessagesToParentSystem }, - - { NAMEKEY_INVALID, "GameWinDefaultSystem", GameWinDefaultSystem }, - { NAMEKEY_INVALID, "GadgetPushButtonSystem", GadgetPushButtonSystem }, - { NAMEKEY_INVALID, "GadgetCheckBoxSystem", GadgetCheckBoxSystem }, - { NAMEKEY_INVALID, "GadgetRadioButtonSystem", GadgetRadioButtonSystem }, - { NAMEKEY_INVALID, "GadgetTabControlSystem", GadgetTabControlSystem }, - { NAMEKEY_INVALID, "GadgetListBoxSystem", GadgetListBoxSystem }, - { NAMEKEY_INVALID, "GadgetComboBoxSystem", GadgetComboBoxSystem }, - { NAMEKEY_INVALID, "GadgetHorizontalSliderSystem", GadgetHorizontalSliderSystem }, - { NAMEKEY_INVALID, "GadgetVerticalSliderSystem", GadgetVerticalSliderSystem }, - { NAMEKEY_INVALID, "GadgetProgressBarSystem", GadgetProgressBarSystem }, - { NAMEKEY_INVALID, "GadgetStaticTextSystem", GadgetStaticTextSystem }, - { NAMEKEY_INVALID, "GadgetTextEntrySystem", GadgetTextEntrySystem }, - { NAMEKEY_INVALID, "MessageBoxSystem", MessageBoxSystem }, - { NAMEKEY_INVALID, "QuitMessageBoxSystem", QuitMessageBoxSystem }, - - { NAMEKEY_INVALID, "ExtendedMessageBoxSystem", ExtendedMessageBoxSystem }, - - { NAMEKEY_INVALID, "MOTDSystem", MOTDSystem }, - { NAMEKEY_INVALID, "MainMenuSystem", MainMenuSystem }, - { NAMEKEY_INVALID, "OptionsMenuSystem", OptionsMenuSystem }, - { NAMEKEY_INVALID, "SinglePlayerMenuSystem", SinglePlayerMenuSystem }, - { NAMEKEY_INVALID, "QuitMenuSystem", QuitMenuSystem }, - { NAMEKEY_INVALID, "MapSelectMenuSystem", MapSelectMenuSystem }, - { NAMEKEY_INVALID, "ReplayMenuSystem", ReplayMenuSystem }, - { NAMEKEY_INVALID, "CreditsMenuSystem", CreditsMenuSystem }, - { NAMEKEY_INVALID, "LanLobbyMenuSystem", LanLobbyMenuSystem }, - { NAMEKEY_INVALID, "LanGameOptionsMenuSystem", LanGameOptionsMenuSystem }, - { NAMEKEY_INVALID, "LanMapSelectMenuSystem", LanMapSelectMenuSystem }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuSystem", SkirmishGameOptionsMenuSystem }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuSystem", SkirmishMapSelectMenuSystem }, - { NAMEKEY_INVALID, "SaveLoadMenuSystem", SaveLoadMenuSystem }, - { NAMEKEY_INVALID, "PopupCommunicatorSystem", PopupCommunicatorSystem }, - { NAMEKEY_INVALID, "PopupBuddyNotificationSystem", PopupBuddyNotificationSystem }, - { NAMEKEY_INVALID, "PopupReplaySystem", PopupReplaySystem }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuSystem", KeyboardOptionsMenuSystem }, - { NAMEKEY_INVALID, "WOLLadderScreenSystem", WOLLadderScreenSystem }, - { NAMEKEY_INVALID, "WOLLoginMenuSystem", WOLLoginMenuSystem }, - { NAMEKEY_INVALID, "WOLLocaleSelectSystem", WOLLocaleSelectSystem }, - { NAMEKEY_INVALID, "WOLLobbyMenuSystem", WOLLobbyMenuSystem }, - { NAMEKEY_INVALID, "WOLGameSetupMenuSystem", WOLGameSetupMenuSystem }, - { NAMEKEY_INVALID, "WOLMapSelectMenuSystem", WOLMapSelectMenuSystem }, - { NAMEKEY_INVALID, "WOLBuddyOverlaySystem", WOLBuddyOverlaySystem }, - { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuSystem", WOLBuddyOverlayRCMenuSystem }, - { NAMEKEY_INVALID, "RCGameDetailsMenuSystem", RCGameDetailsMenuSystem }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlaySystem",GameSpyPlayerInfoOverlaySystem }, - { NAMEKEY_INVALID, "WOLMessageWindowSystem", WOLMessageWindowSystem }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuSystem", WOLQuickMatchMenuSystem }, - { NAMEKEY_INVALID, "WOLWelcomeMenuSystem", WOLWelcomeMenuSystem }, - { NAMEKEY_INVALID, "WOLStatusMenuSystem", WOLStatusMenuSystem }, - { NAMEKEY_INVALID, "WOLQMScoreScreenSystem", WOLQMScoreScreenSystem }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenSystem", WOLCustomScoreScreenSystem }, - { NAMEKEY_INVALID, "NetworkDirectConnectSystem", NetworkDirectConnectSystem }, - { NAMEKEY_INVALID, "PopupHostGameSystem", PopupHostGameSystem }, - { NAMEKEY_INVALID, "PopupJoinGameSystem", PopupJoinGameSystem }, - { NAMEKEY_INVALID, "PopupLadderSelectSystem", PopupLadderSelectSystem }, - { NAMEKEY_INVALID, "InGamePopupMessageSystem", InGamePopupMessageSystem }, - { NAMEKEY_INVALID, "ControlBarSystem", ControlBarSystem }, - { NAMEKEY_INVALID, "ControlBarObserverSystem", ControlBarObserverSystem }, - { NAMEKEY_INVALID, "IMECandidateWindowSystem", IMECandidateWindowSystem }, - { NAMEKEY_INVALID, "ReplayControlSystem", ReplayControlSystem }, - { NAMEKEY_INVALID, "InGameChatSystem", InGameChatSystem }, - { NAMEKEY_INVALID, "DisconnectControlSystem", DisconnectControlSystem }, - { NAMEKEY_INVALID, "DiplomacySystem", DiplomacySystem }, - { NAMEKEY_INVALID, "GeneralsExpPointsSystem", GeneralsExpPointsSystem }, - { NAMEKEY_INVALID, "DifficultySelectSystem", DifficultySelectSystem }, - - { NAMEKEY_INVALID, "IdleWorkerSystem", IdleWorkerSystem }, - { NAMEKEY_INVALID, "EstablishConnectionsControlSystem", EstablishConnectionsControlSystem }, - { NAMEKEY_INVALID, "GameInfoWindowSystem", GameInfoWindowSystem }, - { NAMEKEY_INVALID, "ScoreScreenSystem", ScoreScreenSystem }, - { NAMEKEY_INVALID, "DownloadMenuSystem", DownloadMenuSystem }, - - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "PassSelectedButtonsToParentSystem", (void*)PassSelectedButtonsToParentSystem }, + { NAMEKEY_INVALID, "PassMessagesToParentSystem", (void*)PassMessagesToParentSystem }, + + { NAMEKEY_INVALID, "GameWinDefaultSystem", (void*)GameWinDefaultSystem }, + { NAMEKEY_INVALID, "GadgetPushButtonSystem", (void*)GadgetPushButtonSystem }, + { NAMEKEY_INVALID, "GadgetCheckBoxSystem", (void*)GadgetCheckBoxSystem }, + { NAMEKEY_INVALID, "GadgetRadioButtonSystem", (void*)GadgetRadioButtonSystem }, + { NAMEKEY_INVALID, "GadgetTabControlSystem", (void*)GadgetTabControlSystem }, + { NAMEKEY_INVALID, "GadgetListBoxSystem", (void*)GadgetListBoxSystem }, + { NAMEKEY_INVALID, "GadgetComboBoxSystem", (void*)GadgetComboBoxSystem }, + { NAMEKEY_INVALID, "GadgetHorizontalSliderSystem", (void*)GadgetHorizontalSliderSystem }, + { NAMEKEY_INVALID, "GadgetVerticalSliderSystem", (void*)GadgetVerticalSliderSystem }, + { NAMEKEY_INVALID, "GadgetProgressBarSystem", (void*)GadgetProgressBarSystem }, + { NAMEKEY_INVALID, "GadgetStaticTextSystem", (void*)GadgetStaticTextSystem }, + { NAMEKEY_INVALID, "GadgetTextEntrySystem", (void*)GadgetTextEntrySystem }, + { NAMEKEY_INVALID, "MessageBoxSystem", (void*)MessageBoxSystem }, + { NAMEKEY_INVALID, "QuitMessageBoxSystem", (void*)QuitMessageBoxSystem }, + + { NAMEKEY_INVALID, "ExtendedMessageBoxSystem", (void*)ExtendedMessageBoxSystem }, + + { NAMEKEY_INVALID, "MOTDSystem", (void*)MOTDSystem }, + { NAMEKEY_INVALID, "MainMenuSystem", (void*)MainMenuSystem }, + { NAMEKEY_INVALID, "OptionsMenuSystem", (void*)OptionsMenuSystem }, + { NAMEKEY_INVALID, "SinglePlayerMenuSystem", (void*)SinglePlayerMenuSystem }, + { NAMEKEY_INVALID, "QuitMenuSystem", (void*)QuitMenuSystem }, + { NAMEKEY_INVALID, "MapSelectMenuSystem", (void*)MapSelectMenuSystem }, + { NAMEKEY_INVALID, "ReplayMenuSystem", (void*)ReplayMenuSystem }, + { NAMEKEY_INVALID, "CreditsMenuSystem", (void*)CreditsMenuSystem }, + { NAMEKEY_INVALID, "LanLobbyMenuSystem", (void*)LanLobbyMenuSystem }, + { NAMEKEY_INVALID, "LanGameOptionsMenuSystem", (void*)LanGameOptionsMenuSystem }, + { NAMEKEY_INVALID, "LanMapSelectMenuSystem", (void*)LanMapSelectMenuSystem }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuSystem", (void*)SkirmishGameOptionsMenuSystem }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuSystem", (void*)SkirmishMapSelectMenuSystem }, + { NAMEKEY_INVALID, "SaveLoadMenuSystem", (void*)SaveLoadMenuSystem }, + { NAMEKEY_INVALID, "PopupCommunicatorSystem", (void*)PopupCommunicatorSystem }, + { NAMEKEY_INVALID, "PopupBuddyNotificationSystem", (void*)PopupBuddyNotificationSystem }, + { NAMEKEY_INVALID, "PopupReplaySystem", (void*)PopupReplaySystem }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuSystem", (void*)KeyboardOptionsMenuSystem }, + { NAMEKEY_INVALID, "WOLLadderScreenSystem", (void*)WOLLadderScreenSystem }, + { NAMEKEY_INVALID, "WOLLoginMenuSystem", (void*)WOLLoginMenuSystem }, + { NAMEKEY_INVALID, "WOLLocaleSelectSystem", (void*)WOLLocaleSelectSystem }, + { NAMEKEY_INVALID, "WOLLobbyMenuSystem", (void*)WOLLobbyMenuSystem }, + { NAMEKEY_INVALID, "WOLGameSetupMenuSystem", (void*)WOLGameSetupMenuSystem }, + { NAMEKEY_INVALID, "WOLMapSelectMenuSystem", (void*)WOLMapSelectMenuSystem }, + { NAMEKEY_INVALID, "WOLBuddyOverlaySystem", (void*)WOLBuddyOverlaySystem }, + { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuSystem", (void*)WOLBuddyOverlayRCMenuSystem }, + { NAMEKEY_INVALID, "RCGameDetailsMenuSystem", (void*)RCGameDetailsMenuSystem }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlaySystem", (void*)GameSpyPlayerInfoOverlaySystem }, + { NAMEKEY_INVALID, "WOLMessageWindowSystem", (void*)WOLMessageWindowSystem }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuSystem", (void*)WOLQuickMatchMenuSystem }, + { NAMEKEY_INVALID, "WOLWelcomeMenuSystem", (void*)WOLWelcomeMenuSystem }, + { NAMEKEY_INVALID, "WOLStatusMenuSystem", (void*)WOLStatusMenuSystem }, + { NAMEKEY_INVALID, "WOLQMScoreScreenSystem", (void*)WOLQMScoreScreenSystem }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenSystem", (void*)WOLCustomScoreScreenSystem }, + { NAMEKEY_INVALID, "NetworkDirectConnectSystem", (void*)NetworkDirectConnectSystem }, + { NAMEKEY_INVALID, "PopupHostGameSystem", (void*)PopupHostGameSystem }, + { NAMEKEY_INVALID, "PopupJoinGameSystem", (void*)PopupJoinGameSystem }, + { NAMEKEY_INVALID, "PopupLadderSelectSystem", (void*)PopupLadderSelectSystem }, + { NAMEKEY_INVALID, "InGamePopupMessageSystem", (void*)InGamePopupMessageSystem }, + { NAMEKEY_INVALID, "ControlBarSystem", (void*)ControlBarSystem }, + { NAMEKEY_INVALID, "ControlBarObserverSystem", (void*)ControlBarObserverSystem }, + { NAMEKEY_INVALID, "IMECandidateWindowSystem", (void*)IMECandidateWindowSystem }, + { NAMEKEY_INVALID, "ReplayControlSystem", (void*)ReplayControlSystem }, + { NAMEKEY_INVALID, "InGameChatSystem", (void*)InGameChatSystem }, + { NAMEKEY_INVALID, "DisconnectControlSystem", (void*)DisconnectControlSystem }, + { NAMEKEY_INVALID, "DiplomacySystem", (void*)DiplomacySystem }, + { NAMEKEY_INVALID, "GeneralsExpPointsSystem", (void*)GeneralsExpPointsSystem }, + { NAMEKEY_INVALID, "DifficultySelectSystem", (void*)DifficultySelectSystem }, + + { NAMEKEY_INVALID, "IdleWorkerSystem", (void*)IdleWorkerSystem }, + { NAMEKEY_INVALID, "EstablishConnectionsControlSystem", (void*)EstablishConnectionsControlSystem }, + { NAMEKEY_INVALID, "GameInfoWindowSystem", (void*)GameInfoWindowSystem }, + { NAMEKEY_INVALID, "ScoreScreenSystem", (void*)ScoreScreenSystem }, + { NAMEKEY_INVALID, "DownloadMenuSystem", (void*)DownloadMenuSystem }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -156,70 +156,70 @@ static FunctionLexicon::TableEntry gameWinSystemTable[] = static FunctionLexicon::TableEntry gameWinInputTable[] = { - { NAMEKEY_INVALID, "GameWinDefaultInput", GameWinDefaultInput }, - { NAMEKEY_INVALID, "GameWinBlockInput", GameWinBlockInput }, - { NAMEKEY_INVALID, "GadgetPushButtonInput", GadgetPushButtonInput }, - { NAMEKEY_INVALID, "GadgetCheckBoxInput", GadgetCheckBoxInput }, - { NAMEKEY_INVALID, "GadgetRadioButtonInput", GadgetRadioButtonInput }, - { NAMEKEY_INVALID, "GadgetTabControlInput", GadgetTabControlInput }, - { NAMEKEY_INVALID, "GadgetListBoxInput", GadgetListBoxInput }, - { NAMEKEY_INVALID, "GadgetListBoxMultiInput", GadgetListBoxMultiInput }, - { NAMEKEY_INVALID, "GadgetComboBoxInput", GadgetComboBoxInput }, - { NAMEKEY_INVALID, "GadgetHorizontalSliderInput", GadgetHorizontalSliderInput }, - { NAMEKEY_INVALID, "GadgetVerticalSliderInput", GadgetVerticalSliderInput }, - { NAMEKEY_INVALID, "GadgetStaticTextInput", GadgetStaticTextInput }, - { NAMEKEY_INVALID, "GadgetTextEntryInput", GadgetTextEntryInput }, - - { NAMEKEY_INVALID, "MainMenuInput", MainMenuInput }, - { NAMEKEY_INVALID, "MapSelectMenuInput", MapSelectMenuInput }, - { NAMEKEY_INVALID, "OptionsMenuInput", OptionsMenuInput }, - { NAMEKEY_INVALID, "SinglePlayerMenuInput", SinglePlayerMenuInput }, - { NAMEKEY_INVALID, "LanLobbyMenuInput", LanLobbyMenuInput }, - { NAMEKEY_INVALID, "ReplayMenuInput", ReplayMenuInput }, - { NAMEKEY_INVALID, "CreditsMenuInput", CreditsMenuInput }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuInput", KeyboardOptionsMenuInput }, - { NAMEKEY_INVALID, "PopupCommunicatorInput", PopupCommunicatorInput }, - { NAMEKEY_INVALID, "LanGameOptionsMenuInput", LanGameOptionsMenuInput }, - { NAMEKEY_INVALID, "LanMapSelectMenuInput", LanMapSelectMenuInput }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInput", SkirmishGameOptionsMenuInput }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuInput", SkirmishMapSelectMenuInput }, - { NAMEKEY_INVALID, "WOLLadderScreenInput", WOLLadderScreenInput }, - { NAMEKEY_INVALID, "WOLLoginMenuInput", WOLLoginMenuInput }, - { NAMEKEY_INVALID, "WOLLocaleSelectInput", WOLLocaleSelectInput }, - { NAMEKEY_INVALID, "WOLLobbyMenuInput", WOLLobbyMenuInput }, - { NAMEKEY_INVALID, "WOLGameSetupMenuInput", WOLGameSetupMenuInput }, - { NAMEKEY_INVALID, "WOLMapSelectMenuInput", WOLMapSelectMenuInput }, - { NAMEKEY_INVALID, "WOLBuddyOverlayInput", WOLBuddyOverlayInput }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInput", GameSpyPlayerInfoOverlayInput }, - { NAMEKEY_INVALID, "WOLMessageWindowInput", WOLMessageWindowInput }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuInput", WOLQuickMatchMenuInput }, - { NAMEKEY_INVALID, "WOLWelcomeMenuInput", WOLWelcomeMenuInput }, - { NAMEKEY_INVALID, "WOLStatusMenuInput", WOLStatusMenuInput }, - { NAMEKEY_INVALID, "WOLQMScoreScreenInput", WOLQMScoreScreenInput }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenInput", WOLCustomScoreScreenInput }, - { NAMEKEY_INVALID, "NetworkDirectConnectInput", NetworkDirectConnectInput }, - { NAMEKEY_INVALID, "PopupHostGameInput", PopupHostGameInput }, - { NAMEKEY_INVALID, "PopupJoinGameInput", PopupJoinGameInput }, - { NAMEKEY_INVALID, "PopupLadderSelectInput", PopupLadderSelectInput }, - { NAMEKEY_INVALID, "InGamePopupMessageInput", InGamePopupMessageInput }, - { NAMEKEY_INVALID, "ControlBarInput", ControlBarInput }, - { NAMEKEY_INVALID, "ReplayControlInput", ReplayControlInput }, - { NAMEKEY_INVALID, "InGameChatInput", InGameChatInput }, - { NAMEKEY_INVALID, "DisconnectControlInput", DisconnectControlInput }, - { NAMEKEY_INVALID, "DiplomacyInput", DiplomacyInput }, - { NAMEKEY_INVALID, "EstablishConnectionsControlInput", EstablishConnectionsControlInput }, - { NAMEKEY_INVALID, "LeftHUDInput", LeftHUDInput }, - { NAMEKEY_INVALID, "ScoreScreenInput", ScoreScreenInput }, - { NAMEKEY_INVALID, "SaveLoadMenuInput", SaveLoadMenuInput }, - { NAMEKEY_INVALID, "BeaconWindowInput", BeaconWindowInput }, - { NAMEKEY_INVALID, "DifficultySelectInput", DifficultySelectInput }, - { NAMEKEY_INVALID, "PopupReplayInput", PopupReplayInput }, - { NAMEKEY_INVALID, "GeneralsExpPointsInput", GeneralsExpPointsInput}, - - { NAMEKEY_INVALID, "DownloadMenuInput", DownloadMenuInput }, - - { NAMEKEY_INVALID, "IMECandidateWindowInput", IMECandidateWindowInput }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "GameWinDefaultInput", (void*)GameWinDefaultInput }, + { NAMEKEY_INVALID, "GameWinBlockInput", (void*)GameWinBlockInput }, + { NAMEKEY_INVALID, "GadgetPushButtonInput", (void*)GadgetPushButtonInput }, + { NAMEKEY_INVALID, "GadgetCheckBoxInput", (void*)GadgetCheckBoxInput }, + { NAMEKEY_INVALID, "GadgetRadioButtonInput", (void*)GadgetRadioButtonInput }, + { NAMEKEY_INVALID, "GadgetTabControlInput", (void*)GadgetTabControlInput }, + { NAMEKEY_INVALID, "GadgetListBoxInput", (void*)GadgetListBoxInput }, + { NAMEKEY_INVALID, "GadgetListBoxMultiInput", (void*)GadgetListBoxMultiInput }, + { NAMEKEY_INVALID, "GadgetComboBoxInput", (void*)GadgetComboBoxInput }, + { NAMEKEY_INVALID, "GadgetHorizontalSliderInput", (void*)GadgetHorizontalSliderInput }, + { NAMEKEY_INVALID, "GadgetVerticalSliderInput", (void*)GadgetVerticalSliderInput }, + { NAMEKEY_INVALID, "GadgetStaticTextInput", (void*)GadgetStaticTextInput }, + { NAMEKEY_INVALID, "GadgetTextEntryInput", (void*)GadgetTextEntryInput }, + + { NAMEKEY_INVALID, "MainMenuInput", (void*)MainMenuInput }, + { NAMEKEY_INVALID, "MapSelectMenuInput", (void*)MapSelectMenuInput }, + { NAMEKEY_INVALID, "OptionsMenuInput", (void*)OptionsMenuInput }, + { NAMEKEY_INVALID, "SinglePlayerMenuInput", (void*)SinglePlayerMenuInput }, + { NAMEKEY_INVALID, "LanLobbyMenuInput", (void*)LanLobbyMenuInput }, + { NAMEKEY_INVALID, "ReplayMenuInput", (void*)ReplayMenuInput }, + { NAMEKEY_INVALID, "CreditsMenuInput", (void*)CreditsMenuInput }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuInput", (void*)KeyboardOptionsMenuInput }, + { NAMEKEY_INVALID, "PopupCommunicatorInput", (void*)PopupCommunicatorInput }, + { NAMEKEY_INVALID, "LanGameOptionsMenuInput", (void*)LanGameOptionsMenuInput }, + { NAMEKEY_INVALID, "LanMapSelectMenuInput", (void*)LanMapSelectMenuInput }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInput", (void*)SkirmishGameOptionsMenuInput }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuInput", (void*)SkirmishMapSelectMenuInput }, + { NAMEKEY_INVALID, "WOLLadderScreenInput", (void*)WOLLadderScreenInput }, + { NAMEKEY_INVALID, "WOLLoginMenuInput", (void*)WOLLoginMenuInput }, + { NAMEKEY_INVALID, "WOLLocaleSelectInput", (void*)WOLLocaleSelectInput }, + { NAMEKEY_INVALID, "WOLLobbyMenuInput", (void*)WOLLobbyMenuInput }, + { NAMEKEY_INVALID, "WOLGameSetupMenuInput", (void*)WOLGameSetupMenuInput }, + { NAMEKEY_INVALID, "WOLMapSelectMenuInput", (void*)WOLMapSelectMenuInput }, + { NAMEKEY_INVALID, "WOLBuddyOverlayInput", (void*)WOLBuddyOverlayInput }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInput", (void*)GameSpyPlayerInfoOverlayInput }, + { NAMEKEY_INVALID, "WOLMessageWindowInput", (void*)WOLMessageWindowInput }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuInput", (void*)WOLQuickMatchMenuInput }, + { NAMEKEY_INVALID, "WOLWelcomeMenuInput", (void*)WOLWelcomeMenuInput }, + { NAMEKEY_INVALID, "WOLStatusMenuInput", (void*)WOLStatusMenuInput }, + { NAMEKEY_INVALID, "WOLQMScoreScreenInput", (void*)WOLQMScoreScreenInput }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenInput", (void*)WOLCustomScoreScreenInput }, + { NAMEKEY_INVALID, "NetworkDirectConnectInput", (void*)NetworkDirectConnectInput }, + { NAMEKEY_INVALID, "PopupHostGameInput", (void*)PopupHostGameInput }, + { NAMEKEY_INVALID, "PopupJoinGameInput", (void*)PopupJoinGameInput }, + { NAMEKEY_INVALID, "PopupLadderSelectInput", (void*)PopupLadderSelectInput }, + { NAMEKEY_INVALID, "InGamePopupMessageInput", (void*)InGamePopupMessageInput }, + { NAMEKEY_INVALID, "ControlBarInput", (void*)ControlBarInput }, + { NAMEKEY_INVALID, "ReplayControlInput", (void*)ReplayControlInput }, + { NAMEKEY_INVALID, "InGameChatInput", (void*)InGameChatInput }, + { NAMEKEY_INVALID, "DisconnectControlInput", (void*)DisconnectControlInput }, + { NAMEKEY_INVALID, "DiplomacyInput", (void*)DiplomacyInput }, + { NAMEKEY_INVALID, "EstablishConnectionsControlInput", (void*)EstablishConnectionsControlInput }, + { NAMEKEY_INVALID, "LeftHUDInput", (void*)LeftHUDInput }, + { NAMEKEY_INVALID, "ScoreScreenInput", (void*)ScoreScreenInput }, + { NAMEKEY_INVALID, "SaveLoadMenuInput", (void*)SaveLoadMenuInput }, + { NAMEKEY_INVALID, "BeaconWindowInput", (void*)BeaconWindowInput }, + { NAMEKEY_INVALID, "DifficultySelectInput", (void*)DifficultySelectInput }, + { NAMEKEY_INVALID, "PopupReplayInput", (void*)PopupReplayInput }, + { NAMEKEY_INVALID, "GeneralsExpPointsInput", (void*)GeneralsExpPointsInput }, + + { NAMEKEY_INVALID, "DownloadMenuInput", (void*)DownloadMenuInput }, + + { NAMEKEY_INVALID, "IMECandidateWindowInput", (void*)IMECandidateWindowInput }, + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -228,9 +228,9 @@ static FunctionLexicon::TableEntry gameWinTooltipTable[] = { - { NAMEKEY_INVALID, "GameWinDefaultTooltip", GameWinDefaultTooltip }, + { NAMEKEY_INVALID, "GameWinDefaultTooltip", (void*)GameWinDefaultTooltip }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -238,50 +238,50 @@ static FunctionLexicon::TableEntry gameWinTooltipTable[] = static FunctionLexicon::TableEntry winLayoutInitTable[] = { - { NAMEKEY_INVALID, "MainMenuInit", MainMenuInit }, - { NAMEKEY_INVALID, "OptionsMenuInit", OptionsMenuInit }, - { NAMEKEY_INVALID, "SaveLoadMenuInit", SaveLoadMenuInit }, - { NAMEKEY_INVALID, "SaveLoadMenuFullScreenInit", SaveLoadMenuFullScreenInit }, - - { NAMEKEY_INVALID, "PopupCommunicatorInit", PopupCommunicatorInit }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuInit", KeyboardOptionsMenuInit }, - { NAMEKEY_INVALID, "SinglePlayerMenuInit", SinglePlayerMenuInit }, - { NAMEKEY_INVALID, "MapSelectMenuInit", MapSelectMenuInit }, - { NAMEKEY_INVALID, "LanLobbyMenuInit", LanLobbyMenuInit }, - { NAMEKEY_INVALID, "ReplayMenuInit", ReplayMenuInit }, - { NAMEKEY_INVALID, "CreditsMenuInit", CreditsMenuInit }, - { NAMEKEY_INVALID, "LanGameOptionsMenuInit", LanGameOptionsMenuInit }, - { NAMEKEY_INVALID, "LanMapSelectMenuInit", LanMapSelectMenuInit }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInit", SkirmishGameOptionsMenuInit }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuInit", SkirmishMapSelectMenuInit }, - { NAMEKEY_INVALID, "WOLLadderScreenInit", WOLLadderScreenInit }, - { NAMEKEY_INVALID, "WOLLoginMenuInit", WOLLoginMenuInit }, - { NAMEKEY_INVALID, "WOLLocaleSelectInit", WOLLocaleSelectInit }, - { NAMEKEY_INVALID, "WOLLobbyMenuInit", WOLLobbyMenuInit }, - { NAMEKEY_INVALID, "WOLGameSetupMenuInit", WOLGameSetupMenuInit }, - { NAMEKEY_INVALID, "WOLMapSelectMenuInit", WOLMapSelectMenuInit }, - { NAMEKEY_INVALID, "WOLBuddyOverlayInit", WOLBuddyOverlayInit }, - { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuInit", WOLBuddyOverlayRCMenuInit }, - { NAMEKEY_INVALID, "RCGameDetailsMenuInit", RCGameDetailsMenuInit }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInit", GameSpyPlayerInfoOverlayInit }, - { NAMEKEY_INVALID, "WOLMessageWindowInit", WOLMessageWindowInit }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuInit", WOLQuickMatchMenuInit }, - { NAMEKEY_INVALID, "WOLWelcomeMenuInit", WOLWelcomeMenuInit }, - { NAMEKEY_INVALID, "WOLStatusMenuInit", WOLStatusMenuInit }, - { NAMEKEY_INVALID, "WOLQMScoreScreenInit", WOLQMScoreScreenInit }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenInit", WOLCustomScoreScreenInit }, - { NAMEKEY_INVALID, "NetworkDirectConnectInit", NetworkDirectConnectInit }, - { NAMEKEY_INVALID, "PopupHostGameInit", PopupHostGameInit }, - { NAMEKEY_INVALID, "PopupJoinGameInit", PopupJoinGameInit }, - { NAMEKEY_INVALID, "PopupLadderSelectInit", PopupLadderSelectInit }, - { NAMEKEY_INVALID, "InGamePopupMessageInit", InGamePopupMessageInit }, - { NAMEKEY_INVALID, "GameInfoWindowInit", GameInfoWindowInit }, - { NAMEKEY_INVALID, "ScoreScreenInit", ScoreScreenInit }, - { NAMEKEY_INVALID, "DownloadMenuInit", DownloadMenuInit }, - { NAMEKEY_INVALID, "DifficultySelectInit", DifficultySelectInit }, - { NAMEKEY_INVALID, "PopupReplayInit", PopupReplayInit }, - - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuInit", (void*)MainMenuInit }, + { NAMEKEY_INVALID, "OptionsMenuInit", (void*)OptionsMenuInit }, + { NAMEKEY_INVALID, "SaveLoadMenuInit", (void*)SaveLoadMenuInit }, + { NAMEKEY_INVALID, "SaveLoadMenuFullScreenInit", (void*)SaveLoadMenuFullScreenInit }, + + { NAMEKEY_INVALID, "PopupCommunicatorInit", (void*)PopupCommunicatorInit }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuInit", (void*)KeyboardOptionsMenuInit }, + { NAMEKEY_INVALID, "SinglePlayerMenuInit", (void*)SinglePlayerMenuInit }, + { NAMEKEY_INVALID, "MapSelectMenuInit", (void*)MapSelectMenuInit }, + { NAMEKEY_INVALID, "LanLobbyMenuInit", (void*)LanLobbyMenuInit }, + { NAMEKEY_INVALID, "ReplayMenuInit", (void*)ReplayMenuInit }, + { NAMEKEY_INVALID, "CreditsMenuInit", (void*)CreditsMenuInit }, + { NAMEKEY_INVALID, "LanGameOptionsMenuInit", (void*)LanGameOptionsMenuInit }, + { NAMEKEY_INVALID, "LanMapSelectMenuInit", (void*)LanMapSelectMenuInit }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInit", (void*)SkirmishGameOptionsMenuInit }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuInit", (void*)SkirmishMapSelectMenuInit }, + { NAMEKEY_INVALID, "WOLLadderScreenInit", (void*)WOLLadderScreenInit }, + { NAMEKEY_INVALID, "WOLLoginMenuInit", (void*)WOLLoginMenuInit }, + { NAMEKEY_INVALID, "WOLLocaleSelectInit", (void*)WOLLocaleSelectInit }, + { NAMEKEY_INVALID, "WOLLobbyMenuInit", (void*)WOLLobbyMenuInit }, + { NAMEKEY_INVALID, "WOLGameSetupMenuInit", (void*)WOLGameSetupMenuInit }, + { NAMEKEY_INVALID, "WOLMapSelectMenuInit", (void*)WOLMapSelectMenuInit }, + { NAMEKEY_INVALID, "WOLBuddyOverlayInit", (void*)WOLBuddyOverlayInit }, + { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuInit", (void*)WOLBuddyOverlayRCMenuInit }, + { NAMEKEY_INVALID, "RCGameDetailsMenuInit", (void*)RCGameDetailsMenuInit }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInit", (void*)GameSpyPlayerInfoOverlayInit }, + { NAMEKEY_INVALID, "WOLMessageWindowInit", (void*)WOLMessageWindowInit }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuInit", (void*)WOLQuickMatchMenuInit }, + { NAMEKEY_INVALID, "WOLWelcomeMenuInit", (void*)WOLWelcomeMenuInit }, + { NAMEKEY_INVALID, "WOLStatusMenuInit", (void*)WOLStatusMenuInit }, + { NAMEKEY_INVALID, "WOLQMScoreScreenInit", (void*)WOLQMScoreScreenInit }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenInit", (void*)WOLCustomScoreScreenInit }, + { NAMEKEY_INVALID, "NetworkDirectConnectInit", (void*)NetworkDirectConnectInit }, + { NAMEKEY_INVALID, "PopupHostGameInit", (void*)PopupHostGameInit }, + { NAMEKEY_INVALID, "PopupJoinGameInit", (void*)PopupJoinGameInit }, + { NAMEKEY_INVALID, "PopupLadderSelectInit", (void*)PopupLadderSelectInit }, + { NAMEKEY_INVALID, "InGamePopupMessageInit", (void*)InGamePopupMessageInit }, + { NAMEKEY_INVALID, "GameInfoWindowInit", (void*)GameInfoWindowInit }, + { NAMEKEY_INVALID, "ScoreScreenInit", (void*)ScoreScreenInit }, + { NAMEKEY_INVALID, "DownloadMenuInit", (void*)DownloadMenuInit }, + { NAMEKEY_INVALID, "DifficultySelectInit", (void*)DifficultySelectInit }, + { NAMEKEY_INVALID, "PopupReplayInit", (void*)PopupReplayInit }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -289,38 +289,38 @@ static FunctionLexicon::TableEntry winLayoutInitTable[] = static FunctionLexicon::TableEntry winLayoutUpdateTable[] = { - { NAMEKEY_INVALID, "MainMenuUpdate", MainMenuUpdate }, - { NAMEKEY_INVALID, "OptionsMenuUpdate", OptionsMenuUpdate }, - { NAMEKEY_INVALID, "SinglePlayerMenuUpdate", SinglePlayerMenuUpdate }, - { NAMEKEY_INVALID, "MapSelectMenuUpdate", MapSelectMenuUpdate }, - { NAMEKEY_INVALID, "LanLobbyMenuUpdate", LanLobbyMenuUpdate }, - { NAMEKEY_INVALID, "ReplayMenuUpdate", ReplayMenuUpdate }, - { NAMEKEY_INVALID, "SaveLoadMenuUpdate", SaveLoadMenuUpdate }, - - { NAMEKEY_INVALID, "CreditsMenuUpdate", CreditsMenuUpdate }, - { NAMEKEY_INVALID, "LanGameOptionsMenuUpdate", LanGameOptionsMenuUpdate }, - { NAMEKEY_INVALID, "LanMapSelectMenuUpdate", LanMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuUpdate", SkirmishGameOptionsMenuUpdate }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuUpdate", SkirmishMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "WOLLadderScreenUpdate", WOLLadderScreenUpdate }, - { NAMEKEY_INVALID, "WOLLoginMenuUpdate", WOLLoginMenuUpdate }, - { NAMEKEY_INVALID, "WOLLocaleSelectUpdate", WOLLocaleSelectUpdate }, - { NAMEKEY_INVALID, "WOLLobbyMenuUpdate", WOLLobbyMenuUpdate }, - { NAMEKEY_INVALID, "WOLGameSetupMenuUpdate", WOLGameSetupMenuUpdate }, - { NAMEKEY_INVALID, "WOLMapSelectMenuUpdate", WOLMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "WOLBuddyOverlayUpdate", WOLBuddyOverlayUpdate }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayUpdate",GameSpyPlayerInfoOverlayUpdate }, - { NAMEKEY_INVALID, "WOLMessageWindowUpdate", WOLMessageWindowUpdate }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuUpdate", WOLQuickMatchMenuUpdate }, - { NAMEKEY_INVALID, "WOLWelcomeMenuUpdate", WOLWelcomeMenuUpdate }, - { NAMEKEY_INVALID, "WOLStatusMenuUpdate", WOLStatusMenuUpdate }, - { NAMEKEY_INVALID, "WOLQMScoreScreenUpdate", WOLQMScoreScreenUpdate }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenUpdate", WOLCustomScoreScreenUpdate }, - { NAMEKEY_INVALID, "NetworkDirectConnectUpdate", NetworkDirectConnectUpdate }, - { NAMEKEY_INVALID, "ScoreScreenUpdate", ScoreScreenUpdate }, - { NAMEKEY_INVALID, "DownloadMenuUpdate", DownloadMenuUpdate }, - { NAMEKEY_INVALID, "PopupReplayUpdate", PopupReplayUpdate }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuUpdate", (void*)MainMenuUpdate }, + { NAMEKEY_INVALID, "OptionsMenuUpdate", (void*)OptionsMenuUpdate }, + { NAMEKEY_INVALID, "SinglePlayerMenuUpdate", (void*)SinglePlayerMenuUpdate }, + { NAMEKEY_INVALID, "MapSelectMenuUpdate", (void*)MapSelectMenuUpdate }, + { NAMEKEY_INVALID, "LanLobbyMenuUpdate", (void*)LanLobbyMenuUpdate }, + { NAMEKEY_INVALID, "ReplayMenuUpdate", (void*)ReplayMenuUpdate }, + { NAMEKEY_INVALID, "SaveLoadMenuUpdate", (void*)SaveLoadMenuUpdate }, + + { NAMEKEY_INVALID, "CreditsMenuUpdate", (void*)CreditsMenuUpdate }, + { NAMEKEY_INVALID, "LanGameOptionsMenuUpdate", (void*)LanGameOptionsMenuUpdate }, + { NAMEKEY_INVALID, "LanMapSelectMenuUpdate", (void*)LanMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuUpdate", (void*)SkirmishGameOptionsMenuUpdate }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuUpdate", (void*)SkirmishMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "WOLLadderScreenUpdate", (void*)WOLLadderScreenUpdate }, + { NAMEKEY_INVALID, "WOLLoginMenuUpdate", (void*)WOLLoginMenuUpdate }, + { NAMEKEY_INVALID, "WOLLocaleSelectUpdate", (void*)WOLLocaleSelectUpdate }, + { NAMEKEY_INVALID, "WOLLobbyMenuUpdate", (void*)WOLLobbyMenuUpdate }, + { NAMEKEY_INVALID, "WOLGameSetupMenuUpdate", (void*)WOLGameSetupMenuUpdate }, + { NAMEKEY_INVALID, "WOLMapSelectMenuUpdate", (void*)WOLMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "WOLBuddyOverlayUpdate", (void*)WOLBuddyOverlayUpdate }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayUpdate", (void*)GameSpyPlayerInfoOverlayUpdate }, + { NAMEKEY_INVALID, "WOLMessageWindowUpdate", (void*)WOLMessageWindowUpdate }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuUpdate", (void*)WOLQuickMatchMenuUpdate }, + { NAMEKEY_INVALID, "WOLWelcomeMenuUpdate", (void*)WOLWelcomeMenuUpdate }, + { NAMEKEY_INVALID, "WOLStatusMenuUpdate", (void*)WOLStatusMenuUpdate }, + { NAMEKEY_INVALID, "WOLQMScoreScreenUpdate", (void*)WOLQMScoreScreenUpdate }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenUpdate", (void*)WOLCustomScoreScreenUpdate }, + { NAMEKEY_INVALID, "NetworkDirectConnectUpdate", (void*)NetworkDirectConnectUpdate }, + { NAMEKEY_INVALID, "ScoreScreenUpdate", (void*)ScoreScreenUpdate }, + { NAMEKEY_INVALID, "DownloadMenuUpdate", (void*)DownloadMenuUpdate }, + { NAMEKEY_INVALID, "PopupReplayUpdate", (void*)PopupReplayUpdate }, + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -328,39 +328,39 @@ static FunctionLexicon::TableEntry winLayoutUpdateTable[] = static FunctionLexicon::TableEntry winLayoutShutdownTable[] = { - { NAMEKEY_INVALID, "MainMenuShutdown", MainMenuShutdown }, - { NAMEKEY_INVALID, "OptionsMenuShutdown", OptionsMenuShutdown }, - { NAMEKEY_INVALID, "SaveLoadMenuShutdown", SaveLoadMenuShutdown }, - { NAMEKEY_INVALID, "PopupCommunicatorShutdown", PopupCommunicatorShutdown }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuShutdown", KeyboardOptionsMenuShutdown }, - { NAMEKEY_INVALID, "SinglePlayerMenuShutdown", SinglePlayerMenuShutdown }, - { NAMEKEY_INVALID, "MapSelectMenuShutdown", MapSelectMenuShutdown }, - { NAMEKEY_INVALID, "LanLobbyMenuShutdown", LanLobbyMenuShutdown }, - { NAMEKEY_INVALID, "ReplayMenuShutdown", ReplayMenuShutdown }, - { NAMEKEY_INVALID, "CreditsMenuShutdown", CreditsMenuShutdown }, - { NAMEKEY_INVALID, "LanGameOptionsMenuShutdown", LanGameOptionsMenuShutdown }, - { NAMEKEY_INVALID, "LanMapSelectMenuShutdown", LanMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuShutdown",SkirmishGameOptionsMenuShutdown }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuShutdown", SkirmishMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "WOLLadderScreenShutdown", WOLLadderScreenShutdown }, - { NAMEKEY_INVALID, "WOLLoginMenuShutdown", WOLLoginMenuShutdown }, - { NAMEKEY_INVALID, "WOLLocaleSelectShutdown", WOLLocaleSelectShutdown }, - { NAMEKEY_INVALID, "WOLLobbyMenuShutdown", WOLLobbyMenuShutdown }, - { NAMEKEY_INVALID, "WOLGameSetupMenuShutdown", WOLGameSetupMenuShutdown }, - { NAMEKEY_INVALID, "WOLMapSelectMenuShutdown", WOLMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "WOLBuddyOverlayShutdown", WOLBuddyOverlayShutdown }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayShutdown",GameSpyPlayerInfoOverlayShutdown }, - { NAMEKEY_INVALID, "WOLMessageWindowShutdown", WOLMessageWindowShutdown }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuShutdown", WOLQuickMatchMenuShutdown }, - { NAMEKEY_INVALID, "WOLWelcomeMenuShutdown", WOLWelcomeMenuShutdown }, - { NAMEKEY_INVALID, "WOLStatusMenuShutdown", WOLStatusMenuShutdown }, - { NAMEKEY_INVALID, "WOLQMScoreScreenShutdown", WOLQMScoreScreenShutdown }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenShutdown", WOLCustomScoreScreenShutdown }, - { NAMEKEY_INVALID, "NetworkDirectConnectShutdown", NetworkDirectConnectShutdown }, - { NAMEKEY_INVALID, "ScoreScreenShutdown", ScoreScreenShutdown }, - { NAMEKEY_INVALID, "DownloadMenuShutdown", DownloadMenuShutdown }, - { NAMEKEY_INVALID, "PopupReplayShutdown", PopupReplayShutdown }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuShutdown", (void*)MainMenuShutdown }, + { NAMEKEY_INVALID, "OptionsMenuShutdown", (void*)OptionsMenuShutdown }, + { NAMEKEY_INVALID, "SaveLoadMenuShutdown", (void*)SaveLoadMenuShutdown }, + { NAMEKEY_INVALID, "PopupCommunicatorShutdown", (void*)PopupCommunicatorShutdown }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuShutdown", (void*)KeyboardOptionsMenuShutdown }, + { NAMEKEY_INVALID, "SinglePlayerMenuShutdown", (void*)SinglePlayerMenuShutdown }, + { NAMEKEY_INVALID, "MapSelectMenuShutdown", (void*)MapSelectMenuShutdown }, + { NAMEKEY_INVALID, "LanLobbyMenuShutdown", (void*)LanLobbyMenuShutdown }, + { NAMEKEY_INVALID, "ReplayMenuShutdown", (void*)ReplayMenuShutdown }, + { NAMEKEY_INVALID, "CreditsMenuShutdown", (void*)CreditsMenuShutdown }, + { NAMEKEY_INVALID, "LanGameOptionsMenuShutdown", (void*)LanGameOptionsMenuShutdown }, + { NAMEKEY_INVALID, "LanMapSelectMenuShutdown", (void*)LanMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuShutdown", (void*)SkirmishGameOptionsMenuShutdown }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuShutdown", (void*)SkirmishMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "WOLLadderScreenShutdown", (void*)WOLLadderScreenShutdown }, + { NAMEKEY_INVALID, "WOLLoginMenuShutdown", (void*)WOLLoginMenuShutdown }, + { NAMEKEY_INVALID, "WOLLocaleSelectShutdown", (void*)WOLLocaleSelectShutdown }, + { NAMEKEY_INVALID, "WOLLobbyMenuShutdown", (void*)WOLLobbyMenuShutdown }, + { NAMEKEY_INVALID, "WOLGameSetupMenuShutdown", (void*)WOLGameSetupMenuShutdown }, + { NAMEKEY_INVALID, "WOLMapSelectMenuShutdown", (void*)WOLMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "WOLBuddyOverlayShutdown", (void*)WOLBuddyOverlayShutdown }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayShutdown", (void*)GameSpyPlayerInfoOverlayShutdown }, + { NAMEKEY_INVALID, "WOLMessageWindowShutdown", (void*)WOLMessageWindowShutdown }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuShutdown", (void*)WOLQuickMatchMenuShutdown }, + { NAMEKEY_INVALID, "WOLWelcomeMenuShutdown", (void*)WOLWelcomeMenuShutdown }, + { NAMEKEY_INVALID, "WOLStatusMenuShutdown", (void*)WOLStatusMenuShutdown }, + { NAMEKEY_INVALID, "WOLQMScoreScreenShutdown", (void*)WOLQMScoreScreenShutdown }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenShutdown", (void*)WOLCustomScoreScreenShutdown }, + { NAMEKEY_INVALID, "NetworkDirectConnectShutdown", (void*)NetworkDirectConnectShutdown }, + { NAMEKEY_INVALID, "ScoreScreenShutdown", (void*)ScoreScreenShutdown }, + { NAMEKEY_INVALID, "DownloadMenuShutdown", (void*)DownloadMenuShutdown }, + { NAMEKEY_INVALID, "PopupReplayShutdown", (void*)PopupReplayShutdown }, + { NAMEKEY_INVALID, nullptr, nullptr } }; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index c14bf51feab..3cda3f62dee 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -484,7 +484,7 @@ void CheckForCDAtGameStart( gameStartCallback callback ) { // popup a dialog asking for a CD ExMessageBoxOkCancel(TheGameText->fetch("GUI:InsertCDPrompt"), TheGameText->fetch("GUI:InsertCDMessage"), - callback, checkCDCallback, cancelStartBecauseOfNoCD); + (void*)callback, checkCDCallback, cancelStartBecauseOfNoCD); } else { diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp index 2b330295514..f5504ae88cb 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp @@ -43,59 +43,59 @@ static FunctionLexicon::TableEntry gameWinDrawTable [] = { - { NAMEKEY_INVALID, "GameWinDefaultDraw", GameWinDefaultDraw }, - { NAMEKEY_INVALID, "W3DGameWinDefaultDraw", W3DGameWinDefaultDraw }, - - { NAMEKEY_INVALID, "W3DGadgetPushButtonDraw", W3DGadgetPushButtonDraw }, - { NAMEKEY_INVALID, "W3DGadgetPushButtonImageDraw", W3DGadgetPushButtonImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetCheckBoxDraw", W3DGadgetCheckBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetCheckBoxImageDraw", W3DGadgetCheckBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetRadioButtonDraw", W3DGadgetRadioButtonDraw }, - { NAMEKEY_INVALID, "W3DGadgetRadioButtonImageDraw", W3DGadgetRadioButtonImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetTabControlDraw", W3DGadgetTabControlDraw }, - { NAMEKEY_INVALID, "W3DGadgetTabControlImageDraw", W3DGadgetTabControlImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetListBoxDraw", W3DGadgetListBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetListBoxImageDraw", W3DGadgetListBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetComboBoxDraw", W3DGadgetComboBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetComboBoxImageDraw", W3DGadgetComboBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderDraw", W3DGadgetHorizontalSliderDraw }, - { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderImageDraw", W3DGadgetHorizontalSliderImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetVerticalSliderDraw", W3DGadgetVerticalSliderDraw }, - { NAMEKEY_INVALID, "W3DGadgetVerticalSliderImageDraw", W3DGadgetVerticalSliderImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetProgressBarDraw", W3DGadgetProgressBarDraw }, - { NAMEKEY_INVALID, "W3DGadgetProgressBarImageDraw", W3DGadgetProgressBarImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetStaticTextDraw", W3DGadgetStaticTextDraw }, - { NAMEKEY_INVALID, "W3DGadgetStaticTextImageDraw", W3DGadgetStaticTextImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetTextEntryDraw", W3DGadgetTextEntryDraw }, - { NAMEKEY_INVALID, "W3DGadgetTextEntryImageDraw", W3DGadgetTextEntryImageDraw }, - - { NAMEKEY_INVALID, "W3DLeftHUDDraw", W3DLeftHUDDraw }, - { NAMEKEY_INVALID, "W3DCameoMovieDraw", W3DCameoMovieDraw }, - { NAMEKEY_INVALID, "W3DRightHUDDraw", W3DRightHUDDraw }, - { NAMEKEY_INVALID, "W3DPowerDraw", W3DPowerDraw }, - { NAMEKEY_INVALID, "W3DMainMenuDraw", W3DMainMenuDraw }, - { NAMEKEY_INVALID, "W3DMainMenuFourDraw", W3DMainMenuFourDraw }, - { NAMEKEY_INVALID, "W3DMetalBarMenuDraw", W3DMetalBarMenuDraw }, - { NAMEKEY_INVALID, "W3DCreditsMenuDraw", W3DCreditsMenuDraw }, - { NAMEKEY_INVALID, "W3DClockDraw", W3DClockDraw }, - { NAMEKEY_INVALID, "W3DMainMenuMapBorder", W3DMainMenuMapBorder }, - { NAMEKEY_INVALID, "W3DMainMenuButtonDropShadowDraw", W3DMainMenuButtonDropShadowDraw }, - { NAMEKEY_INVALID, "W3DMainMenuRandomTextDraw", W3DMainMenuRandomTextDraw }, - { NAMEKEY_INVALID, "W3DThinBorderDraw", W3DThinBorderDraw }, - { NAMEKEY_INVALID, "W3DShellMenuSchemeDraw", W3DShellMenuSchemeDraw }, - { NAMEKEY_INVALID, "W3DCommandBarBackgroundDraw", W3DCommandBarBackgroundDraw }, - { NAMEKEY_INVALID, "W3DCommandBarTopDraw", W3DCommandBarTopDraw }, - { NAMEKEY_INVALID, "W3DCommandBarGenExpDraw", W3DCommandBarGenExpDraw }, - { NAMEKEY_INVALID, "W3DCommandBarHelpPopupDraw", W3DCommandBarHelpPopupDraw }, - - { NAMEKEY_INVALID, "W3DCommandBarGridDraw", W3DCommandBarGridDraw }, - - - { NAMEKEY_INVALID, "W3DCommandBarForegroundDraw", W3DCommandBarForegroundDraw }, - { NAMEKEY_INVALID, "W3DNoDraw", W3DNoDraw }, - { NAMEKEY_INVALID, "W3DDrawMapPreview", W3DDrawMapPreview }, - - { NAMEKEY_INVALID, nullptr, nullptr }, + { NAMEKEY_INVALID, "GameWinDefaultDraw", (void*)GameWinDefaultDraw }, + { NAMEKEY_INVALID, "W3DGameWinDefaultDraw", (void*)W3DGameWinDefaultDraw }, + + { NAMEKEY_INVALID, "W3DGadgetPushButtonDraw", (void*)W3DGadgetPushButtonDraw }, + { NAMEKEY_INVALID, "W3DGadgetPushButtonImageDraw", (void*)W3DGadgetPushButtonImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetCheckBoxDraw", (void*)W3DGadgetCheckBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetCheckBoxImageDraw", (void*)W3DGadgetCheckBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetRadioButtonDraw", (void*)W3DGadgetRadioButtonDraw }, + { NAMEKEY_INVALID, "W3DGadgetRadioButtonImageDraw", (void*)W3DGadgetRadioButtonImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetTabControlDraw", (void*)W3DGadgetTabControlDraw }, + { NAMEKEY_INVALID, "W3DGadgetTabControlImageDraw", (void*)W3DGadgetTabControlImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetListBoxDraw", (void*)W3DGadgetListBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetListBoxImageDraw", (void*)W3DGadgetListBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetComboBoxDraw", (void*)W3DGadgetComboBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetComboBoxImageDraw", (void*)W3DGadgetComboBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderDraw", (void*)W3DGadgetHorizontalSliderDraw }, + { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderImageDraw", (void*)W3DGadgetHorizontalSliderImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetVerticalSliderDraw", (void*)W3DGadgetVerticalSliderDraw }, + { NAMEKEY_INVALID, "W3DGadgetVerticalSliderImageDraw", (void*)W3DGadgetVerticalSliderImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetProgressBarDraw", (void*)W3DGadgetProgressBarDraw }, + { NAMEKEY_INVALID, "W3DGadgetProgressBarImageDraw", (void*)W3DGadgetProgressBarImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetStaticTextDraw", (void*)W3DGadgetStaticTextDraw }, + { NAMEKEY_INVALID, "W3DGadgetStaticTextImageDraw", (void*)W3DGadgetStaticTextImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetTextEntryDraw", (void*)W3DGadgetTextEntryDraw }, + { NAMEKEY_INVALID, "W3DGadgetTextEntryImageDraw", (void*)W3DGadgetTextEntryImageDraw }, + + { NAMEKEY_INVALID, "W3DLeftHUDDraw", (void*)W3DLeftHUDDraw }, + { NAMEKEY_INVALID, "W3DCameoMovieDraw", (void*)W3DCameoMovieDraw }, + { NAMEKEY_INVALID, "W3DRightHUDDraw", (void*)W3DRightHUDDraw }, + { NAMEKEY_INVALID, "W3DPowerDraw", (void*)W3DPowerDraw }, + { NAMEKEY_INVALID, "W3DMainMenuDraw", (void*)W3DMainMenuDraw }, + { NAMEKEY_INVALID, "W3DMainMenuFourDraw", (void*)W3DMainMenuFourDraw }, + { NAMEKEY_INVALID, "W3DMetalBarMenuDraw", (void*)W3DMetalBarMenuDraw }, + { NAMEKEY_INVALID, "W3DCreditsMenuDraw", (void*)W3DCreditsMenuDraw }, + { NAMEKEY_INVALID, "W3DClockDraw", (void*)W3DClockDraw }, + { NAMEKEY_INVALID, "W3DMainMenuMapBorder", (void*)W3DMainMenuMapBorder }, + { NAMEKEY_INVALID, "W3DMainMenuButtonDropShadowDraw", (void*)W3DMainMenuButtonDropShadowDraw }, + { NAMEKEY_INVALID, "W3DMainMenuRandomTextDraw", (void*)W3DMainMenuRandomTextDraw }, + { NAMEKEY_INVALID, "W3DThinBorderDraw", (void*)W3DThinBorderDraw }, + { NAMEKEY_INVALID, "W3DShellMenuSchemeDraw", (void*)W3DShellMenuSchemeDraw }, + { NAMEKEY_INVALID, "W3DCommandBarBackgroundDraw", (void*)W3DCommandBarBackgroundDraw }, + { NAMEKEY_INVALID, "W3DCommandBarTopDraw", (void*)W3DCommandBarTopDraw }, + { NAMEKEY_INVALID, "W3DCommandBarGenExpDraw", (void*)W3DCommandBarGenExpDraw }, + { NAMEKEY_INVALID, "W3DCommandBarHelpPopupDraw", (void*)W3DCommandBarHelpPopupDraw }, + + { NAMEKEY_INVALID, "W3DCommandBarGridDraw", (void*)W3DCommandBarGridDraw }, + + + { NAMEKEY_INVALID, "W3DCommandBarForegroundDraw", (void*)W3DCommandBarForegroundDraw }, + { NAMEKEY_INVALID, "W3DNoDraw", (void*)W3DNoDraw }, + { NAMEKEY_INVALID, "W3DDrawMapPreview", (void*)W3DDrawMapPreview }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -103,9 +103,9 @@ static FunctionLexicon::TableEntry gameWinDrawTable [] = static FunctionLexicon::TableEntry layoutInitTable [] = { - { NAMEKEY_INVALID, "W3DMainMenuInit", W3DMainMenuInit }, + { NAMEKEY_INVALID, "W3DMainMenuInit", (void*)W3DMainMenuInit }, - { NAMEKEY_INVALID, nullptr, nullptr }, + { NAMEKEY_INVALID, nullptr, nullptr } }; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp index c269e5316fd..a64d9bc7c39 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp @@ -63,9 +63,9 @@ extern WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, Unsign // game window draw table ----------------------------------------------------------------------- static FunctionLexicon::TableEntry gameWinDrawTable[] = { - { NAMEKEY_INVALID, "IMECandidateMainDraw", IMECandidateMainDraw }, - { NAMEKEY_INVALID, "IMECandidateTextAreaDraw", IMECandidateTextAreaDraw }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "IMECandidateMainDraw", (void*)IMECandidateMainDraw }, + { NAMEKEY_INVALID, "IMECandidateTextAreaDraw", (void*)IMECandidateTextAreaDraw }, + { NAMEKEY_INVALID, nullptr, nullptr } }; // game window system table ----------------------------------------------------------------------- @@ -73,83 +73,83 @@ static FunctionLexicon::TableEntry gameWinSystemTable[] = { - { NAMEKEY_INVALID, "PassSelectedButtonsToParentSystem", PassSelectedButtonsToParentSystem }, - { NAMEKEY_INVALID, "PassMessagesToParentSystem", PassMessagesToParentSystem }, - - { NAMEKEY_INVALID, "GameWinDefaultSystem", GameWinDefaultSystem }, - { NAMEKEY_INVALID, "GadgetPushButtonSystem", GadgetPushButtonSystem }, - { NAMEKEY_INVALID, "GadgetCheckBoxSystem", GadgetCheckBoxSystem }, - { NAMEKEY_INVALID, "GadgetRadioButtonSystem", GadgetRadioButtonSystem }, - { NAMEKEY_INVALID, "GadgetTabControlSystem", GadgetTabControlSystem }, - { NAMEKEY_INVALID, "GadgetListBoxSystem", GadgetListBoxSystem }, - { NAMEKEY_INVALID, "GadgetComboBoxSystem", GadgetComboBoxSystem }, - { NAMEKEY_INVALID, "GadgetHorizontalSliderSystem", GadgetHorizontalSliderSystem }, - { NAMEKEY_INVALID, "GadgetVerticalSliderSystem", GadgetVerticalSliderSystem }, - { NAMEKEY_INVALID, "GadgetProgressBarSystem", GadgetProgressBarSystem }, - { NAMEKEY_INVALID, "GadgetStaticTextSystem", GadgetStaticTextSystem }, - { NAMEKEY_INVALID, "GadgetTextEntrySystem", GadgetTextEntrySystem }, - { NAMEKEY_INVALID, "MessageBoxSystem", MessageBoxSystem }, - { NAMEKEY_INVALID, "QuitMessageBoxSystem", QuitMessageBoxSystem }, - - { NAMEKEY_INVALID, "ExtendedMessageBoxSystem", ExtendedMessageBoxSystem }, - - { NAMEKEY_INVALID, "MOTDSystem", MOTDSystem }, - { NAMEKEY_INVALID, "MainMenuSystem", MainMenuSystem }, - { NAMEKEY_INVALID, "OptionsMenuSystem", OptionsMenuSystem }, - { NAMEKEY_INVALID, "SinglePlayerMenuSystem", SinglePlayerMenuSystem }, - { NAMEKEY_INVALID, "QuitMenuSystem", QuitMenuSystem }, - { NAMEKEY_INVALID, "MapSelectMenuSystem", MapSelectMenuSystem }, - { NAMEKEY_INVALID, "ReplayMenuSystem", ReplayMenuSystem }, - { NAMEKEY_INVALID, "CreditsMenuSystem", CreditsMenuSystem }, - { NAMEKEY_INVALID, "LanLobbyMenuSystem", LanLobbyMenuSystem }, - { NAMEKEY_INVALID, "LanGameOptionsMenuSystem", LanGameOptionsMenuSystem }, - { NAMEKEY_INVALID, "LanMapSelectMenuSystem", LanMapSelectMenuSystem }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuSystem", SkirmishGameOptionsMenuSystem }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuSystem", SkirmishMapSelectMenuSystem }, - { NAMEKEY_INVALID, "ChallengeMenuSystem", ChallengeMenuSystem }, - { NAMEKEY_INVALID, "SaveLoadMenuSystem", SaveLoadMenuSystem }, - { NAMEKEY_INVALID, "PopupCommunicatorSystem", PopupCommunicatorSystem }, - { NAMEKEY_INVALID, "PopupBuddyNotificationSystem", PopupBuddyNotificationSystem }, - { NAMEKEY_INVALID, "PopupReplaySystem", PopupReplaySystem }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuSystem", KeyboardOptionsMenuSystem }, - { NAMEKEY_INVALID, "WOLLadderScreenSystem", WOLLadderScreenSystem }, - { NAMEKEY_INVALID, "WOLLoginMenuSystem", WOLLoginMenuSystem }, - { NAMEKEY_INVALID, "WOLLocaleSelectSystem", WOLLocaleSelectSystem }, - { NAMEKEY_INVALID, "WOLLobbyMenuSystem", WOLLobbyMenuSystem }, - { NAMEKEY_INVALID, "WOLGameSetupMenuSystem", WOLGameSetupMenuSystem }, - { NAMEKEY_INVALID, "WOLMapSelectMenuSystem", WOLMapSelectMenuSystem }, - { NAMEKEY_INVALID, "WOLBuddyOverlaySystem", WOLBuddyOverlaySystem }, - { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuSystem", WOLBuddyOverlayRCMenuSystem }, - { NAMEKEY_INVALID, "RCGameDetailsMenuSystem", RCGameDetailsMenuSystem }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlaySystem",GameSpyPlayerInfoOverlaySystem }, - { NAMEKEY_INVALID, "WOLMessageWindowSystem", WOLMessageWindowSystem }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuSystem", WOLQuickMatchMenuSystem }, - { NAMEKEY_INVALID, "WOLWelcomeMenuSystem", WOLWelcomeMenuSystem }, - { NAMEKEY_INVALID, "WOLStatusMenuSystem", WOLStatusMenuSystem }, - { NAMEKEY_INVALID, "WOLQMScoreScreenSystem", WOLQMScoreScreenSystem }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenSystem", WOLCustomScoreScreenSystem }, - { NAMEKEY_INVALID, "NetworkDirectConnectSystem", NetworkDirectConnectSystem }, - { NAMEKEY_INVALID, "PopupHostGameSystem", PopupHostGameSystem }, - { NAMEKEY_INVALID, "PopupJoinGameSystem", PopupJoinGameSystem }, - { NAMEKEY_INVALID, "PopupLadderSelectSystem", PopupLadderSelectSystem }, - { NAMEKEY_INVALID, "InGamePopupMessageSystem", InGamePopupMessageSystem }, - { NAMEKEY_INVALID, "ControlBarSystem", ControlBarSystem }, - { NAMEKEY_INVALID, "ControlBarObserverSystem", ControlBarObserverSystem }, - { NAMEKEY_INVALID, "IMECandidateWindowSystem", IMECandidateWindowSystem }, - { NAMEKEY_INVALID, "ReplayControlSystem", ReplayControlSystem }, - { NAMEKEY_INVALID, "InGameChatSystem", InGameChatSystem }, - { NAMEKEY_INVALID, "DisconnectControlSystem", DisconnectControlSystem }, - { NAMEKEY_INVALID, "DiplomacySystem", DiplomacySystem }, - { NAMEKEY_INVALID, "GeneralsExpPointsSystem", GeneralsExpPointsSystem }, - { NAMEKEY_INVALID, "DifficultySelectSystem", DifficultySelectSystem }, - - { NAMEKEY_INVALID, "IdleWorkerSystem", IdleWorkerSystem }, - { NAMEKEY_INVALID, "EstablishConnectionsControlSystem", EstablishConnectionsControlSystem }, - { NAMEKEY_INVALID, "GameInfoWindowSystem", GameInfoWindowSystem }, - { NAMEKEY_INVALID, "ScoreScreenSystem", ScoreScreenSystem }, - { NAMEKEY_INVALID, "DownloadMenuSystem", DownloadMenuSystem }, - - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "PassSelectedButtonsToParentSystem", (void*)PassSelectedButtonsToParentSystem }, + { NAMEKEY_INVALID, "PassMessagesToParentSystem", (void*)PassMessagesToParentSystem }, + + { NAMEKEY_INVALID, "GameWinDefaultSystem", (void*)GameWinDefaultSystem }, + { NAMEKEY_INVALID, "GadgetPushButtonSystem", (void*)GadgetPushButtonSystem }, + { NAMEKEY_INVALID, "GadgetCheckBoxSystem", (void*)GadgetCheckBoxSystem }, + { NAMEKEY_INVALID, "GadgetRadioButtonSystem", (void*)GadgetRadioButtonSystem }, + { NAMEKEY_INVALID, "GadgetTabControlSystem", (void*)GadgetTabControlSystem }, + { NAMEKEY_INVALID, "GadgetListBoxSystem", (void*)GadgetListBoxSystem }, + { NAMEKEY_INVALID, "GadgetComboBoxSystem", (void*)GadgetComboBoxSystem }, + { NAMEKEY_INVALID, "GadgetHorizontalSliderSystem", (void*)GadgetHorizontalSliderSystem }, + { NAMEKEY_INVALID, "GadgetVerticalSliderSystem", (void*)GadgetVerticalSliderSystem }, + { NAMEKEY_INVALID, "GadgetProgressBarSystem", (void*)GadgetProgressBarSystem }, + { NAMEKEY_INVALID, "GadgetStaticTextSystem", (void*)GadgetStaticTextSystem }, + { NAMEKEY_INVALID, "GadgetTextEntrySystem", (void*)GadgetTextEntrySystem }, + { NAMEKEY_INVALID, "MessageBoxSystem", (void*)MessageBoxSystem }, + { NAMEKEY_INVALID, "QuitMessageBoxSystem", (void*)QuitMessageBoxSystem }, + + { NAMEKEY_INVALID, "ExtendedMessageBoxSystem", (void*)ExtendedMessageBoxSystem }, + + { NAMEKEY_INVALID, "MOTDSystem", (void*)MOTDSystem }, + { NAMEKEY_INVALID, "MainMenuSystem", (void*)MainMenuSystem }, + { NAMEKEY_INVALID, "OptionsMenuSystem", (void*)OptionsMenuSystem }, + { NAMEKEY_INVALID, "SinglePlayerMenuSystem", (void*)SinglePlayerMenuSystem }, + { NAMEKEY_INVALID, "QuitMenuSystem", (void*)QuitMenuSystem }, + { NAMEKEY_INVALID, "MapSelectMenuSystem", (void*)MapSelectMenuSystem }, + { NAMEKEY_INVALID, "ReplayMenuSystem", (void*)ReplayMenuSystem }, + { NAMEKEY_INVALID, "CreditsMenuSystem", (void*)CreditsMenuSystem }, + { NAMEKEY_INVALID, "LanLobbyMenuSystem", (void*)LanLobbyMenuSystem }, + { NAMEKEY_INVALID, "LanGameOptionsMenuSystem", (void*)LanGameOptionsMenuSystem }, + { NAMEKEY_INVALID, "LanMapSelectMenuSystem", (void*)LanMapSelectMenuSystem }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuSystem", (void*)SkirmishGameOptionsMenuSystem }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuSystem", (void*)SkirmishMapSelectMenuSystem }, + { NAMEKEY_INVALID, "ChallengeMenuSystem", (void*)ChallengeMenuSystem }, + { NAMEKEY_INVALID, "SaveLoadMenuSystem", (void*)SaveLoadMenuSystem }, + { NAMEKEY_INVALID, "PopupCommunicatorSystem", (void*)PopupCommunicatorSystem }, + { NAMEKEY_INVALID, "PopupBuddyNotificationSystem", (void*)PopupBuddyNotificationSystem }, + { NAMEKEY_INVALID, "PopupReplaySystem", (void*)PopupReplaySystem }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuSystem", (void*)KeyboardOptionsMenuSystem }, + { NAMEKEY_INVALID, "WOLLadderScreenSystem", (void*)WOLLadderScreenSystem }, + { NAMEKEY_INVALID, "WOLLoginMenuSystem", (void*)WOLLoginMenuSystem }, + { NAMEKEY_INVALID, "WOLLocaleSelectSystem", (void*)WOLLocaleSelectSystem }, + { NAMEKEY_INVALID, "WOLLobbyMenuSystem", (void*)WOLLobbyMenuSystem }, + { NAMEKEY_INVALID, "WOLGameSetupMenuSystem", (void*)WOLGameSetupMenuSystem }, + { NAMEKEY_INVALID, "WOLMapSelectMenuSystem", (void*)WOLMapSelectMenuSystem }, + { NAMEKEY_INVALID, "WOLBuddyOverlaySystem", (void*)WOLBuddyOverlaySystem }, + { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuSystem", (void*)WOLBuddyOverlayRCMenuSystem }, + { NAMEKEY_INVALID, "RCGameDetailsMenuSystem", (void*)RCGameDetailsMenuSystem }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlaySystem", (void*)GameSpyPlayerInfoOverlaySystem }, + { NAMEKEY_INVALID, "WOLMessageWindowSystem", (void*)WOLMessageWindowSystem }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuSystem", (void*)WOLQuickMatchMenuSystem }, + { NAMEKEY_INVALID, "WOLWelcomeMenuSystem", (void*)WOLWelcomeMenuSystem }, + { NAMEKEY_INVALID, "WOLStatusMenuSystem", (void*)WOLStatusMenuSystem }, + { NAMEKEY_INVALID, "WOLQMScoreScreenSystem", (void*)WOLQMScoreScreenSystem }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenSystem", (void*)WOLCustomScoreScreenSystem }, + { NAMEKEY_INVALID, "NetworkDirectConnectSystem", (void*)NetworkDirectConnectSystem }, + { NAMEKEY_INVALID, "PopupHostGameSystem", (void*)PopupHostGameSystem }, + { NAMEKEY_INVALID, "PopupJoinGameSystem", (void*)PopupJoinGameSystem }, + { NAMEKEY_INVALID, "PopupLadderSelectSystem", (void*)PopupLadderSelectSystem }, + { NAMEKEY_INVALID, "InGamePopupMessageSystem", (void*)InGamePopupMessageSystem }, + { NAMEKEY_INVALID, "ControlBarSystem", (void*)ControlBarSystem }, + { NAMEKEY_INVALID, "ControlBarObserverSystem", (void*)ControlBarObserverSystem }, + { NAMEKEY_INVALID, "IMECandidateWindowSystem", (void*)IMECandidateWindowSystem }, + { NAMEKEY_INVALID, "ReplayControlSystem", (void*)ReplayControlSystem }, + { NAMEKEY_INVALID, "InGameChatSystem", (void*)InGameChatSystem }, + { NAMEKEY_INVALID, "DisconnectControlSystem", (void*)DisconnectControlSystem }, + { NAMEKEY_INVALID, "DiplomacySystem", (void*)DiplomacySystem }, + { NAMEKEY_INVALID, "GeneralsExpPointsSystem", (void*)GeneralsExpPointsSystem }, + { NAMEKEY_INVALID, "DifficultySelectSystem", (void*)DifficultySelectSystem }, + + { NAMEKEY_INVALID, "IdleWorkerSystem", (void*)IdleWorkerSystem }, + { NAMEKEY_INVALID, "EstablishConnectionsControlSystem", (void*)EstablishConnectionsControlSystem }, + { NAMEKEY_INVALID, "GameInfoWindowSystem", (void*)GameInfoWindowSystem }, + { NAMEKEY_INVALID, "ScoreScreenSystem", (void*)ScoreScreenSystem }, + { NAMEKEY_INVALID, "DownloadMenuSystem", (void*)DownloadMenuSystem }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -157,71 +157,71 @@ static FunctionLexicon::TableEntry gameWinSystemTable[] = static FunctionLexicon::TableEntry gameWinInputTable[] = { - { NAMEKEY_INVALID, "GameWinDefaultInput", GameWinDefaultInput }, - { NAMEKEY_INVALID, "GameWinBlockInput", GameWinBlockInput }, - { NAMEKEY_INVALID, "GadgetPushButtonInput", GadgetPushButtonInput }, - { NAMEKEY_INVALID, "GadgetCheckBoxInput", GadgetCheckBoxInput }, - { NAMEKEY_INVALID, "GadgetRadioButtonInput", GadgetRadioButtonInput }, - { NAMEKEY_INVALID, "GadgetTabControlInput", GadgetTabControlInput }, - { NAMEKEY_INVALID, "GadgetListBoxInput", GadgetListBoxInput }, - { NAMEKEY_INVALID, "GadgetListBoxMultiInput", GadgetListBoxMultiInput }, - { NAMEKEY_INVALID, "GadgetComboBoxInput", GadgetComboBoxInput }, - { NAMEKEY_INVALID, "GadgetHorizontalSliderInput", GadgetHorizontalSliderInput }, - { NAMEKEY_INVALID, "GadgetVerticalSliderInput", GadgetVerticalSliderInput }, - { NAMEKEY_INVALID, "GadgetStaticTextInput", GadgetStaticTextInput }, - { NAMEKEY_INVALID, "GadgetTextEntryInput", GadgetTextEntryInput }, - - { NAMEKEY_INVALID, "MainMenuInput", MainMenuInput }, - { NAMEKEY_INVALID, "MapSelectMenuInput", MapSelectMenuInput }, - { NAMEKEY_INVALID, "OptionsMenuInput", OptionsMenuInput }, - { NAMEKEY_INVALID, "SinglePlayerMenuInput", SinglePlayerMenuInput }, - { NAMEKEY_INVALID, "LanLobbyMenuInput", LanLobbyMenuInput }, - { NAMEKEY_INVALID, "ReplayMenuInput", ReplayMenuInput }, - { NAMEKEY_INVALID, "CreditsMenuInput", CreditsMenuInput }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuInput", KeyboardOptionsMenuInput }, - { NAMEKEY_INVALID, "PopupCommunicatorInput", PopupCommunicatorInput }, - { NAMEKEY_INVALID, "LanGameOptionsMenuInput", LanGameOptionsMenuInput }, - { NAMEKEY_INVALID, "LanMapSelectMenuInput", LanMapSelectMenuInput }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInput", SkirmishGameOptionsMenuInput }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuInput", SkirmishMapSelectMenuInput }, - { NAMEKEY_INVALID, "ChallengeMenuInput", ChallengeMenuInput }, - { NAMEKEY_INVALID, "WOLLadderScreenInput", WOLLadderScreenInput }, - { NAMEKEY_INVALID, "WOLLoginMenuInput", WOLLoginMenuInput }, - { NAMEKEY_INVALID, "WOLLocaleSelectInput", WOLLocaleSelectInput }, - { NAMEKEY_INVALID, "WOLLobbyMenuInput", WOLLobbyMenuInput }, - { NAMEKEY_INVALID, "WOLGameSetupMenuInput", WOLGameSetupMenuInput }, - { NAMEKEY_INVALID, "WOLMapSelectMenuInput", WOLMapSelectMenuInput }, - { NAMEKEY_INVALID, "WOLBuddyOverlayInput", WOLBuddyOverlayInput }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInput", GameSpyPlayerInfoOverlayInput }, - { NAMEKEY_INVALID, "WOLMessageWindowInput", WOLMessageWindowInput }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuInput", WOLQuickMatchMenuInput }, - { NAMEKEY_INVALID, "WOLWelcomeMenuInput", WOLWelcomeMenuInput }, - { NAMEKEY_INVALID, "WOLStatusMenuInput", WOLStatusMenuInput }, - { NAMEKEY_INVALID, "WOLQMScoreScreenInput", WOLQMScoreScreenInput }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenInput", WOLCustomScoreScreenInput }, - { NAMEKEY_INVALID, "NetworkDirectConnectInput", NetworkDirectConnectInput }, - { NAMEKEY_INVALID, "PopupHostGameInput", PopupHostGameInput }, - { NAMEKEY_INVALID, "PopupJoinGameInput", PopupJoinGameInput }, - { NAMEKEY_INVALID, "PopupLadderSelectInput", PopupLadderSelectInput }, - { NAMEKEY_INVALID, "InGamePopupMessageInput", InGamePopupMessageInput }, - { NAMEKEY_INVALID, "ControlBarInput", ControlBarInput }, - { NAMEKEY_INVALID, "ReplayControlInput", ReplayControlInput }, - { NAMEKEY_INVALID, "InGameChatInput", InGameChatInput }, - { NAMEKEY_INVALID, "DisconnectControlInput", DisconnectControlInput }, - { NAMEKEY_INVALID, "DiplomacyInput", DiplomacyInput }, - { NAMEKEY_INVALID, "EstablishConnectionsControlInput", EstablishConnectionsControlInput }, - { NAMEKEY_INVALID, "LeftHUDInput", LeftHUDInput }, - { NAMEKEY_INVALID, "ScoreScreenInput", ScoreScreenInput }, - { NAMEKEY_INVALID, "SaveLoadMenuInput", SaveLoadMenuInput }, - { NAMEKEY_INVALID, "BeaconWindowInput", BeaconWindowInput }, - { NAMEKEY_INVALID, "DifficultySelectInput", DifficultySelectInput }, - { NAMEKEY_INVALID, "PopupReplayInput", PopupReplayInput }, - { NAMEKEY_INVALID, "GeneralsExpPointsInput", GeneralsExpPointsInput}, - - { NAMEKEY_INVALID, "DownloadMenuInput", DownloadMenuInput }, - - { NAMEKEY_INVALID, "IMECandidateWindowInput", IMECandidateWindowInput }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "GameWinDefaultInput", (void*)GameWinDefaultInput }, + { NAMEKEY_INVALID, "GameWinBlockInput", (void*)GameWinBlockInput }, + { NAMEKEY_INVALID, "GadgetPushButtonInput", (void*)GadgetPushButtonInput }, + { NAMEKEY_INVALID, "GadgetCheckBoxInput", (void*)GadgetCheckBoxInput }, + { NAMEKEY_INVALID, "GadgetRadioButtonInput", (void*)GadgetRadioButtonInput }, + { NAMEKEY_INVALID, "GadgetTabControlInput", (void*)GadgetTabControlInput }, + { NAMEKEY_INVALID, "GadgetListBoxInput", (void*)GadgetListBoxInput }, + { NAMEKEY_INVALID, "GadgetListBoxMultiInput", (void*)GadgetListBoxMultiInput }, + { NAMEKEY_INVALID, "GadgetComboBoxInput", (void*)GadgetComboBoxInput }, + { NAMEKEY_INVALID, "GadgetHorizontalSliderInput", (void*)GadgetHorizontalSliderInput }, + { NAMEKEY_INVALID, "GadgetVerticalSliderInput", (void*)GadgetVerticalSliderInput }, + { NAMEKEY_INVALID, "GadgetStaticTextInput", (void*)GadgetStaticTextInput }, + { NAMEKEY_INVALID, "GadgetTextEntryInput", (void*)GadgetTextEntryInput }, + + { NAMEKEY_INVALID, "MainMenuInput", (void*)MainMenuInput }, + { NAMEKEY_INVALID, "MapSelectMenuInput", (void*)MapSelectMenuInput }, + { NAMEKEY_INVALID, "OptionsMenuInput", (void*)OptionsMenuInput }, + { NAMEKEY_INVALID, "SinglePlayerMenuInput", (void*)SinglePlayerMenuInput }, + { NAMEKEY_INVALID, "LanLobbyMenuInput", (void*)LanLobbyMenuInput }, + { NAMEKEY_INVALID, "ReplayMenuInput", (void*)ReplayMenuInput }, + { NAMEKEY_INVALID, "CreditsMenuInput", (void*)CreditsMenuInput }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuInput", (void*)KeyboardOptionsMenuInput }, + { NAMEKEY_INVALID, "PopupCommunicatorInput", (void*)PopupCommunicatorInput }, + { NAMEKEY_INVALID, "LanGameOptionsMenuInput", (void*)LanGameOptionsMenuInput }, + { NAMEKEY_INVALID, "LanMapSelectMenuInput", (void*)LanMapSelectMenuInput }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInput", (void*)SkirmishGameOptionsMenuInput }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuInput", (void*)SkirmishMapSelectMenuInput }, + { NAMEKEY_INVALID, "ChallengeMenuInput", (void*)ChallengeMenuInput }, + { NAMEKEY_INVALID, "WOLLadderScreenInput", (void*)WOLLadderScreenInput }, + { NAMEKEY_INVALID, "WOLLoginMenuInput", (void*)WOLLoginMenuInput }, + { NAMEKEY_INVALID, "WOLLocaleSelectInput", (void*)WOLLocaleSelectInput }, + { NAMEKEY_INVALID, "WOLLobbyMenuInput", (void*)WOLLobbyMenuInput }, + { NAMEKEY_INVALID, "WOLGameSetupMenuInput", (void*)WOLGameSetupMenuInput }, + { NAMEKEY_INVALID, "WOLMapSelectMenuInput", (void*)WOLMapSelectMenuInput }, + { NAMEKEY_INVALID, "WOLBuddyOverlayInput", (void*)WOLBuddyOverlayInput }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInput", (void*)GameSpyPlayerInfoOverlayInput }, + { NAMEKEY_INVALID, "WOLMessageWindowInput", (void*)WOLMessageWindowInput }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuInput", (void*)WOLQuickMatchMenuInput }, + { NAMEKEY_INVALID, "WOLWelcomeMenuInput", (void*)WOLWelcomeMenuInput }, + { NAMEKEY_INVALID, "WOLStatusMenuInput", (void*)WOLStatusMenuInput }, + { NAMEKEY_INVALID, "WOLQMScoreScreenInput", (void*)WOLQMScoreScreenInput }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenInput", (void*)WOLCustomScoreScreenInput }, + { NAMEKEY_INVALID, "NetworkDirectConnectInput", (void*)NetworkDirectConnectInput }, + { NAMEKEY_INVALID, "PopupHostGameInput", (void*)PopupHostGameInput }, + { NAMEKEY_INVALID, "PopupJoinGameInput", (void*)PopupJoinGameInput }, + { NAMEKEY_INVALID, "PopupLadderSelectInput", (void*)PopupLadderSelectInput }, + { NAMEKEY_INVALID, "InGamePopupMessageInput", (void*)InGamePopupMessageInput }, + { NAMEKEY_INVALID, "ControlBarInput", (void*)ControlBarInput }, + { NAMEKEY_INVALID, "ReplayControlInput", (void*)ReplayControlInput }, + { NAMEKEY_INVALID, "InGameChatInput", (void*)InGameChatInput }, + { NAMEKEY_INVALID, "DisconnectControlInput", (void*)DisconnectControlInput }, + { NAMEKEY_INVALID, "DiplomacyInput", (void*)DiplomacyInput }, + { NAMEKEY_INVALID, "EstablishConnectionsControlInput", (void*)EstablishConnectionsControlInput }, + { NAMEKEY_INVALID, "LeftHUDInput", (void*)LeftHUDInput }, + { NAMEKEY_INVALID, "ScoreScreenInput", (void*)ScoreScreenInput }, + { NAMEKEY_INVALID, "SaveLoadMenuInput", (void*)SaveLoadMenuInput }, + { NAMEKEY_INVALID, "BeaconWindowInput", (void*)BeaconWindowInput }, + { NAMEKEY_INVALID, "DifficultySelectInput", (void*)DifficultySelectInput }, + { NAMEKEY_INVALID, "PopupReplayInput", (void*)PopupReplayInput }, + { NAMEKEY_INVALID, "GeneralsExpPointsInput", (void*)GeneralsExpPointsInput }, + + { NAMEKEY_INVALID, "DownloadMenuInput", (void*)DownloadMenuInput }, + + { NAMEKEY_INVALID, "IMECandidateWindowInput", (void*)IMECandidateWindowInput }, + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -230,9 +230,9 @@ static FunctionLexicon::TableEntry gameWinTooltipTable[] = { - { NAMEKEY_INVALID, "GameWinDefaultTooltip", GameWinDefaultTooltip }, + { NAMEKEY_INVALID, "GameWinDefaultTooltip", (void*)GameWinDefaultTooltip }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -240,51 +240,51 @@ static FunctionLexicon::TableEntry gameWinTooltipTable[] = static FunctionLexicon::TableEntry winLayoutInitTable[] = { - { NAMEKEY_INVALID, "MainMenuInit", MainMenuInit }, - { NAMEKEY_INVALID, "OptionsMenuInit", OptionsMenuInit }, - { NAMEKEY_INVALID, "SaveLoadMenuInit", SaveLoadMenuInit }, - { NAMEKEY_INVALID, "SaveLoadMenuFullScreenInit", SaveLoadMenuFullScreenInit }, - - { NAMEKEY_INVALID, "PopupCommunicatorInit", PopupCommunicatorInit }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuInit", KeyboardOptionsMenuInit }, - { NAMEKEY_INVALID, "SinglePlayerMenuInit", SinglePlayerMenuInit }, - { NAMEKEY_INVALID, "MapSelectMenuInit", MapSelectMenuInit }, - { NAMEKEY_INVALID, "LanLobbyMenuInit", LanLobbyMenuInit }, - { NAMEKEY_INVALID, "ReplayMenuInit", ReplayMenuInit }, - { NAMEKEY_INVALID, "CreditsMenuInit", CreditsMenuInit }, - { NAMEKEY_INVALID, "LanGameOptionsMenuInit", LanGameOptionsMenuInit }, - { NAMEKEY_INVALID, "LanMapSelectMenuInit", LanMapSelectMenuInit }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInit", SkirmishGameOptionsMenuInit }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuInit", SkirmishMapSelectMenuInit }, - { NAMEKEY_INVALID, "ChallengeMenuInit", ChallengeMenuInit }, - { NAMEKEY_INVALID, "WOLLadderScreenInit", WOLLadderScreenInit }, - { NAMEKEY_INVALID, "WOLLoginMenuInit", WOLLoginMenuInit }, - { NAMEKEY_INVALID, "WOLLocaleSelectInit", WOLLocaleSelectInit }, - { NAMEKEY_INVALID, "WOLLobbyMenuInit", WOLLobbyMenuInit }, - { NAMEKEY_INVALID, "WOLGameSetupMenuInit", WOLGameSetupMenuInit }, - { NAMEKEY_INVALID, "WOLMapSelectMenuInit", WOLMapSelectMenuInit }, - { NAMEKEY_INVALID, "WOLBuddyOverlayInit", WOLBuddyOverlayInit }, - { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuInit", WOLBuddyOverlayRCMenuInit }, - { NAMEKEY_INVALID, "RCGameDetailsMenuInit", RCGameDetailsMenuInit }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInit", GameSpyPlayerInfoOverlayInit }, - { NAMEKEY_INVALID, "WOLMessageWindowInit", WOLMessageWindowInit }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuInit", WOLQuickMatchMenuInit }, - { NAMEKEY_INVALID, "WOLWelcomeMenuInit", WOLWelcomeMenuInit }, - { NAMEKEY_INVALID, "WOLStatusMenuInit", WOLStatusMenuInit }, - { NAMEKEY_INVALID, "WOLQMScoreScreenInit", WOLQMScoreScreenInit }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenInit", WOLCustomScoreScreenInit }, - { NAMEKEY_INVALID, "NetworkDirectConnectInit", NetworkDirectConnectInit }, - { NAMEKEY_INVALID, "PopupHostGameInit", PopupHostGameInit }, - { NAMEKEY_INVALID, "PopupJoinGameInit", PopupJoinGameInit }, - { NAMEKEY_INVALID, "PopupLadderSelectInit", PopupLadderSelectInit }, - { NAMEKEY_INVALID, "InGamePopupMessageInit", InGamePopupMessageInit }, - { NAMEKEY_INVALID, "GameInfoWindowInit", GameInfoWindowInit }, - { NAMEKEY_INVALID, "ScoreScreenInit", ScoreScreenInit }, - { NAMEKEY_INVALID, "DownloadMenuInit", DownloadMenuInit }, - { NAMEKEY_INVALID, "DifficultySelectInit", DifficultySelectInit }, - { NAMEKEY_INVALID, "PopupReplayInit", PopupReplayInit }, - - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuInit", (void*)MainMenuInit }, + { NAMEKEY_INVALID, "OptionsMenuInit", (void*)OptionsMenuInit }, + { NAMEKEY_INVALID, "SaveLoadMenuInit", (void*)SaveLoadMenuInit }, + { NAMEKEY_INVALID, "SaveLoadMenuFullScreenInit", (void*)SaveLoadMenuFullScreenInit }, + + { NAMEKEY_INVALID, "PopupCommunicatorInit", (void*)PopupCommunicatorInit }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuInit", (void*)KeyboardOptionsMenuInit }, + { NAMEKEY_INVALID, "SinglePlayerMenuInit", (void*)SinglePlayerMenuInit }, + { NAMEKEY_INVALID, "MapSelectMenuInit", (void*)MapSelectMenuInit }, + { NAMEKEY_INVALID, "LanLobbyMenuInit", (void*)LanLobbyMenuInit }, + { NAMEKEY_INVALID, "ReplayMenuInit", (void*)ReplayMenuInit }, + { NAMEKEY_INVALID, "CreditsMenuInit", (void*)CreditsMenuInit }, + { NAMEKEY_INVALID, "LanGameOptionsMenuInit", (void*)LanGameOptionsMenuInit }, + { NAMEKEY_INVALID, "LanMapSelectMenuInit", (void*)LanMapSelectMenuInit }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuInit", (void*)SkirmishGameOptionsMenuInit }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuInit", (void*)SkirmishMapSelectMenuInit }, + { NAMEKEY_INVALID, "ChallengeMenuInit", (void*)ChallengeMenuInit }, + { NAMEKEY_INVALID, "WOLLadderScreenInit", (void*)WOLLadderScreenInit }, + { NAMEKEY_INVALID, "WOLLoginMenuInit", (void*)WOLLoginMenuInit }, + { NAMEKEY_INVALID, "WOLLocaleSelectInit", (void*)WOLLocaleSelectInit }, + { NAMEKEY_INVALID, "WOLLobbyMenuInit", (void*)WOLLobbyMenuInit }, + { NAMEKEY_INVALID, "WOLGameSetupMenuInit", (void*)WOLGameSetupMenuInit }, + { NAMEKEY_INVALID, "WOLMapSelectMenuInit", (void*)WOLMapSelectMenuInit }, + { NAMEKEY_INVALID, "WOLBuddyOverlayInit", (void*)WOLBuddyOverlayInit }, + { NAMEKEY_INVALID, "WOLBuddyOverlayRCMenuInit", (void*)WOLBuddyOverlayRCMenuInit }, + { NAMEKEY_INVALID, "RCGameDetailsMenuInit", (void*)RCGameDetailsMenuInit }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayInit", (void*)GameSpyPlayerInfoOverlayInit }, + { NAMEKEY_INVALID, "WOLMessageWindowInit", (void*)WOLMessageWindowInit }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuInit", (void*)WOLQuickMatchMenuInit }, + { NAMEKEY_INVALID, "WOLWelcomeMenuInit", (void*)WOLWelcomeMenuInit }, + { NAMEKEY_INVALID, "WOLStatusMenuInit", (void*)WOLStatusMenuInit }, + { NAMEKEY_INVALID, "WOLQMScoreScreenInit", (void*)WOLQMScoreScreenInit }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenInit", (void*)WOLCustomScoreScreenInit }, + { NAMEKEY_INVALID, "NetworkDirectConnectInit", (void*)NetworkDirectConnectInit }, + { NAMEKEY_INVALID, "PopupHostGameInit", (void*)PopupHostGameInit }, + { NAMEKEY_INVALID, "PopupJoinGameInit", (void*)PopupJoinGameInit }, + { NAMEKEY_INVALID, "PopupLadderSelectInit", (void*)PopupLadderSelectInit }, + { NAMEKEY_INVALID, "InGamePopupMessageInit", (void*)InGamePopupMessageInit }, + { NAMEKEY_INVALID, "GameInfoWindowInit", (void*)GameInfoWindowInit }, + { NAMEKEY_INVALID, "ScoreScreenInit", (void*)ScoreScreenInit }, + { NAMEKEY_INVALID, "DownloadMenuInit", (void*)DownloadMenuInit }, + { NAMEKEY_INVALID, "DifficultySelectInit", (void*)DifficultySelectInit }, + { NAMEKEY_INVALID, "PopupReplayInit", (void*)PopupReplayInit }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -292,40 +292,40 @@ static FunctionLexicon::TableEntry winLayoutInitTable[] = static FunctionLexicon::TableEntry winLayoutUpdateTable[] = { - { NAMEKEY_INVALID, "MainMenuUpdate", MainMenuUpdate }, - { NAMEKEY_INVALID, "OptionsMenuUpdate", OptionsMenuUpdate }, - { NAMEKEY_INVALID, "SinglePlayerMenuUpdate", SinglePlayerMenuUpdate }, - { NAMEKEY_INVALID, "MapSelectMenuUpdate", MapSelectMenuUpdate }, - { NAMEKEY_INVALID, "LanLobbyMenuUpdate", LanLobbyMenuUpdate }, - { NAMEKEY_INVALID, "ReplayMenuUpdate", ReplayMenuUpdate }, - { NAMEKEY_INVALID, "SaveLoadMenuUpdate", SaveLoadMenuUpdate }, - - { NAMEKEY_INVALID, "CreditsMenuUpdate", CreditsMenuUpdate }, - { NAMEKEY_INVALID, "LanGameOptionsMenuUpdate", LanGameOptionsMenuUpdate }, - { NAMEKEY_INVALID, "LanMapSelectMenuUpdate", LanMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuUpdate", SkirmishGameOptionsMenuUpdate }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuUpdate", SkirmishMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "ChallengeMenuUpdate", ChallengeMenuUpdate }, - { NAMEKEY_INVALID, "WOLLadderScreenUpdate", WOLLadderScreenUpdate }, - { NAMEKEY_INVALID, "WOLLoginMenuUpdate", WOLLoginMenuUpdate }, - { NAMEKEY_INVALID, "WOLLocaleSelectUpdate", WOLLocaleSelectUpdate }, - { NAMEKEY_INVALID, "WOLLobbyMenuUpdate", WOLLobbyMenuUpdate }, - { NAMEKEY_INVALID, "WOLGameSetupMenuUpdate", WOLGameSetupMenuUpdate }, - { NAMEKEY_INVALID, "PopupHostGameUpdate", PopupHostGameUpdate }, - { NAMEKEY_INVALID, "WOLMapSelectMenuUpdate", WOLMapSelectMenuUpdate }, - { NAMEKEY_INVALID, "WOLBuddyOverlayUpdate", WOLBuddyOverlayUpdate }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayUpdate",GameSpyPlayerInfoOverlayUpdate }, - { NAMEKEY_INVALID, "WOLMessageWindowUpdate", WOLMessageWindowUpdate }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuUpdate", WOLQuickMatchMenuUpdate }, - { NAMEKEY_INVALID, "WOLWelcomeMenuUpdate", WOLWelcomeMenuUpdate }, - { NAMEKEY_INVALID, "WOLStatusMenuUpdate", WOLStatusMenuUpdate }, - { NAMEKEY_INVALID, "WOLQMScoreScreenUpdate", WOLQMScoreScreenUpdate }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenUpdate", WOLCustomScoreScreenUpdate }, - { NAMEKEY_INVALID, "NetworkDirectConnectUpdate", NetworkDirectConnectUpdate }, - { NAMEKEY_INVALID, "ScoreScreenUpdate", ScoreScreenUpdate }, - { NAMEKEY_INVALID, "DownloadMenuUpdate", DownloadMenuUpdate }, - { NAMEKEY_INVALID, "PopupReplayUpdate", PopupReplayUpdate }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuUpdate", (void*)MainMenuUpdate }, + { NAMEKEY_INVALID, "OptionsMenuUpdate", (void*)OptionsMenuUpdate }, + { NAMEKEY_INVALID, "SinglePlayerMenuUpdate", (void*)SinglePlayerMenuUpdate }, + { NAMEKEY_INVALID, "MapSelectMenuUpdate", (void*)MapSelectMenuUpdate }, + { NAMEKEY_INVALID, "LanLobbyMenuUpdate", (void*)LanLobbyMenuUpdate }, + { NAMEKEY_INVALID, "ReplayMenuUpdate", (void*)ReplayMenuUpdate }, + { NAMEKEY_INVALID, "SaveLoadMenuUpdate", (void*)SaveLoadMenuUpdate }, + + { NAMEKEY_INVALID, "CreditsMenuUpdate", (void*)CreditsMenuUpdate }, + { NAMEKEY_INVALID, "LanGameOptionsMenuUpdate", (void*)LanGameOptionsMenuUpdate }, + { NAMEKEY_INVALID, "LanMapSelectMenuUpdate", (void*)LanMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuUpdate", (void*)SkirmishGameOptionsMenuUpdate }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuUpdate", (void*)SkirmishMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "ChallengeMenuUpdate", (void*)ChallengeMenuUpdate }, + { NAMEKEY_INVALID, "WOLLadderScreenUpdate", (void*)WOLLadderScreenUpdate }, + { NAMEKEY_INVALID, "WOLLoginMenuUpdate", (void*)WOLLoginMenuUpdate }, + { NAMEKEY_INVALID, "WOLLocaleSelectUpdate", (void*)WOLLocaleSelectUpdate }, + { NAMEKEY_INVALID, "WOLLobbyMenuUpdate", (void*)WOLLobbyMenuUpdate }, + { NAMEKEY_INVALID, "WOLGameSetupMenuUpdate", (void*)WOLGameSetupMenuUpdate }, + { NAMEKEY_INVALID, "PopupHostGameUpdate", (void*)PopupHostGameUpdate }, + { NAMEKEY_INVALID, "WOLMapSelectMenuUpdate", (void*)WOLMapSelectMenuUpdate }, + { NAMEKEY_INVALID, "WOLBuddyOverlayUpdate", (void*)WOLBuddyOverlayUpdate }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayUpdate", (void*)GameSpyPlayerInfoOverlayUpdate }, + { NAMEKEY_INVALID, "WOLMessageWindowUpdate", (void*)WOLMessageWindowUpdate }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuUpdate", (void*)WOLQuickMatchMenuUpdate }, + { NAMEKEY_INVALID, "WOLWelcomeMenuUpdate", (void*)WOLWelcomeMenuUpdate }, + { NAMEKEY_INVALID, "WOLStatusMenuUpdate", (void*)WOLStatusMenuUpdate }, + { NAMEKEY_INVALID, "WOLQMScoreScreenUpdate", (void*)WOLQMScoreScreenUpdate }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenUpdate", (void*)WOLCustomScoreScreenUpdate }, + { NAMEKEY_INVALID, "NetworkDirectConnectUpdate", (void*)NetworkDirectConnectUpdate }, + { NAMEKEY_INVALID, "ScoreScreenUpdate", (void*)ScoreScreenUpdate }, + { NAMEKEY_INVALID, "DownloadMenuUpdate", (void*)DownloadMenuUpdate }, + { NAMEKEY_INVALID, "PopupReplayUpdate", (void*)PopupReplayUpdate }, + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -333,40 +333,40 @@ static FunctionLexicon::TableEntry winLayoutUpdateTable[] = static FunctionLexicon::TableEntry winLayoutShutdownTable[] = { - { NAMEKEY_INVALID, "MainMenuShutdown", MainMenuShutdown }, - { NAMEKEY_INVALID, "OptionsMenuShutdown", OptionsMenuShutdown }, - { NAMEKEY_INVALID, "SaveLoadMenuShutdown", SaveLoadMenuShutdown }, - { NAMEKEY_INVALID, "PopupCommunicatorShutdown", PopupCommunicatorShutdown }, - { NAMEKEY_INVALID, "KeyboardOptionsMenuShutdown", KeyboardOptionsMenuShutdown }, - { NAMEKEY_INVALID, "SinglePlayerMenuShutdown", SinglePlayerMenuShutdown }, - { NAMEKEY_INVALID, "MapSelectMenuShutdown", MapSelectMenuShutdown }, - { NAMEKEY_INVALID, "LanLobbyMenuShutdown", LanLobbyMenuShutdown }, - { NAMEKEY_INVALID, "ReplayMenuShutdown", ReplayMenuShutdown }, - { NAMEKEY_INVALID, "CreditsMenuShutdown", CreditsMenuShutdown }, - { NAMEKEY_INVALID, "LanGameOptionsMenuShutdown", LanGameOptionsMenuShutdown }, - { NAMEKEY_INVALID, "LanMapSelectMenuShutdown", LanMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "SkirmishGameOptionsMenuShutdown",SkirmishGameOptionsMenuShutdown }, - { NAMEKEY_INVALID, "SkirmishMapSelectMenuShutdown", SkirmishMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "ChallengeMenuShutdown", ChallengeMenuShutdown }, - { NAMEKEY_INVALID, "WOLLadderScreenShutdown", WOLLadderScreenShutdown }, - { NAMEKEY_INVALID, "WOLLoginMenuShutdown", WOLLoginMenuShutdown }, - { NAMEKEY_INVALID, "WOLLocaleSelectShutdown", WOLLocaleSelectShutdown }, - { NAMEKEY_INVALID, "WOLLobbyMenuShutdown", WOLLobbyMenuShutdown }, - { NAMEKEY_INVALID, "WOLGameSetupMenuShutdown", WOLGameSetupMenuShutdown }, - { NAMEKEY_INVALID, "WOLMapSelectMenuShutdown", WOLMapSelectMenuShutdown }, - { NAMEKEY_INVALID, "WOLBuddyOverlayShutdown", WOLBuddyOverlayShutdown }, - { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayShutdown",GameSpyPlayerInfoOverlayShutdown }, - { NAMEKEY_INVALID, "WOLMessageWindowShutdown", WOLMessageWindowShutdown }, - { NAMEKEY_INVALID, "WOLQuickMatchMenuShutdown", WOLQuickMatchMenuShutdown }, - { NAMEKEY_INVALID, "WOLWelcomeMenuShutdown", WOLWelcomeMenuShutdown }, - { NAMEKEY_INVALID, "WOLStatusMenuShutdown", WOLStatusMenuShutdown }, - { NAMEKEY_INVALID, "WOLQMScoreScreenShutdown", WOLQMScoreScreenShutdown }, - { NAMEKEY_INVALID, "WOLCustomScoreScreenShutdown", WOLCustomScoreScreenShutdown }, - { NAMEKEY_INVALID, "NetworkDirectConnectShutdown", NetworkDirectConnectShutdown }, - { NAMEKEY_INVALID, "ScoreScreenShutdown", ScoreScreenShutdown }, - { NAMEKEY_INVALID, "DownloadMenuShutdown", DownloadMenuShutdown }, - { NAMEKEY_INVALID, "PopupReplayShutdown", PopupReplayShutdown }, - { NAMEKEY_INVALID, nullptr, nullptr } + { NAMEKEY_INVALID, "MainMenuShutdown", (void*)MainMenuShutdown }, + { NAMEKEY_INVALID, "OptionsMenuShutdown", (void*)OptionsMenuShutdown }, + { NAMEKEY_INVALID, "SaveLoadMenuShutdown", (void*)SaveLoadMenuShutdown }, + { NAMEKEY_INVALID, "PopupCommunicatorShutdown", (void*)PopupCommunicatorShutdown }, + { NAMEKEY_INVALID, "KeyboardOptionsMenuShutdown", (void*)KeyboardOptionsMenuShutdown }, + { NAMEKEY_INVALID, "SinglePlayerMenuShutdown", (void*)SinglePlayerMenuShutdown }, + { NAMEKEY_INVALID, "MapSelectMenuShutdown", (void*)MapSelectMenuShutdown }, + { NAMEKEY_INVALID, "LanLobbyMenuShutdown", (void*)LanLobbyMenuShutdown }, + { NAMEKEY_INVALID, "ReplayMenuShutdown", (void*)ReplayMenuShutdown }, + { NAMEKEY_INVALID, "CreditsMenuShutdown", (void*)CreditsMenuShutdown }, + { NAMEKEY_INVALID, "LanGameOptionsMenuShutdown", (void*)LanGameOptionsMenuShutdown }, + { NAMEKEY_INVALID, "LanMapSelectMenuShutdown", (void*)LanMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "SkirmishGameOptionsMenuShutdown", (void*)SkirmishGameOptionsMenuShutdown }, + { NAMEKEY_INVALID, "SkirmishMapSelectMenuShutdown", (void*)SkirmishMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "ChallengeMenuShutdown", (void*)ChallengeMenuShutdown }, + { NAMEKEY_INVALID, "WOLLadderScreenShutdown", (void*)WOLLadderScreenShutdown }, + { NAMEKEY_INVALID, "WOLLoginMenuShutdown", (void*)WOLLoginMenuShutdown }, + { NAMEKEY_INVALID, "WOLLocaleSelectShutdown", (void*)WOLLocaleSelectShutdown }, + { NAMEKEY_INVALID, "WOLLobbyMenuShutdown", (void*)WOLLobbyMenuShutdown }, + { NAMEKEY_INVALID, "WOLGameSetupMenuShutdown", (void*)WOLGameSetupMenuShutdown }, + { NAMEKEY_INVALID, "WOLMapSelectMenuShutdown", (void*)WOLMapSelectMenuShutdown }, + { NAMEKEY_INVALID, "WOLBuddyOverlayShutdown", (void*)WOLBuddyOverlayShutdown }, + { NAMEKEY_INVALID, "GameSpyPlayerInfoOverlayShutdown", (void*)GameSpyPlayerInfoOverlayShutdown }, + { NAMEKEY_INVALID, "WOLMessageWindowShutdown", (void*)WOLMessageWindowShutdown }, + { NAMEKEY_INVALID, "WOLQuickMatchMenuShutdown", (void*)WOLQuickMatchMenuShutdown }, + { NAMEKEY_INVALID, "WOLWelcomeMenuShutdown", (void*)WOLWelcomeMenuShutdown }, + { NAMEKEY_INVALID, "WOLStatusMenuShutdown", (void*)WOLStatusMenuShutdown }, + { NAMEKEY_INVALID, "WOLQMScoreScreenShutdown", (void*)WOLQMScoreScreenShutdown }, + { NAMEKEY_INVALID, "WOLCustomScoreScreenShutdown", (void*)WOLCustomScoreScreenShutdown }, + { NAMEKEY_INVALID, "NetworkDirectConnectShutdown", (void*)NetworkDirectConnectShutdown }, + { NAMEKEY_INVALID, "ScoreScreenShutdown", (void*)ScoreScreenShutdown }, + { NAMEKEY_INVALID, "DownloadMenuShutdown", (void*)DownloadMenuShutdown }, + { NAMEKEY_INVALID, "PopupReplayShutdown", (void*)PopupReplayShutdown }, + { NAMEKEY_INVALID, nullptr, nullptr } }; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index b2e09e0c3c2..a72d2c29990 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -495,7 +495,7 @@ void CheckForCDAtGameStart( gameStartCallback callback ) { // popup a dialog asking for a CD ExMessageBoxOkCancel(TheGameText->fetch("GUI:InsertCDPrompt"), TheGameText->fetch("GUI:InsertCDMessage"), - callback, checkCDCallback, cancelStartBecauseOfNoCD); + (void*)callback, checkCDCallback, cancelStartBecauseOfNoCD); } else { diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp index 17f1b6cbdf7..93d0a02095c 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DFunctionLexicon.cpp @@ -43,59 +43,59 @@ static FunctionLexicon::TableEntry gameWinDrawTable [] = { - { NAMEKEY_INVALID, "GameWinDefaultDraw", GameWinDefaultDraw }, - { NAMEKEY_INVALID, "W3DGameWinDefaultDraw", W3DGameWinDefaultDraw }, - - { NAMEKEY_INVALID, "W3DGadgetPushButtonDraw", W3DGadgetPushButtonDraw }, - { NAMEKEY_INVALID, "W3DGadgetPushButtonImageDraw", W3DGadgetPushButtonImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetCheckBoxDraw", W3DGadgetCheckBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetCheckBoxImageDraw", W3DGadgetCheckBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetRadioButtonDraw", W3DGadgetRadioButtonDraw }, - { NAMEKEY_INVALID, "W3DGadgetRadioButtonImageDraw", W3DGadgetRadioButtonImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetTabControlDraw", W3DGadgetTabControlDraw }, - { NAMEKEY_INVALID, "W3DGadgetTabControlImageDraw", W3DGadgetTabControlImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetListBoxDraw", W3DGadgetListBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetListBoxImageDraw", W3DGadgetListBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetComboBoxDraw", W3DGadgetComboBoxDraw }, - { NAMEKEY_INVALID, "W3DGadgetComboBoxImageDraw", W3DGadgetComboBoxImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderDraw", W3DGadgetHorizontalSliderDraw }, - { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderImageDraw", W3DGadgetHorizontalSliderImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetVerticalSliderDraw", W3DGadgetVerticalSliderDraw }, - { NAMEKEY_INVALID, "W3DGadgetVerticalSliderImageDraw", W3DGadgetVerticalSliderImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetProgressBarDraw", W3DGadgetProgressBarDraw }, - { NAMEKEY_INVALID, "W3DGadgetProgressBarImageDraw", W3DGadgetProgressBarImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetStaticTextDraw", W3DGadgetStaticTextDraw }, - { NAMEKEY_INVALID, "W3DGadgetStaticTextImageDraw", W3DGadgetStaticTextImageDraw }, - { NAMEKEY_INVALID, "W3DGadgetTextEntryDraw", W3DGadgetTextEntryDraw }, - { NAMEKEY_INVALID, "W3DGadgetTextEntryImageDraw", W3DGadgetTextEntryImageDraw }, - - { NAMEKEY_INVALID, "W3DLeftHUDDraw", W3DLeftHUDDraw }, - { NAMEKEY_INVALID, "W3DCameoMovieDraw", W3DCameoMovieDraw }, - { NAMEKEY_INVALID, "W3DRightHUDDraw", W3DRightHUDDraw }, - { NAMEKEY_INVALID, "W3DPowerDraw", W3DPowerDraw }, - { NAMEKEY_INVALID, "W3DMainMenuDraw", W3DMainMenuDraw }, - { NAMEKEY_INVALID, "W3DMainMenuFourDraw", W3DMainMenuFourDraw }, - { NAMEKEY_INVALID, "W3DMetalBarMenuDraw", W3DMetalBarMenuDraw }, - { NAMEKEY_INVALID, "W3DCreditsMenuDraw", W3DCreditsMenuDraw }, - { NAMEKEY_INVALID, "W3DClockDraw", W3DClockDraw }, - { NAMEKEY_INVALID, "W3DMainMenuMapBorder", W3DMainMenuMapBorder }, - { NAMEKEY_INVALID, "W3DMainMenuButtonDropShadowDraw", W3DMainMenuButtonDropShadowDraw }, - { NAMEKEY_INVALID, "W3DMainMenuRandomTextDraw", W3DMainMenuRandomTextDraw }, - { NAMEKEY_INVALID, "W3DThinBorderDraw", W3DThinBorderDraw }, - { NAMEKEY_INVALID, "W3DShellMenuSchemeDraw", W3DShellMenuSchemeDraw }, - { NAMEKEY_INVALID, "W3DCommandBarBackgroundDraw", W3DCommandBarBackgroundDraw }, - { NAMEKEY_INVALID, "W3DCommandBarTopDraw", W3DCommandBarTopDraw }, - { NAMEKEY_INVALID, "W3DCommandBarGenExpDraw", W3DCommandBarGenExpDraw }, - { NAMEKEY_INVALID, "W3DCommandBarHelpPopupDraw", W3DCommandBarHelpPopupDraw }, - - { NAMEKEY_INVALID, "W3DCommandBarGridDraw", W3DCommandBarGridDraw }, - - - { NAMEKEY_INVALID, "W3DCommandBarForegroundDraw", W3DCommandBarForegroundDraw }, - { NAMEKEY_INVALID, "W3DNoDraw", W3DNoDraw }, - { NAMEKEY_INVALID, "W3DDrawMapPreview", W3DDrawMapPreview }, - - { NAMEKEY_INVALID, nullptr, nullptr }, + { NAMEKEY_INVALID, "GameWinDefaultDraw", (void*)GameWinDefaultDraw }, + { NAMEKEY_INVALID, "W3DGameWinDefaultDraw", (void*)W3DGameWinDefaultDraw }, + + { NAMEKEY_INVALID, "W3DGadgetPushButtonDraw", (void*)W3DGadgetPushButtonDraw }, + { NAMEKEY_INVALID, "W3DGadgetPushButtonImageDraw", (void*)W3DGadgetPushButtonImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetCheckBoxDraw", (void*)W3DGadgetCheckBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetCheckBoxImageDraw", (void*)W3DGadgetCheckBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetRadioButtonDraw", (void*)W3DGadgetRadioButtonDraw }, + { NAMEKEY_INVALID, "W3DGadgetRadioButtonImageDraw", (void*)W3DGadgetRadioButtonImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetTabControlDraw", (void*)W3DGadgetTabControlDraw }, + { NAMEKEY_INVALID, "W3DGadgetTabControlImageDraw", (void*)W3DGadgetTabControlImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetListBoxDraw", (void*)W3DGadgetListBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetListBoxImageDraw", (void*)W3DGadgetListBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetComboBoxDraw", (void*)W3DGadgetComboBoxDraw }, + { NAMEKEY_INVALID, "W3DGadgetComboBoxImageDraw", (void*)W3DGadgetComboBoxImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderDraw", (void*)W3DGadgetHorizontalSliderDraw }, + { NAMEKEY_INVALID, "W3DGadgetHorizontalSliderImageDraw", (void*)W3DGadgetHorizontalSliderImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetVerticalSliderDraw", (void*)W3DGadgetVerticalSliderDraw }, + { NAMEKEY_INVALID, "W3DGadgetVerticalSliderImageDraw", (void*)W3DGadgetVerticalSliderImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetProgressBarDraw", (void*)W3DGadgetProgressBarDraw }, + { NAMEKEY_INVALID, "W3DGadgetProgressBarImageDraw", (void*)W3DGadgetProgressBarImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetStaticTextDraw", (void*)W3DGadgetStaticTextDraw }, + { NAMEKEY_INVALID, "W3DGadgetStaticTextImageDraw", (void*)W3DGadgetStaticTextImageDraw }, + { NAMEKEY_INVALID, "W3DGadgetTextEntryDraw", (void*)W3DGadgetTextEntryDraw }, + { NAMEKEY_INVALID, "W3DGadgetTextEntryImageDraw", (void*)W3DGadgetTextEntryImageDraw }, + + { NAMEKEY_INVALID, "W3DLeftHUDDraw", (void*)W3DLeftHUDDraw }, + { NAMEKEY_INVALID, "W3DCameoMovieDraw", (void*)W3DCameoMovieDraw }, + { NAMEKEY_INVALID, "W3DRightHUDDraw", (void*)W3DRightHUDDraw }, + { NAMEKEY_INVALID, "W3DPowerDraw", (void*)W3DPowerDraw }, + { NAMEKEY_INVALID, "W3DMainMenuDraw", (void*)W3DMainMenuDraw }, + { NAMEKEY_INVALID, "W3DMainMenuFourDraw", (void*)W3DMainMenuFourDraw }, + { NAMEKEY_INVALID, "W3DMetalBarMenuDraw", (void*)W3DMetalBarMenuDraw }, + { NAMEKEY_INVALID, "W3DCreditsMenuDraw", (void*)W3DCreditsMenuDraw }, + { NAMEKEY_INVALID, "W3DClockDraw", (void*)W3DClockDraw }, + { NAMEKEY_INVALID, "W3DMainMenuMapBorder", (void*)W3DMainMenuMapBorder }, + { NAMEKEY_INVALID, "W3DMainMenuButtonDropShadowDraw", (void*)W3DMainMenuButtonDropShadowDraw }, + { NAMEKEY_INVALID, "W3DMainMenuRandomTextDraw", (void*)W3DMainMenuRandomTextDraw }, + { NAMEKEY_INVALID, "W3DThinBorderDraw", (void*)W3DThinBorderDraw }, + { NAMEKEY_INVALID, "W3DShellMenuSchemeDraw", (void*)W3DShellMenuSchemeDraw }, + { NAMEKEY_INVALID, "W3DCommandBarBackgroundDraw", (void*)W3DCommandBarBackgroundDraw }, + { NAMEKEY_INVALID, "W3DCommandBarTopDraw", (void*)W3DCommandBarTopDraw }, + { NAMEKEY_INVALID, "W3DCommandBarGenExpDraw", (void*)W3DCommandBarGenExpDraw }, + { NAMEKEY_INVALID, "W3DCommandBarHelpPopupDraw", (void*)W3DCommandBarHelpPopupDraw }, + + { NAMEKEY_INVALID, "W3DCommandBarGridDraw", (void*)W3DCommandBarGridDraw }, + + + { NAMEKEY_INVALID, "W3DCommandBarForegroundDraw", (void*)W3DCommandBarForegroundDraw }, + { NAMEKEY_INVALID, "W3DNoDraw", (void*)W3DNoDraw }, + { NAMEKEY_INVALID, "W3DDrawMapPreview", (void*)W3DDrawMapPreview }, + + { NAMEKEY_INVALID, nullptr, nullptr } }; @@ -103,9 +103,9 @@ static FunctionLexicon::TableEntry gameWinDrawTable [] = static FunctionLexicon::TableEntry layoutInitTable [] = { - { NAMEKEY_INVALID, "W3DMainMenuInit", W3DMainMenuInit }, + { NAMEKEY_INVALID, "W3DMainMenuInit", (void*)W3DMainMenuInit }, - { NAMEKEY_INVALID, nullptr, nullptr }, + { NAMEKEY_INVALID, nullptr, nullptr } }; From d26ebe50a148e54feb7a94c3432789084d852124 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:00:59 +0000 Subject: [PATCH 16/17] fix(debug): Simplify unconditional DEBUG_ASSERTCRASH to DEBUG_CRASH (#2067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace DEBUG_ASSERTCRASH(nullptr, ...) with DEBUG_CRASH(...) for unconditional crash assertions in MinGW-w64 debug builds. Changes: - PlayerTemplate.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH - ChallengeGenerals.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH - LoadScreen.cpp: 2× DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH Total: 4 instances simplified across GeneralsMD codebase Rationale: DEBUG_ASSERTCRASH(nullptr, ...) was causing compilation errors with MinGW-w64 due to implicit nullptr-to-bool conversion. These instances represent "unconditional crash" assertions (always false condition). The DEBUG_CRASH macro is the semantically correct choice for this use case, making the intent explicit and avoiding type conversion issues. Error resolved: error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive] Historical note: These instances were introduced by commit f891c5f3 ("refactor: Modernize NULL to nullptr"). The original NULL was semantically 0 (false), not a null pointer check. Affects: GeneralsMD debug builds only --- .../Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp | 2 +- .../GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp | 2 +- .../Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp index 81c5cf6b32d..501e9e9d5b6 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp @@ -294,7 +294,7 @@ Int PlayerTemplateStore::getTemplateNumByName(AsciiString name) const if (m_playerTemplates[num].getName().compareNoCase(name.str()) == 0) return num; } - DEBUG_ASSERTCRASH(nullptr, ("Template doesn't exist for given name")); + DEBUG_CRASH(("Template doesn't exist for given name")); return -1; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp index ffe9a6b0974..eb5adf62d1b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ChallengeGenerals.cpp @@ -133,7 +133,7 @@ const GeneralPersona* ChallengeGenerals::getPlayerGeneralByCampaignName( AsciiSt if (campaignName.compareNoCase( name.str() ) == 0) return &m_position[i]; } - DEBUG_ASSERTCRASH(nullptr, ("Can't find General by Campaign Name")); + DEBUG_CRASH(("Can't find General by Campaign Name")); return nullptr; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp index ffb718029d5..7af73730f78 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp @@ -1308,7 +1308,7 @@ void MultiPlayerLoadScreen::init( GameInfo *game ) else if (pt->getName() == "FactionChina") portrait = TheMappedImageCollection->findImageByName("SNFactionLogoLg_China"); else - DEBUG_ASSERTCRASH(nullptr, ("Unexpected player template")); + DEBUG_CRASH(("Unexpected player template")); localName = pt->getDisplayName(); } @@ -1579,7 +1579,7 @@ GameSlot *lSlot = game->getSlot(game->getLocalSlotNum()); else if (pt->getName() == "FactionChina") portrait = TheMappedImageCollection->findImageByName("SNFactionLogo144_China"); else - DEBUG_ASSERTCRASH(nullptr, ("Unexpected player template")); + DEBUG_CRASH(("Unexpected player template")); localName = pt->getDisplayName(); } From fe1230123864053d80e8ea96ec5bfc4a8aeebcd9 Mon Sep 17 00:00:00 2001 From: JohnsterID <69278611+JohnsterID@users.noreply.github.com> Date: Mon, 19 Jan 2026 21:06:50 +0000 Subject: [PATCH 17/17] feat(cmake): Add debug symbol stripping for MinGW Release builds (#2067) Implement complete debug symbol separation for MinGW-w64 Release builds, matching MSVC PDB workflow. Debug symbols are now generated with -g and then stripped to separate .debug files post-build. Changes: - cmake/debug_strip.cmake: New module with add_debug_strip_target() function - Automatically finds toolchain objcopy and strip tools - Three-step process: extract symbols, strip exe, add debug link - Only applies to Release builds (Debug keeps embedded symbols) - cmake/compilers.cmake: Enable -g for all Release builds - Removed MinGW exception that was skipping debug symbols - Added comment explaining stripping workflow - CMakeLists.txt: Include debug_strip.cmake module - Generals/Code/Main/CMakeLists.txt: Apply stripping to g_generals - GeneralsMD/Code/Main/CMakeLists.txt: Apply stripping to z_generals Result files (Release): - generalsv.exe (12 MB, stripped) + generalsv.exe.debug (231 MB, symbols) - generalszh.exe (13 MB, stripped) + generalszh.exe.debug (250 MB, symbols) Benefits: - Crash dump analysis support (crashpad, breakpad) - Post-mortem debugging with full symbols - Performance profiling of optimized code - Parity with MSVC (exe + pdb workflow) - Smaller shipped binaries (symbols separate) Debug builds keep symbols embedded for development convenience. Tools used: GNU Binutils objcopy and strip --- CMakeLists.txt | 3 + Generals/Code/Main/CMakeLists.txt | 6 ++ GeneralsMD/Code/Main/CMakeLists.txt | 6 ++ cmake/compilers.cmake | 9 ++- cmake/debug_strip.cmake | 92 +++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 cmake/debug_strip.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f55b4f4f99..e6a43be6ed6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,9 @@ project(genzh LANGUAGES C CXX) # This file handles extra settings wanted/needed for different compilers. include(cmake/compilers.cmake) +# Debug symbol stripping for Release builds (MinGW) +include(cmake/debug_strip.cmake) + include(FetchContent) # MinGW-w64 specific configuration diff --git a/Generals/Code/Main/CMakeLists.txt b/Generals/Code/Main/CMakeLists.txt index 5e9aa4c9cf1..9e14a4cbe75 100644 --- a/Generals/Code/Main/CMakeLists.txt +++ b/Generals/Code/Main/CMakeLists.txt @@ -85,3 +85,9 @@ if(MSVC) RTS.RC ) endif() + +# Strip debug symbols to separate file for MinGW Release builds +# This creates generalsv.exe.debug (similar to MSVC .pdb files) +if(MINGW AND COMMAND add_debug_strip_target) + add_debug_strip_target(g_generals) +endif() diff --git a/GeneralsMD/Code/Main/CMakeLists.txt b/GeneralsMD/Code/Main/CMakeLists.txt index 49cee59a1ec..d6518f442ba 100644 --- a/GeneralsMD/Code/Main/CMakeLists.txt +++ b/GeneralsMD/Code/Main/CMakeLists.txt @@ -74,3 +74,9 @@ if(MSVC) RTS.RC ) endif() + +# Strip debug symbols to separate file for MinGW Release builds +# This creates generalszh.exe.debug (similar to MSVC .pdb files) +if(MINGW AND COMMAND add_debug_strip_target) + add_debug_strip_target(z_generals) +endif() diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index f9478fc4a50..523a07e946d 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -34,11 +34,10 @@ if(MSVC) add_link_options("/INCREMENTAL:NO") else() # We go a bit wild here and assume any other compiler we are going to use supports -g for debug info. - # For MinGW, skip adding -g to Release builds - if(NOT (MINGW AND CMAKE_BUILD_TYPE STREQUAL "Release")) - string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g") - string(APPEND CMAKE_C_FLAGS_RELEASE " -g") - endif() + # Add debug symbols to Release builds for crash dump analysis, profiling, and post-mortem debugging. + # For MinGW, symbols will be stripped to separate .debug files (matching MSVC PDB workflow). + string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g") + string(APPEND CMAKE_C_FLAGS_RELEASE " -g") endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/cmake/debug_strip.cmake b/cmake/debug_strip.cmake new file mode 100644 index 00000000000..be61f69699b --- /dev/null +++ b/cmake/debug_strip.cmake @@ -0,0 +1,92 @@ +# TheSuperHackers @build JohnsterID 05/01/2026 Add debug symbol stripping for MinGW Release builds +# Debug Symbol Stripping for MinGW-w64 Release Builds +# +# Separates debug symbols from executables into .debug files, matching MSVC PDB workflow. +# This reduces shipped binary size while preserving symbols for crash analysis. + +# Find the required tools for symbol stripping +if(MINGW) + # Use the cross-compiler toolchain's objcopy and strip + # These should be in the same directory as the compiler + get_filename_component(COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY) + + find_program(MINGW_OBJCOPY + NAMES ${CMAKE_CXX_COMPILER_TARGET}-objcopy + ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-objcopy + objcopy + HINTS ${COMPILER_DIR} + DOC "MinGW objcopy tool for extracting debug symbols" + ) + + find_program(MINGW_STRIP + NAMES ${CMAKE_CXX_COMPILER_TARGET}-strip + ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-strip + strip + HINTS ${COMPILER_DIR} + DOC "MinGW strip tool for removing debug symbols" + ) + + if(MINGW_OBJCOPY AND MINGW_STRIP) + message(STATUS "Debug symbol stripping enabled:") + message(STATUS " objcopy: ${MINGW_OBJCOPY}") + message(STATUS " strip: ${MINGW_STRIP}") + set(DEBUG_STRIP_AVAILABLE TRUE) + else() + message(WARNING "Debug symbol stripping not available - tools not found") + if(NOT MINGW_OBJCOPY) + message(WARNING " objcopy not found") + endif() + if(NOT MINGW_STRIP) + message(WARNING " strip not found") + endif() + set(DEBUG_STRIP_AVAILABLE FALSE) + endif() + + # Function to strip debug symbols from a target and create a separate .debug file + # + # This implements a three-step process: + # 1. Extract debug symbols to separate file + # 2. Strip debug symbols from main executable + # 3. Add debug link so debuggers can find the symbols + # + # Usage: + # add_debug_strip_target(target_name) + # + # Result (for Release builds only): + # program.exe - Stripped executable (smaller) + # program.exe.debug - Debug symbols (can be distributed separately) + # + function(add_debug_strip_target target_name) + if(NOT DEBUG_STRIP_AVAILABLE) + return() + endif() + + # Only strip Release builds + # Debug builds keep symbols embedded for development convenience + if(CMAKE_BUILD_TYPE STREQUAL "Release") + add_custom_command(TARGET ${target_name} POST_BUILD + # Step 1: Extract all debug sections to separate file + COMMAND ${MINGW_OBJCOPY} + --only-keep-debug + $ + $.debug + + # Step 2: Strip debug sections from executable + COMMAND ${MINGW_STRIP} + --strip-debug + --strip-unneeded + $ + + # Step 3: Add GNU debug link (debuggers use this to find symbols) + COMMAND ${MINGW_OBJCOPY} + --add-gnu-debuglink=$.debug + $ + + COMMENT "Stripping debug symbols from ${target_name} (Release)" + VERBATIM + ) + + message(STATUS "Debug symbol stripping configured for target: ${target_name}") + endif() + endfunction() +endif()