summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:49:27 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-29 22:49:27 +0000
commitd4e840bf26f5570d2d87dca24ae4d2a0268f3b85 (patch)
treef5d002cefd610e79b051ea7ce2dcddb19b7429e8 /include
parent7ffffab2363364d451952d437ebed2686e51f06a (diff)
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) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/win32.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 47a85270a5..32de53f7ec 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -370,11 +370,23 @@ scalb(double a, long b)
//
#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