summaryrefslogtreecommitdiff
path: root/Examples/test-suite/swig_examples_lock.h
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/swig_examples_lock.h')
-rw-r--r--Examples/test-suite/swig_examples_lock.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/Examples/test-suite/swig_examples_lock.h b/Examples/test-suite/swig_examples_lock.h
index 7710f9361..feef26d0f 100644
--- a/Examples/test-suite/swig_examples_lock.h
+++ b/Examples/test-suite/swig_examples_lock.h
@@ -1,10 +1,10 @@
-namespace SwigExamples {
-
# if defined(_WIN32) || defined(__WIN32__)
#include <windows.h>
+namespace SwigExamples {
+
class CriticalSection {
public:
CriticalSection() {
@@ -27,9 +27,18 @@ private:
CriticalSection &critical_section;
};
+}
+
#else
#include <pthread.h>
+#ifndef PTHREAD_MUTEX_RECURSIVE_NP
+ // For Cygwin and possibly other OSs: _NP is "non-portable"
+ #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
+#endif
+
+namespace SwigExamples {
+
class CriticalSection {
public:
CriticalSection() {
@@ -55,7 +64,7 @@ private:
CriticalSection &critical_section;
};
-#endif
-
}
+#endif
+