[Pythonmac-SIG] Macho, socketmodule

Jack Jansen Jack.Jansen@cwi.nl
Mon, 8 Jul 2002 11:26:35 +0200


On Monday, July 8, 2002, at 09:53 , Doug Wyatt wrote:

> But when I try to link libpython2.2.a into my Cocoa app, I get link 
> errors because freeaddrinfo and gai_strerror are multiply defined.  I 
> find that socketmodule has some __APPLE__-specific mods to include 
> getaddrinfo.c, which defines these symbols, which are also define in 
> libSystem.dylib, which Cocoa apps link against.
>
> grepping the source tree, I see that getaddrinfo.c is only used when 
> included from socketmodule.c, and in Mac/Distributions/dev.include, 
> which I suspect isn't used because I removed the Mac directory, not 
> caring about access to the classic Mac toolbox in my Python.

getaddrinfo() is a bit funny under 10.1, as it exists in the standard C 
library but doesn't really work. Declaring it as static in getaddrinfo.c 
should probably work, that C file is #include'd into socketmodule.c.

And I have reason to believe that the getaddrinfo problem will disappear 
in the next version of OSX.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -