From fcb102b6508fc03f8a0c5e6fdf070c1e115adc26 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 7 Apr 2012 21:26:33 +0900 Subject: [PATCH] Fixed compile error with i686-w64-mingw32 --- src/array_fun.h | 2 ++ src/common.h | 11 ----------- src/util.cc | 10 +++++----- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/array_fun.h b/src/array_fun.h index 53de2c95..b2b1cb7c 100644 --- a/src/array_fun.h +++ b/src/array_fun.h @@ -35,6 +35,8 @@ #ifndef D_ARRAY_FUN_H #define D_ARRAY_FUN_H +#include "common.h" + #include #include diff --git a/src/common.h b/src/common.h index ce52b712..517d6a63 100644 --- a/src/common.h +++ b/src/common.h @@ -35,17 +35,6 @@ #ifndef D_COMMON_H #define D_COMMON_H -#ifdef __MINGW32__ -# undef SIZE_MAX -# ifndef _OFF_T_ -# define _OFF_T_ -typedef long long _off_t; -# ifndef _NO_OLDNAMES -typedef _off_t off_t; -# endif // !_NO_OLDNAMES -# endif // !_OFF_T_ -#endif // __MINGW32__ - #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/src/util.cc b/src/util.cc index 58ca54b8..548c752b 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1083,14 +1083,14 @@ std::string abbrevSize(int64_t size) } void sleep(long seconds) { -#ifdef HAVE_SLEEP +#if defined(HAVE_WINSOCK2_H) + ::Sleep(seconds * 1000); +#elif HAVE_SLEEP ::sleep(seconds); #elif defined(HAVE_USLEEP) ::usleep(seconds * 1000000); -#elif defined(HAVE_WINSOCK2_H) - ::Sleep(seconds * 1000); #else -#error no sleep function is available (nanosleep?) +# error no sleep function is available (nanosleep?) #endif } @@ -1556,7 +1556,7 @@ void executeHook NULL, NULL, true, - NULL, + 0, NULL, 0, &si,