summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--include/ruby/missing.h8
-rw-r--r--include/ruby/win32.h6
3 files changed, 15 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8cb5c5c4c2a..56da9cae29b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Jul 18 06:30:35 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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]
+
Sat Jul 18 00:23:47 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* ext/readline/readline.c (Init_readline): rl_catch_signals does
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index d553f1c738e..61524d2db1a 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 a7d07083af3..7c0da1f49f3 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -27,8 +27,14 @@ extern "C" {
// #include <stdarg.h> conflict with varargs.h?
#if !defined(WSAAPI)
+#if defined(__cplusplus) && defined(_MSC_VER)
+extern "C++" { /* template without extern "C++" */
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
+#if defined(__cplusplus) && defined(_MSC_VER)
+}
+#endif
#endif
#define NT 1 /* deprecated */