From cb8a6700f4f6d37235119f73a1d5a0558962198c Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Fri, 30 Dec 2022 04:32:55 +0100 Subject: Fix thread defs --- source/kit/CMakeLists.txt | 1 + source/kit/mutex.h | 1 + source/kit/thread.h | 10 +--------- source/kit/thread_defs.h | 22 ++++++++++++++++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 source/kit/thread_defs.h (limited to 'source') diff --git a/source/kit/CMakeLists.txt b/source/kit/CMakeLists.txt index bd4d5ea..b672a80 100644 --- a/source/kit/CMakeLists.txt +++ b/source/kit/CMakeLists.txt @@ -21,6 +21,7 @@ target_sources( $ $ $ + $ $ $ $ diff --git a/source/kit/mutex.h b/source/kit/mutex.h index e5d2e40..6d2d230 100644 --- a/source/kit/mutex.h +++ b/source/kit/mutex.h @@ -2,6 +2,7 @@ #define KIT_MUTEX_H #ifndef KIT_DISABLE_SYSTEM_THREADS +# include "thread_defs.h" # include "time.h" # if !defined(_WIN32) || defined(__CYGWIN__) diff --git a/source/kit/thread.h b/source/kit/thread.h index f64264e..eff2684 100644 --- a/source/kit/thread.h +++ b/source/kit/thread.h @@ -2,6 +2,7 @@ #define KIT_THREAD_H #ifndef KIT_DISABLE_SYSTEM_THREADS +# include "thread_defs.h" # include "time.h" # include @@ -63,15 +64,6 @@ typedef pthread_t thrd_t; typedef pthread_key_t tss_t; # endif -enum { - thrd_success = 0, - thrd_timedout, - thrd_error, - thrd_busy, - thrd_nomem, - thrd_wrong_stack_size -}; - int thrd_create(thrd_t *, thrd_start_t, void *); int thrd_create_with_stack(thrd_t *, thrd_start_t, void *, ptrdiff_t stack_size); diff --git a/source/kit/thread_defs.h b/source/kit/thread_defs.h new file mode 100644 index 0000000..0a9c033 --- /dev/null +++ b/source/kit/thread_defs.h @@ -0,0 +1,22 @@ +#ifndef KIT_THREAD_DEFS_H +#define KIT_THREAD_DEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + thrd_success = 0, + thrd_timedout, + thrd_error, + thrd_busy, + thrd_nomem, + thrd_wrong_stack_size +}; + +#ifdef __cplusplus +} +#endif + +#endif + -- cgit v1.2.3