From c609a96a2b95dd8351b1d64ac2b8274b10d32073 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Mon, 4 Nov 2024 09:58:30 +0800 Subject: [PATCH] test: Fix tests for MSVC --- test/tls_foreign_dtor.c | 3 ++- test/tls_foreign_dtor_thread_exit.c | 3 ++- test/tls_foreign_xset.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/tls_foreign_dtor.c b/test/tls_foreign_dtor.c index 8be3bbf783..3836a8ace7 100644 --- a/test/tls_foreign_dtor.c +++ b/test/tls_foreign_dtor.c @@ -25,8 +25,9 @@ tls_destructor(void* ptr) _MCF_atomic_xadd_32_rlx(ptr, 1); } -static __attribute__((__stdcall__)) +static DWORD +__stdcall thread_proc(LPVOID param) { _MCF_sem_wait(&start, __MCF_nullptr); diff --git a/test/tls_foreign_dtor_thread_exit.c b/test/tls_foreign_dtor_thread_exit.c index 6e3fd85fb5..9359354885 100644 --- a/test/tls_foreign_dtor_thread_exit.c +++ b/test/tls_foreign_dtor_thread_exit.c @@ -20,8 +20,9 @@ tls_dtor(void* ptr) __MCF__Exit(*(int*) ptr); } -static __attribute__((__stdcall__)) +static DWORD +__stdcall thread_proc(LPVOID param) { _MCF_tls_key* key = _MCF_tls_key_new(tls_dtor); diff --git a/test/tls_foreign_xset.c b/test/tls_foreign_xset.c index 084f46fba4..3201f321d2 100644 --- a/test/tls_foreign_xset.c +++ b/test/tls_foreign_xset.c @@ -14,8 +14,9 @@ static _MCF_tls_key* key; static HANDLE thrd; static int dso_1, dso_2; -static __attribute__((__stdcall__)) +static DWORD +__stdcall thread_proc(LPVOID param) { void* p;