diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-22 03:05:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-22 03:05:20 +0000 |
commit | da84596d07b73ee45110050b4d084a02a29a43f1 (patch) | |
tree | edd09e0e5530a5ad7300a96b8344dbcd3a7079cd /win32 | |
parent | 274f2858c39b80d975960b177845ef360c207ce6 (diff) | |
download | ruby-da84596d07b73ee45110050b4d084a02a29a43f1.tar.gz ruby-da84596d07b73ee45110050b4d084a02a29a43f1.tar.xz ruby-da84596d07b73ee45110050b4d084a02a29a43f1.zip |
* configure.in (mingw): no longer uses snprintf and vsnprintf of
msvcrt.
* win32/win32.c (rb_w32_vsnprintf, rb_w32_snprintf): removed.
* win32/Makefile.sub (config.h): vsnprintf exists in VC7 or later.
* win32/mkexports.rb (Exports#initialize): aliases
rb_w32_vsnprintf and rb_w32_snprintf for binary compatibility.
* sprintf.c (rb_str_format): uses snprintf instead of sprintf.
* numeric.c (flo_to_s, rb_num2long, rb_num2ll): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile.sub | 2 | ||||
-rwxr-xr-x | win32/mkexports.rb | 2 | ||||
-rw-r--r-- | win32/win32.c | 20 |
3 files changed, 4 insertions, 20 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 57864b46d..96dbfebc8 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -423,7 +423,9 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_STRTOUL 1 #define HAVE_FLOCK 1 #define HAVE_SNPRINTF 1 +!if $(MSC_VER) >= 1300 #define HAVE_VSNPRINTF 1 +!endif #define HAVE_ISNAN 1 #define HAVE_FINITE 1 #define HAVE_HYPOT 1 diff --git a/win32/mkexports.rb b/win32/mkexports.rb index 2ed251ec1..adf0c5e33 100755 --- a/win32/mkexports.rb +++ b/win32/mkexports.rb @@ -51,6 +51,8 @@ class Exports end end syms["NtInitialize"] ||= "ruby_sysinit" if syms["ruby_sysinit"] + syms["rb_w32_vsnprintf"] ||= "vsnprintf" + syms["rb_w32_snprintf"] ||= "snprintf" @syms = syms end diff --git a/win32/win32.c b/win32/win32.c index 6cffc21ad..9697c8ec6 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4553,26 +4553,6 @@ rb_w32_utime(const char *path, const struct utimbuf *times) } int -rb_w32_vsnprintf(char *buf, size_t size, const char *format, va_list va) -{ - int ret = _vsnprintf(buf, size, format, va); - if (size > 0) buf[size - 1] = 0; - return ret; -} - -int -rb_w32_snprintf(char *buf, size_t size, const char *format, ...) -{ - int ret; - va_list va; - - va_start(va, format); - ret = vsnprintf(buf, size, format, va); - va_end(va); - return ret; -} - -int rb_w32_mkdir(const char *path, int mode) { int ret = -1; |