mirror of https://github.com/aria2/aria2
Fixed compile error with i686-w64-mingw32
parent
840ca5adb6
commit
fcb102b650
|
@ -35,6 +35,8 @@
|
||||||
#ifndef D_ARRAY_FUN_H
|
#ifndef D_ARRAY_FUN_H
|
||||||
#define D_ARRAY_FUN_H
|
#define D_ARRAY_FUN_H
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
|
11
src/common.h
11
src/common.h
|
@ -35,17 +35,6 @@
|
||||||
#ifndef D_COMMON_H
|
#ifndef D_COMMON_H
|
||||||
#define 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
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
10
src/util.cc
10
src/util.cc
|
@ -1083,14 +1083,14 @@ std::string abbrevSize(int64_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
void sleep(long seconds) {
|
void sleep(long seconds) {
|
||||||
#ifdef HAVE_SLEEP
|
#if defined(HAVE_WINSOCK2_H)
|
||||||
|
::Sleep(seconds * 1000);
|
||||||
|
#elif HAVE_SLEEP
|
||||||
::sleep(seconds);
|
::sleep(seconds);
|
||||||
#elif defined(HAVE_USLEEP)
|
#elif defined(HAVE_USLEEP)
|
||||||
::usleep(seconds * 1000000);
|
::usleep(seconds * 1000000);
|
||||||
#elif defined(HAVE_WINSOCK2_H)
|
|
||||||
::Sleep(seconds * 1000);
|
|
||||||
#else
|
#else
|
||||||
#error no sleep function is available (nanosleep?)
|
# error no sleep function is available (nanosleep?)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1556,7 +1556,7 @@ void executeHook
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
true,
|
true,
|
||||||
NULL,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&si,
|
&si,
|
||||||
|
|
Loading…
Reference in New Issue