public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6288] libcody: Include <netinet/in.h> as needed
@ 2020-12-21 16:13 Gerald Pfeifer
0 siblings, 0 replies; only message in thread
From: Gerald Pfeifer @ 2020-12-21 16:13 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cf22f78ff6ead2b1f022d7e7367daedf459aa355
commit r11-6288-gcf22f78ff6ead2b1f022d7e7367daedf459aa355
Author: Gerald Pfeifer <gerald@pfeifer.com>
Date: Mon Dec 21 00:21:13 2020 +0100
libcody: Include <netinet/in.h> as needed
libcody as originally added to GCC fail to build on *-unknown-freebsd11.4
and presumably others:
c++ -std=c++11 -g -include config.h -I ... -MMD -MP -MF netclient.d -c
-o netclient.o
.../libcody/netclient.cc:114:3: error: unknown type sockaddr_in6 addr;
^~~~~~~~~~~~
sockaddr_in6 is declared in /usr/include/netinet6/in6.h,
which is included by /usr/include/netinet/in.h.
Indeed, per https://man7.org/linux/man-pages/man7/ipv6.7.html
#include <sys/socket.h>
#include <netinet/in.h>
should be included, and our own gcc/ada/gsocket.h also has
#if !(defined (VMS) || defined (__MINGW32__))
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
:
#endif
libcody/ChangeLog:
2020-12-21 Gerald Pfeifer <gerald@pfeifer.com>
* netserver.cc: Include <netinet/in.h>.
Diff:
---
libcody/netserver.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcody/netserver.cc b/libcody/netserver.cc
index 7e43eb033f4..30202c5106a 100644
--- a/libcody/netserver.cc
+++ b/libcody/netserver.cc
@@ -12,6 +12,7 @@
#include <netdb.h>
#include <unistd.h>
#include <arpa/inet.h>
+#include <netinet/in.h>
#include <sys/un.h>
#ifndef AI_NUMERICSERV
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-21 16:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 16:13 [gcc r11-6288] libcody: Include <netinet/in.h> as needed Gerald Pfeifer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).