From a9cb459206e605a90e7bcf38bf95d301277c5562 Mon Sep 17 00:00:00 2001 From: nordync <225464921+nordync@users.noreply.github.com> Date: Tue, 23 Dec 2025 23:01:31 +0300 Subject: [PATCH] Win32: Guard timeapi.h include for MinGW compatibility (#1345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bugfix/mingw-timeapi * fix: clean up Windows timer includes - Removed legacy GCC-specific include block. - Added compiler-specific headers: - MSVC (_MSC_VER): includes and links winmm.lib - Other compilers: includes - Ensures cross-compiler compatibility and avoids duplicate headers. --------- Co-authored-by: Metehan Öztürk Co-authored-by: Monika Singh --- portable/MSVC-MingW/port.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/portable/MSVC-MingW/port.c b/portable/MSVC-MingW/port.c index 540c4a4bc..d992c4d3c 100644 --- a/portable/MSVC-MingW/port.c +++ b/portable/MSVC-MingW/port.c @@ -39,12 +39,11 @@ #include #endif -#include - -#ifdef __GNUC__ - #include "mmsystem.h" -#else +#ifdef _MSC_VER + #include #pragma comment(lib, "winmm.lib") +#else + #include #endif #define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */