[ruby-core:32763] Re: [Ruby-Bug#3802] freeaddrinfo not found in WS2_32.dll

From: Heesob Park <phasis@...>
Date: 2010-10-13 01:51:21 UTC
List: ruby-core #32763
Hi,

2010/10/13 Usaku NAKAMURA <redmine@ruby-lang.org>:
> Issue #3802 has been updated by Usaku NAKAMURA.
>
>
> There is no problem with VC.
> So, this is a field of the maintainer of MinGW port.
> If you want to be the maintainer of MinGW port, you have to solve
> problems just like this by yourself.
>
Are you sure that there is no problem with VC?

When I try with ----enable-wide-getaddrinfo with VC9, it fails to make
like this:

compiling socket
        cl -nologo -I. -I../../.ext/include/i386-mswin32_90 -I../.././include -I
../.././ext/socket -MD -Zi -W2 -wd4996 -O2sy-  -Zm600
-DRUBY_EXTCONF_H=\"extconf.h\" -I. -Foinit.obj -c -Tcinit.c init.c
c:\work\snapshot\ext\socket\addrinfo.h(175) : error C2373:
'freeaddrinfo' redefinition; different type modifiers.
        C:\Program Files\Microsoft
SDKs\Windows\v6.0A\include\ws2tcpip.h(414) : see declaration of
'freeaddrinfo'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '.\miniruby.exe' : return code '0x1'
Stop.

Here is a patch for VC.

--- addrinfo.h  2010-10-13 10:46:59.000000000 +0900
+++ addrinfo.h.new      2010-10-13 10:35:35.000000000 +0900
@@ -172,7 +172,7 @@
        int flags));

 extern void freehostent __P((struct hostent *));
-extern void freeaddrinfo __P((struct addrinfo *));
+extern void WSAAPI freeaddrinfo __P((struct addrinfo *));
 extern
 #ifdef GAI_STRERROR_CONST
 const


--- getaddrinfo.c       2010-10-13 10:46:59.000000000 +0900
+++ getaddrinfo.c.new   2010-10-13 10:35:30.000000000 +0900
@@ -207,7 +207,7 @@
 }
 #endif

-void
+void WSAAPI
 freeaddrinfo(struct addrinfo *ai)
 {
        struct addrinfo *next;

In This Thread