diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-04 01:10:53 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-04 01:10:53 +0000 |
commit | b919cb1d9359121eef893afd1b8af710ed2384bd (patch) | |
tree | bde3093ad1a0394d55a9934f8709abc2e280a1c5 /include | |
parent | 9c50406bd5892c95d76e966c1db8b85c4b5fbe32 (diff) | |
download | ruby-b919cb1d9359121eef893afd1b8af710ed2384bd.tar.gz |
* include/ruby/ruby.h: replace snprintf and vsnprintf by
ruby_snprintf and ruby_vsnprintf. [ruby-dev:40909]
* configure.in: don't check snprintf(3) and vsnprintf(3).
* include/ruby/missing.h: don't delare snprintf and vsnprintf.
* include/ruby/ruby.h: include stdarg.h.
* sprintf.c: include vsnprintf.c
* vsnprintf.c: renamed from missing/vsnprintf.c.
* vsnprintf.c: remove useless ifdefs.
* win32/mkexports.rb: use ruby_snprintf and ruby_vsnprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/missing.h | 16 | ||||
-rw-r--r-- | include/ruby/ruby.h | 8 |
2 files changed, 8 insertions, 16 deletions
diff --git a/include/ruby/missing.h b/include/ruby/missing.h index 4a90032632..e4ac07018f 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -151,22 +151,6 @@ RUBY_EXTERN long strtol(const char *, char **, int); #endif */ -#if defined HAVE_VSNPRINTF || defined HAVE_SNPRINTF -# include <stdarg.h> -#endif -#ifndef HAVE_SNPRINTF -RUBY_EXTERN int snprintf(char *, size_t n, char const *, ...); -#endif -#ifndef HAVE_VSNPRINTF -# if _MSC_VER >= 1300 -# pragma warning(disable: 4273) -# endif -RUBY_EXTERN int vsnprintf(char *, size_t n, char const *, va_list); -# if _MSC_VER >= 1300 -# pragma warning(default: 4273) -# endif -#endif - #ifndef HAVE_STRLCPY RUBY_EXTERN size_t strlcpy(char *, const char*, size_t); #endif diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 5c00c8d155..20f45aee4e 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -67,6 +67,7 @@ extern "C" { # include <inttypes.h> #endif +#include <stdarg.h> #include <stddef.h> #include <stdio.h> @@ -1403,6 +1404,13 @@ unsigned long ruby_strtoul(const char *str, char **endptr, int base); #define InitVM(ext) {void InitVM_##ext(void);InitVM_##ext();} +int ruby_snprintf(char *str, size_t n, char const *fmt, ...); +int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#undef snprintf +#undef vsnprintf +#define snprintf ruby_snprintf +#define vsnprintf ruby_vsnprintf + #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ |