[前][次][番号順一覧][スレッド一覧]

ruby-changes:19311

From: nobu <ko1@a...>
Date: Wed, 27 Apr 2011 00:50:18 +0900 (JST)
Subject: [ruby-changes:19311] Ruby:r31351 (trunk): * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64

nobu	2011-04-27 00:50:09 +0900 (Wed, 27 Apr 2011)

  New Revision: 31351

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31351

  Log:
    * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
      versions on mingw are useless because they use int32_t.  fixes #4564

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/include/ruby/win32.h

Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 31350)
+++ include/ruby/win32.h	(revision 31351)
@@ -101,6 +101,9 @@
 #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 @@
 
 #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
 
 //
Index: configure.in
===================================================================
--- configure.in	(revision 31350)
+++ configure.in	(revision 31351)
@@ -1301,6 +1301,7 @@
 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\
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31350)
+++ ChangeLog	(revision 31351)
@@ -1,3 +1,8 @@
+Wed Apr 27 00:50:06 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@d...>
 
 	* ext/date/date_core.c (dt_lite_set_tmx): should get df value.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]