aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/include/janet.h
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2021-09-17 16:59:50 -0500
committerCalvin Rose <calsrose@gmail.com>2021-09-17 16:59:50 -0500
commitbf9b6b13014bbb8908ea629b665092e5e19a1afa (patch)
treec693989a0be63971e4812d95982e9abc0f305a34 /src/include/janet.h
parentAdd makefile var to fix jpm to a tag/branch (diff)
Avoid including windows.h in janet.h for JanetOSMutex.
Diffstat (limited to 'src/include/janet.h')
-rw-r--r--src/include/janet.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/include/janet.h b/src/include/janet.h
index d8e17351..f65a6a87 100644
--- a/src/include/janet.h
+++ b/src/include/janet.h
@@ -330,11 +330,16 @@ typedef struct {
/* Some extra includes if EV is enabled */
#ifdef JANET_EV
#ifdef JANET_WINDOWS
-#ifdef JANET_NET
-#include <winsock2.h>
-#endif
-#include <windows.h>
-typedef CRITICAL_SECTION JanetOSMutex;
+typedef struct JanetDudCriticalSection {
+ /* Avoid including windows.h here - instead, create a structure of the same size */
+ /* Needs to be same size as crtical section see WinNT.h for CRITCIAL_SECTION definition */
+ void *debug_info;
+ long lock_count
+ long recursion_count;
+ void *owning_thread;
+ void *lock_semaphore;
+ unsigned long spin_count;
+} JanetOSMutex;
#else
#include <pthread.h>
typedef pthread_mutex_t JanetOSMutex;