New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: 'sockaddr_in' was not declared in this scope #83
Comments
the right fix is probably to just |
That would work too, for IPv4 connections, but not for IPv6 (unless the implementation happens to have lots of spare room in sockaddr_in). |
usually one uses sockaddr_storage, to fit in both sockaddr_in and sockaddr_in6. |
@rofl0r using sockaddr_storage was a good tip. |
Yes, that looks sufficient. (given my build environment I just tested it by replacing the |
I'm packaging fs-uae-2.7.2dev for in pkgsrc-wip (now available via http://pkgsrc.org/wip/ ). Compiling on NetBSD I ran into the following:
Looking into this, I found that the only use of sockaddr_in is in this fragment:
sa_len
should be the value fromstruct addrinfo.ai_addrlen
.if you're not interested in the value, like here, just use a dummy size. My manual doesn't say what happens if the value is too small, so using a size at least big enough for IPv6 addresses is probably wise.
I stubbed in 64 and with that there were no more build complaints.
The text was updated successfully, but these errors were encountered: