summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/kit/CMakeLists.txt1
-rw-r--r--source/kit/mutex.h1
-rw-r--r--source/kit/thread.h10
-rw-r--r--source/kit/thread_defs.h22
4 files changed, 25 insertions, 9 deletions
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(
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/move_back.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/secure_random.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/input_stream.h>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/thread_defs.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/input_buffer.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/lower_bound.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/file.h>
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 <stddef.h>
@@ -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
+