From 2c02415f97743f332b227ccd82e66a51de59210c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 16 Jun 2008 13:18:26 +0000 Subject: [PATCH] 2008-06-16 Tatsuhiro Tsujikawa Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this change, a2io.h and common.h were modified. * src/a2io.h: Changed seek/stat/tell calls to use 64 bit versions in MinGW. * src/common.h: Changed off_t to 64 bit in MinGW. --- ChangeLog | 8 ++++++++ src/a2io.h | 13 +++++++++++-- src/common.h | 7 +++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b140b6a5..beb90d72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-16 Tatsuhiro Tsujikawa + + Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this change, + a2io.h and common.h were modified. + * src/a2io.h: Changed seek/stat/tell calls to use 64 bit versions in + MinGW. + * src/common.h: Changed off_t to 64 bit in MinGW. + 2008-06-16 Tatsuhiro Tsujikawa Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this commit, diff --git a/src/a2io.h b/src/a2io.h index 9cce6910..54ffe82e 100644 --- a/src/a2io.h +++ b/src/a2io.h @@ -95,7 +95,7 @@ # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif /* S_IRWXO */ -// Use 'null' instead of /dev/null in win32. +// Use 'nul' instead of /dev/null in win32. #ifdef HAVE_WINSOCK2_H # define DEV_NULL "nul" #else @@ -110,7 +110,16 @@ #endif // HAVE_WINSOCK2_H #ifdef __MINGW32__ -# define lseek(a, b, c) _lseeki64((a), (b), (c)) +# define lseek(fd, offset, origin) _lseeki64(fd, offset, origin) +# define fseek(fd, offset, origin) _fseeki64(fd, offset, origin) +# define fstat(fd, buf) _fstati64(fd, buf) +# define ftell(fd) _ftelli64(fd) +# define wstat(path, buf) _wstati64(path, buf) +# ifdef stat +# undef stat +# endif // stat +# define stat(path, buf) _stati64(path, buf) +# define tell(handle) _telli64(handle) # define a2mkdir(path, openMode) mkdir(path) #else # define a2mkdir(path, openMode) mkdir(path, openMode) diff --git a/src/common.h b/src/common.h index 429e1e52..4096d630 100644 --- a/src/common.h +++ b/src/common.h @@ -37,6 +37,13 @@ #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