From ba75b8fd563d041009fed4c910fc886dbb31c68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mal=C3=BD?= Date: Fri, 17 Jan 2025 04:06:14 +0100 Subject: [PATCH] fixes for compiling on windows (#4026) --- core/shared/platform/windows/win_clock.c | 16 +++++++++++++--- core/shared/platform/windows/win_thread.c | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/core/shared/platform/windows/win_clock.c b/core/shared/platform/windows/win_clock.c index c402330aa..1d618c8b6 100644 --- a/core/shared/platform/windows/win_clock.c +++ b/core/shared/platform/windows/win_clock.c @@ -11,9 +11,19 @@ #define NANOSECONDS_PER_TICK 100 #if WINAPI_PARTITION_DESKTOP -extern NTSTATUS -NtQueryTimerResolution(PULONG MinimumResolution, PULONG MaximumResolution, - PULONG CurrentResolution); +#ifndef __kernel_entry +#define __kernel_entry +#endif +#ifndef NTAPI +#define NTAPI +#endif +#ifndef _Out_ +#define _Out_ +#endif +extern __kernel_entry NTSTATUS NTAPI +NtQueryTimerResolution(_Out_ PULONG MinimumResolution, + _Out_ PULONG MaximumResolution, + _Out_ PULONG CurrentResolution); #endif static __wasi_errno_t diff --git a/core/shared/platform/windows/win_thread.c b/core/shared/platform/windows/win_thread.c index 438e16040..1f6a57ebb 100644 --- a/core/shared/platform/windows/win_thread.c +++ b/core/shared/platform/windows/win_thread.c @@ -60,6 +60,17 @@ static DWORD thread_data_key; static void(WINAPI *GetCurrentThreadStackLimits_Kernel32)(PULONG_PTR, PULONG_PTR) = NULL; +int +os_sem_init(korp_sem *sem); +int +os_sem_destroy(korp_sem *sem); +int +os_sem_wait(korp_sem *sem); +int +os_sem_reltimed_wait(korp_sem *sem, uint64 useconds); +int +os_sem_signal(korp_sem *sem); + static void thread_data_list_add(os_thread_data *thread_data) { @@ -117,17 +128,6 @@ thread_data_list_lookup(korp_tid tid) return NULL; } -int -os_sem_init(korp_sem *sem); -int -os_sem_destroy(korp_sem *sem); -int -os_sem_wait(korp_sem *sem); -int -os_sem_reltimed_wait(korp_sem *sem, uint64 useconds); -int -os_sem_signal(korp_sem *sem); - int os_thread_sys_init() {