diff --git a/src/xpdev/rwlockwrap.c b/src/xpdev/rwlockwrap.c
index b0a9ef152dd67773a774244f573b893b710cb342..cc90610d0fd34070446d1c5e65947b346bc98c74 100644
--- a/src/xpdev/rwlockwrap.c
+++ b/src/xpdev/rwlockwrap.c
@@ -2,8 +2,6 @@
 
 #ifdef _WIN32
 
-#include "gen_defs.h"	// For windows.h
-
 bool
 rwlock_init(rwlock_t *lock)
 {
diff --git a/src/xpdev/rwlockwrap.h b/src/xpdev/rwlockwrap.h
index 79cea157cc0715b611011e937f9f5e2895b420d2..ceeb91eca3c29bacbff756da35b82bfb07c4bce1 100644
--- a/src/xpdev/rwlockwrap.h
+++ b/src/xpdev/rwlockwrap.h
@@ -1,11 +1,10 @@
 #ifndef RWLOCKWRAP_H
 #define RWLOCKWRAP_H
 
-#include <stdbool.h>
-
 #if defined(__unix__)
 
 #include <pthread.h>
+#include <stdbool.h>
 typedef pthread_rwlock_t rwlock_t;
 
 #define rwlock_init(lock) (pthread_rwlock_init(lock, NULL) == 0)
@@ -17,6 +16,7 @@ typedef pthread_rwlock_t rwlock_t;
 
 #elif defined(_WIN32)
 
+#include "gen_defs.h"	// For windows.h and bool :(
 #include "threadwrap.h"
 
 typedef struct {