Skip to content

Commit

Permalink
Add patches to fix build failures on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ethindp committed Feb 6, 2025
1 parent dedb2cb commit ab1045e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff --git a/core/shared/platform/windows/win_clock.c b/core/shared/platform/windows/win_clock.c
index c402330aad..1d618c8b67 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 438e160405..1f6a57ebbf 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()
{
1 change: 1 addition & 0 deletions packages/w/wasm-micro-runtime/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package("wasm-micro-runtime")
add_versions("1.2.3", "85057f788630dc1b8c371f5443cc192627175003a8ea63c491beaff29a338346")

add_patches("1.3.2", path.join(os.scriptdir(), "patches", "1.3.2", "cmake.patch"), "cf0e992bdf3fe03f7dc03624fd757444291a5286b1ceef6532bbf3f9567f394b")
add_patches("2.2.0", path.join(os.scriptdir(), "patches", "2.2.0", "8c2759c9d62a4e3203b4c7d210640cf2d031c388.patch"), "c13ce6f24922d6cb7f0f424f68d1a789b34d1e85273e6b2c420a9a11995fcf89")
add_patches("1.2.3", path.join(os.scriptdir(), "patches", "1.2.3", "cmake.patch"), "97d99509997b86d24a84cd1b2eca0d4dace7b460d5cb85bc23881d02e7ef08ed")

add_patches("1.3.2", path.join(os.scriptdir(), "patches", "libc_uvwasi.patch"), "e83ff42588cc112588c7fde48a1bd9df7ffa8fa41f70dd99af5d6b0325ce46f7")
Expand Down

0 comments on commit ab1045e

Please sign in to comment.