From d9f4570bddeb4d21e30936991adbc6e9d079ae4e Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 25 Dec 2008 09:51:10 +0000 Subject: merges r20909 and r20910 from trunk into ruby_1_9_1. * 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/missing.h | 6 +++++- include/ruby/win32.h | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/ruby/missing.h b/include/ruby/missing.h index 16d5a6f02b..ea40f62a52 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -144,9 +144,13 @@ RUBY_EXTERN long strtol(const char *, char **, int); #endif */ -#ifndef HAVE_VSNPRINTF +#if defined HAVE_VSNPRINTF || defined HAVE_SNPRINTF # include +#endif +#ifndef HAVE_SNPRINTF RUBY_EXTERN int snprintf(char *, size_t n, char const *, ...); +#endif +#ifndef HAVE_VSNPRINTF RUBY_EXTERN int vsnprintf(char *, size_t n, char const *, va_list); #endif diff --git a/include/ruby/win32.h b/include/ruby/win32.h index bd4d66493b..582348d338 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -243,11 +243,6 @@ extern char **rb_w32_get_environ(void); extern void rb_w32_free_environ(char **); extern int rb_w32_map_errno(DWORD); -#define vsnprintf(s,n,f,l) rb_w32_vsnprintf(s,n,f,l) -#define snprintf rb_w32_snprintf -extern int rb_w32_vsnprintf(char *, size_t, const char *, va_list); -extern int rb_w32_snprintf(char *, size_t, const char *, ...); - extern int chown(const char *, int, int); extern int link(const char *, const char *); extern int gettimeofday(struct timeval *, struct timezone *); -- cgit v1.2.3