From 436b2f887a937f26f8c4a69c2dc26ad60667aa1e Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 17 Jul 2009 21:33:05 +0000 Subject: * include/ruby/win32.h: include winsock headers in extern "C++" for C++ extension libraries. * include/ruby/missing.h (vsnprintf): workaround for VC++. [ruby-core:23096] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/missing.h | 8 +------- include/ruby/win32.h | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/ruby/missing.h b/include/ruby/missing.h index d553f1c738..61524d2db1 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -151,13 +151,7 @@ RUBY_EXTERN long strtol(const char *, char **, int); 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 +extern int vsnprintf(char *, size_t n, char const *, va_list); #endif #ifndef HAVE_STRLCPY diff --git a/include/ruby/win32.h b/include/ruby/win32.h index a7d07083af..7c0da1f49f 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -27,8 +27,14 @@ extern "C" { // #include conflict with varargs.h? #if !defined(WSAAPI) +#if defined(__cplusplus) && defined(_MSC_VER) +extern "C++" { /* template without extern "C++" */ +#endif #include #include +#if defined(__cplusplus) && defined(_MSC_VER) +} +#endif #endif #define NT 1 /* deprecated */ -- cgit v1.2.3