diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-17 21:33:05 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-17 21:33:05 +0000 |
commit | be41ba3bedef74d484bb25ce263a9ca71a8e0855 (patch) | |
tree | 31fd612aab2860bf3ff165052a2e75730e4eda04 | |
parent | c6c2add36307a84ce12d96aea2df8d7bb27941db (diff) | |
download | ruby-be41ba3bedef74d484bb25ce263a9ca71a8e0855.tar.gz ruby-be41ba3bedef74d484bb25ce263a9ca71a8e0855.tar.xz ruby-be41ba3bedef74d484bb25ce263a9ca71a8e0855.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | include/ruby/missing.h | 8 | ||||
-rw-r--r-- | include/ruby/win32.h | 6 |
3 files changed, 15 insertions, 7 deletions
@@ -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 d553f1c73..61524d2db 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 a7d07083a..7c0da1f49 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 */ |