ruby-changes:19753
From: yugui <ko1@a...>
Date: Mon, 30 May 2011 07:53:57 +0900 (JST)
Subject: [ruby-changes:19753] yugui:r31798 (ruby_1_9_2): merges r31262 and r31264 from trunk into ruby_1_9_2.
yugui 2011-05-30 07:49:27 +0900 (Mon, 30 May 2011) New Revision: 31798 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31798 Log: merges r31262 and r31264 from trunk into ruby_1_9_2. -- Evaluate truncate, ftruncate and ftello existence This corrects mingw-w64 compilation. -- * include/ruby/win32.h: VC doesn't have ftruncate() and others, but ruby needs HAVE_ macros to use our emulation functions. (fix the problem of 31262) Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/configure.in branches/ruby_1_9_2/include/ruby/win32.h branches/ruby_1_9_2/version.h branches/ruby_1_9_2/win32/win32.c Index: ruby_1_9_2/include/ruby/win32.h =================================================================== --- ruby_1_9_2/include/ruby/win32.h (revision 31797) +++ ruby_1_9_2/include/ruby/win32.h (revision 31798) @@ -370,12 +370,24 @@ // #define SUFFIX + +#if !defined HAVE_FTRUNCATE || defined(_MSC_VER) #define ftruncate rb_w32_ftruncate -extern int truncate(const char *path, off_t length); -extern int ftruncate(int fd, off_t length); +extern int rb_w32_ftruncate(int fd, off_t length); +#endif + +#if !defined HAVE_TRUNCATE || defined(_MSC_VER) +#define truncate rb_w32_truncate +extern int rb_w32_truncate(const char *path, off_t length); +#endif + extern int fseeko(FILE *stream, off_t offset, int whence); -extern off_t ftello(FILE *stream); +#if !defined HAVE_FTELLO || defined(_MSC_VER) +#define ftello rb_w32_ftello +extern off_t rb_w32_ftello(FILE *stream); +#endif + // // stubs // Index: ruby_1_9_2/configure.in =================================================================== --- ruby_1_9_2/configure.in (revision 31797) +++ ruby_1_9_2/configure.in (revision 31798) @@ -938,9 +938,7 @@ ac_cv_func_isnan=yes ac_cv_func_finite=yes ac_cv_func_link=yes - ac_cv_func_truncate=yes ac_cv_func_fseeko=yes - ac_cv_func_ftello=yes ac_cv_lib_crypt_crypt=no ac_cv_func_getpgrp_void=no ac_cv_func_setpgrp_void=yes @@ -1187,7 +1185,7 @@ AC_LIBOBJ([signbit]) fi AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot getcwd eaccess\ - truncate ftruncate chsize times utimes utimensat fcntl lockf lstat\ + truncate ftruncate ftello chsize times utimes utimensat fcntl lockf lstat\ link symlink readlink readdir_r fsync fdatasync fchown\ setitimer setruid seteuid setreuid setresuid setproctitle socketpair\ setrgid setegid setregid setresgid issetugid pause lchown lchmod\ Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 31797) +++ ruby_1_9_2/ChangeLog (revision 31798) @@ -1,3 +1,17 @@ +Tue Apr 12 10:37:39 2011 NAKAMURA Usaku <usa@r...> + + * include/ruby/win32.h: VC doesn't have ftruncate() and others, but + ruby needs HAVE_ macros to use our emulation functions. + (fix the problem of 31262) + +Tue Apr 12 01:33:00 2011 Luis Lavena <luislavena@g...> + + * configure.in: properly evaluate existence of truncate, ftruncate + and ftello for MinGW. [ruby-core:35678] + * win32/win32.c: rename truncate, ftruncate and ftello to avoid + redefinitions. + * win32/win32.h: ditto. + Fri Apr 8 16:01:56 2011 NARUSE, Yui <naruse@r...> * ext/stringio/stringio.c (strio_getline): check whether str is Index: ruby_1_9_2/win32/win32.c =================================================================== --- ruby_1_9_2/win32/win32.c (revision 31797) +++ ruby_1_9_2/win32/win32.c (revision 31798) @@ -4332,7 +4332,7 @@ } int -truncate(const char *path, off_t length) +rb_w32_truncate(const char *path, off_t length) { HANDLE h; int ret; @@ -4358,7 +4358,7 @@ } int -ftruncate(int fd, off_t length) +rb_w32_ftruncate(int fd, off_t length) { HANDLE h; @@ -4431,7 +4431,7 @@ } off_t -ftello(FILE *stream) +rb_w32_ftello(FILE *stream) { off_t pos; if (fgetpos(stream, (fpos_t *)&pos)) return (off_t)-1; Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 31797) +++ ruby_1_9_2/version.h (revision 31798) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 225 +#define RUBY_PATCHLEVEL 226 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/