redefinition of 'struct addrinfo'

1 post / 0 new
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 7 hours ago
Joined: 2013-05-30 00:53
redefinition of 'struct addrinfo'

Tying to crosscimpile I got this error "redefinition of 'struct addrinfo'":
...
CClibavcodec/libopencore-amr.o
In file included from libavformat/avio.c:31:
libavformat/network.h:137:8: error: redefinition of 'struct addrinfo'
137 | struct addrinfo {
| ^~~~~~~~
In file included from libavformat/network.h:66,
from libavformat/avio.c:31:
/opt/sdk/ppc-amigaos/newlib/include/netdb.h:202:8: note: originally defined here
202 | struct addrinfo {
| ^~~~~~~~
make[1]: *** [ffbuild/common.mak:81: libavformat/avio.o] Error 1
...

The diff is in "ai_addrlen" variable:

network.h:
...
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
int ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
...

while netbd.h:
struct addrinfo {
int ai_flags; /* input flags */
int ai_family; /* protocol family for socket */
int ai_socktype; /* socket type */
int ai_protocol; /* protocol for socket */
socklen_t ai_addrlen; /* length of socket-address */
struct sockaddr *ai_addr; /* socket-address for socket */
char *ai_canonname; /* canonical name for service location (iff req) */
struct addrinfo *ai_next; /* pointer to next in list */
};

Is netdb.h "bogus" or?