* include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64

versions on mingw are useless because they use int32_t.  fixes #4564

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-04-26 15:50:09 +00:00
parent 7da3b09e0f
commit fcfc113b04
3 changed files with 36 additions and 7 deletions

View File

@ -1,3 +1,8 @@
Wed Apr 27 00:50:06 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
versions on mingw are useless because they use int32_t. fixes #4564
Wed Apr 27 00:00:37 2011 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_core.c (dt_lite_set_tmx): should get df value.

View File

@ -1301,6 +1301,7 @@ else
fi
AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\
truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\
truncate64 ftruncate64 ftello64 fseeko fseeko64 \
link symlink readlink readdir_r fsync fdatasync fchown posix_fadvise\
setitimer setruid seteuid setreuid setresuid setproctitle socketpair\
setrgid setegid setregid setresgid issetugid pause lchown lchmod\

View File

@ -101,6 +101,9 @@ typedef unsigned int uintptr_t;
#ifndef __MINGW32__
# define mode_t int
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef WIN95
extern DWORD rb_w32_osid(void);
@ -382,21 +385,41 @@ scalb(double a, long b)
#define SUFFIX
#if !defined HAVE_FTRUNCATE || defined(_MSC_VER)
extern int rb_w32_ftruncate(int fd, off_t length);
extern int rb_w32_truncate(const char *path, off_t length);
extern off_t rb_w32_ftello(FILE *stream);
extern int rb_w32_fseeko(FILE *stream, off_t offset, int whence);
#undef HAVE_FTRUNCATE
#define HAVE_FTRUNCATE 1
#if defined HAVE_FTRUNCATE64
#define ftruncate ftruncate64
#else
#define ftruncate rb_w32_ftruncate
#endif
extern int ftruncate(int fd, off_t length);
#if !defined HAVE_TRUNCATE || defined(_MSC_VER)
#undef HAVE_TRUNCATE
#define HAVE_TRUNCATE 1
#if defined HAVE_TRUNCATE64
#define truncate truncate64
#else
#define truncate rb_w32_truncate
#endif
extern int truncate(const char *path, off_t length);
extern int fseeko(FILE *stream, off_t offset, int whence);
#undef HAVE_FSEEKO
#define HAVE_FSEEKO 1
#if defined HAVE_FSEEKO64
#define fseeko fseeko64
#else
#define fseeko rb_w32_fseeko
#endif
#if !defined HAVE_FTELLO || defined(_MSC_VER)
#undef HAVE_FTELLO
#define HAVE_FTELLO 1
#if defined HAVE_FTELLO64
#define ftello ftello64
#else
#define ftello rb_w32_ftello
extern off_t rb_w32_ftello(FILE *stream);
#endif
//