Use Windows threads library with mingw

Instead of Posix threads. This seems to fix time
losses of the gcc compiled version for Windows.
The patch replaces the MSVC specific _MSC_VER flag
with _WIN32 and _WIN64 that are defined both by
MSVC and mingw-gcc.

Workaround found by Jim Ablett.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-01-25 06:29:30 +01:00
parent 24b25b4827
commit a189a5f0c5
4 changed files with 14 additions and 12 deletions

View File

@@ -20,7 +20,7 @@
#if !defined(LOCK_H_INCLUDED)
#define LOCK_H_INCLUDED
#if !defined(_MSC_VER)
#if !defined(_WIN32) && !defined(_WIN64)
# include <pthread.h>
@@ -42,7 +42,10 @@ typedef pthread_t ThreadHandle;
#else
#define NOMINMAX // disable macros min() and max()
#if !defined(NOMINMAX)
# define NOMINMAX // disable macros min() and max()
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN