Thread: Still more #ifdef fun: struct sockaddr_storage

Still more #ifdef fun: struct sockaddr_storage

From
Tom Lane
Date:
pgcheckdefines reports

src/port/getaddrinfo.c references HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN, defined in src/include/libpq/pqcomm.h

I think this is an actual bug: if we have a platform that calls its
struct sockaddr_storage member __ss_len, and we are using our own
getaddrinfo code, we will fail to initialize the length member of
the returned ai_addr struct.

It would be safe to include src/include/libpq/pqcomm.h into
getaddrinfo.c, but it seems a tad ugly.  Perhaps the machinations
in pqcomm.h to normalize the sockaddr_storage names ought to be
moved into a separate header file?  If so, where to put it?
        regards, tom lane