* 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
This commit is contained in:
naruse 2010-04-04 01:10:53 +00:00
parent 9c50406bd5
commit b919cb1d93
7 changed files with 33 additions and 51 deletions

View file

@ -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

View file

@ -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 */