diff options
-rw-r--r-- | include/zix/thread.h | 5 | ||||
-rw-r--r-- | test/test_ring.c | 6 | ||||
-rw-r--r-- | test/test_sem.c | 6 | ||||
-rw-r--r-- | test/test_thread.c | 3 |
4 files changed, 7 insertions, 13 deletions
diff --git a/include/zix/thread.h b/include/zix/thread.h index 29dee44..9c213de 100644 --- a/include/zix/thread.h +++ b/include/zix/thread.h @@ -27,7 +27,7 @@ extern "C" { #ifdef _WIN32 # define ZIX_THREAD_RESULT 0 -# define ZIX_THREAD_FUNC __attribute__((stdcall)) +# define ZIX_THREAD_FUNC __stdcall typedef HANDLE ZixThread; typedef DWORD ZixThreadResult; @@ -51,8 +51,7 @@ typedef void* ZixThreadResult; "Returning" a result, and communicating with the parent thread in general, can be done through the pointer argument. */ -typedef ZIX_THREAD_FUNC -ZixThreadResult (*ZixThreadFunc)(void*); +typedef ZixThreadResult(ZIX_THREAD_FUNC* ZixThreadFunc)(void*); /** Initialize `thread` to a new thread. diff --git a/test/test_ring.c b/test/test_ring.c index 8016910..7209ac0 100644 --- a/test/test_ring.c +++ b/test/test_ring.c @@ -43,8 +43,7 @@ cmp_msg(const int* const msg1, const int* const msg2) return 1; } -ZIX_THREAD_FUNC -static ZixThreadResult +static ZixThreadResult ZIX_THREAD_FUNC reader(void* ZIX_UNUSED(arg)) { printf("Reader starting\n"); @@ -67,8 +66,7 @@ reader(void* ZIX_UNUSED(arg)) return ZIX_THREAD_RESULT; } -ZIX_THREAD_FUNC -static ZixThreadResult +static ZixThreadResult ZIX_THREAD_FUNC writer(void* ZIX_UNUSED(arg)) { printf("Writer starting\n"); diff --git a/test/test_sem.c b/test/test_sem.c index 3cda8ea..023b8ee 100644 --- a/test/test_sem.c +++ b/test/test_sem.c @@ -14,8 +14,7 @@ static ZixSem sem; static unsigned n_signals = 1024; -ZIX_THREAD_FUNC -static ZixThreadResult +static ZixThreadResult ZIX_THREAD_FUNC reader(void* ZIX_UNUSED(arg)) { printf("Reader starting\n"); @@ -28,8 +27,7 @@ reader(void* ZIX_UNUSED(arg)) return ZIX_THREAD_RESULT; } -ZIX_THREAD_FUNC -static ZixThreadResult +static ZixThreadResult ZIX_THREAD_FUNC writer(void* ZIX_UNUSED(arg)) { printf("Writer starting\n"); diff --git a/test/test_thread.c b/test/test_thread.c index 6fe80a5..8cfc9f4 100644 --- a/test/test_thread.c +++ b/test/test_thread.c @@ -13,8 +13,7 @@ typedef struct { int output; } SharedData; -ZIX_THREAD_FUNC -static ZixThreadResult +static ZixThreadResult ZIX_THREAD_FUNC thread_func(void* const arg) { SharedData* const data = (SharedData*)arg; |