Win32: Guard timeapi.h include for MinGW compatibility (#1345)

* bugfix/mingw-timeapi

* fix: clean up Windows timer includes

- Removed legacy GCC-specific include block.
- Added compiler-specific headers:
  - MSVC (_MSC_VER): includes <timeapi.h> and links winmm.lib
  - Other compilers: includes <mmsystem.h>
- Ensures cross-compiler compatibility and avoids duplicate headers.

---------

Co-authored-by: Metehan Öztürk <mete_pukkada@outlook.com>
Co-authored-by: Monika Singh <moninom@amazon.com>
This commit is contained in:
nordync 2025-12-23 23:01:31 +03:00 committed by GitHub
parent 536914b2a4
commit a9cb459206
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,12 +39,11 @@
#include <winsock.h> #include <winsock.h>
#endif #endif
#include <timeapi.h> #ifdef _MSC_VER
#include <timeapi.h>
#ifdef __GNUC__
#include "mmsystem.h"
#else
#pragma comment(lib, "winmm.lib") #pragma comment(lib, "winmm.lib")
#else
#include <mmsystem.h>
#endif #endif
#define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */ #define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */