summaryrefslogtreecommitdiffstats
path: root/src/mapi/mapi/u_thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapi/mapi/u_thread.h')
-rw-r--r--src/mapi/mapi/u_thread.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h
index 4405ec9c509..7db22b7936a 100644
--- a/src/mapi/mapi/u_thread.h
+++ b/src/mapi/mapi/u_thread.h
@@ -44,12 +44,25 @@
#include "u_compiler.h"
-#if defined(PTHREADS) || defined(WIN32)
+#if defined(PTHREADS)
+#include <pthread.h> /* POSIX threads headers */
+#endif
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#if defined(PTHREADS) || defined(_WIN32)
#ifndef THREADS
#define THREADS
#endif
#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* POSIX threads. This should be your choice in the Unix world
* whenever possible. When building with POSIX threads, be sure
@@ -60,7 +73,6 @@
* proper compiling for MT-safe libc etc.
*/
#if defined(PTHREADS)
-#include <pthread.h> /* POSIX threads headers */
struct u_tsd {
pthread_key_t key;
@@ -86,7 +98,6 @@ typedef pthread_mutex_t u_mutex;
* used!
*/
#ifdef WIN32
-#include <windows.h>
struct u_tsd {
DWORD key;
@@ -142,4 +153,9 @@ u_tsd_get(struct u_tsd *tsd);
void
u_tsd_set(struct u_tsd *tsd, void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _U_THREAD_H_ */