diff --git a/src/rc_compat.h b/src/rc_compat.h index 2485ff99..4cee1731 100644 --- a/src/rc_compat.h +++ b/src/rc_compat.h @@ -1,6 +1,11 @@ #ifndef RC_COMPAT_H #define RC_COMPAT_H +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include +#endif + #include "rc_export.h" #include @@ -77,21 +82,19 @@ RC_BEGIN_C_DECLS #define rc_mutex_lock(mutex) #define rc_mutex_unlock(mutex) #else - #if defined(_WIN32) - #define WIN32_LEAN_AND_MEAN - #include - typedef struct rc_mutex_t { - #if defined(WINVER) && WINVER >= 0x0600 - /* Windows Vista and later can use a slim reader/writer (SRW) lock */ - SRWLOCK srw_lock; - /* Current thread owner needs to be tracked (for recursive mutex usage) */ - DWORD owner; - DWORD count; - #else + #if defined(_WIN32) + typedef struct rc_mutex_t { + #if defined(WINVER) && WINVER >= 0x0600 + /* Windows Vista and later can use a slim reader/writer (SRW) lock */ + SRWLOCK srw_lock; + /* Current thread owner needs to be tracked (for recursive mutex usage) */ + DWORD owner; + DWORD count; + #else /* Pre-Vista must use a critical section */ - CRITICAL_SECTION critical_section; - #endif - } rc_mutex_t; + CRITICAL_SECTION critical_section; + #endif + } rc_mutex_t; #elif defined(GEKKO) #include typedef mutex_t rc_mutex_t;