summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ruby/missing.h16
-rw-r--r--include/ruby/ruby.h8
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 */