ruby-changes:28672
From: nobu <ko1@a...>
Date: Tue, 14 May 2013 17:25:08 +0900 (JST)
Subject: [ruby-changes:28672] nobu:r40724 (trunk): iphlpapi is unavailable with older VC
nobu 2013-05-14 17:24:58 +0900 (Tue, 14 May 2013) New Revision: 40724 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40724 Log: iphlpapi is unavailable with older VC * include/ruby/win32.h, win32/Makefile.sub, win32/win32.c: iphlpapi is not available with older Visual C. works with VC9 or later at least. Modified files: trunk/include/ruby/win32.h trunk/win32/Makefile.sub trunk/win32/win32.c Index: include/ruby/win32.h =================================================================== --- include/ruby/win32.h (revision 40723) +++ include/ruby/win32.h (revision 40724) @@ -37,7 +37,9 @@ extern "C++" { /* template without ext https://github.com/ruby/ruby/blob/trunk/include/ruby/win32.h#L37 #endif #include <winsock2.h> #include <ws2tcpip.h> +#if !defined(_MSC_VER) || _MSC_VER >= 1400 #include <iphlpapi.h> +#endif #if defined(__cplusplus) && defined(_MSC_VER) } #endif Index: win32/win32.c =================================================================== --- win32/win32.c (revision 40723) +++ win32/win32.c (revision 40724) @@ -3736,6 +3736,7 @@ socketpair(int af, int type, int protoco https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L3736 return 0; } +#if !defined(_MSC_VER) || _MSC_VER >= 1400 /* License: Ruby's */ static void str2guid(const char *str, GUID *guid) @@ -3879,6 +3880,7 @@ freeifaddrs(struct ifaddrs *ifp) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L3880 ifp = next; } } +#endif // // Networking stubs Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 40723) +++ win32/Makefile.sub (revision 40724) @@ -227,7 +227,11 @@ EXTLIBS = https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L227 EXTSOLIBS = !endif !if !defined(LIBS) -LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib iphlpapi.lib imagehlp.lib shlwapi.lib $(EXTLIBS) +LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib +!if $(MSC_VER) >= 1400 +LIBS = $(LIBS) iphlpapi.lib +!endif +LIBS = $(LIBS) imagehlp.lib shlwapi.lib $(EXTLIBS) !endif !if !defined(MISSING) MISSING = acosh.obj cbrt.obj crypt.obj erf.obj ffs.obj langinfo.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32/win32.obj win32/file.obj setproctitle.obj -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/