[Python-Dev] socketmodule build failures on Un*xs that don't HAVE_GETADDRINFO

Trent Mick trentm at ActiveState.com
Wed Aug 25 02:16:34 CEST 2004


Building the socket module with the current Python CVS (or at least with
the Python 2.4a2 source) on Solaris 2.6, HP-UX 11, and AIX 5.1 fails in
Modules/getaddrinfo.c with complaints about

    cc: ".../python/Modules/getaddrinfo.c", line 204: error 1588: "EAI_MAX" undefined.

    ".../python/Modules/getaddrinfo.c", line 282.25: 1506-045 (S) Undeclared identifier EAI_BADHINTS.
    ".../python/Modules/getaddrinfo.c", line 283.40: 1506-045 (S) Undeclared identifier AI_MASK.
    ".../python/Modules/getaddrinfo.c", line 373.41: 1506-045 (S) Undeclared identifier EAI_PROTOCOL.

and the like.

The problem seems to stem from this check-in which resulted in
Modules/addrinfo.h *not* getting included for Unix flavours that do not
HAVE_GETADDRINFO.

    http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Modules/socketmodule.c?r1=1.288&r2=1.289
    Wed May 26 17:06:31 2004 UTC (2 months, 4 weeks ago) by mwh 
    > Band-aid type fix for
    > 
    > [ 728330 ] Don't define _SGAPI on IRIX
    > 
    > The Right Thing would be nice, for now this'll do.  At least it
    > isn't going to break anything *other* than IRIX...

Relevant bug:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=728330&group_id=5470

Subseqent checkins have gone in to fix the lack of addrinfo.h import on
some platforms:

    http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Modules/socketmodule.c?r1=1.292&r2=1.293
    http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Modules/socketmodule.c?r1=1.297&r2=1.298

So the question: was that original change removing the 
    #include "addrinfo.h"
an accident? I.e. should it have been something like this instead?

    #if defined(__sgi)
    # if _COMPILER_VERSION>700 \
      && !defined(_SS_ALIGNSIZE) /* defined in sys/socket.h            */
                                 /* by some newer versions of IRIX     */
                                 /* (e.g. not by 6.5.10 but by 6.5.21) */
    #  include "addrinfo.h"
    # endif
    #else
    # include "addrinfo.h"
    #endif

Cheers,
Trent

-- 
Trent Mick
TrentM at ActiveState.com


More information about the Python-Dev mailing list