pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41930?usp=email )
Change subject: configure.ac: Add arpa/inet.h to AC_CHECK_HEADERS
......................................................................
configure.ac: Add arpa/inet.h to AC_CHECK_HEADERS
We use arpa/inet.h in several places in the code, so it's good to look
up for presence even if it's only to debug toolchain compatibility.
Change-Id: Ib2d1fb3efb1dcb429b511698691249c257e00720
---
M configure.ac
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
osmith: Looks good to me, approved
pespin: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/configure.ac b/configure.ac
index 5d1bdec..7cb8727 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,7 +74,7 @@
dnl checks for header files
AC_HEADER_STDC
-AC_CHECK_HEADERS(execinfo.h poll.h sys/select.h sys/socket.h sys/signalfd.h sys/eventfd.h sys/timerfd.h ctype.h netinet/tcp.h netinet/in.h)
+AC_CHECK_HEADERS(arpa/inet.h execinfo.h poll.h sys/select.h sys/socket.h sys/signalfd.h sys/eventfd.h sys/timerfd.h ctype.h netinet/tcp.h netinet/in.h)
AC_CHECK_DECL(HAVE_SYS_SOCKET_H, AC_SUBST(HAVE_SYS_SOCKET_H, 1), AC_SUBST(HAVE_SYS_SOCKET_H, 0))
# for src/conv.c
AC_FUNC_ALLOCA
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41930?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib2d1fb3efb1dcb429b511698691249c257e00720
Gerrit-Change-Number: 41930
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41929?usp=email )
Change subject: socket.h: Include netinet/in.h instead of arpa/inet.h
......................................................................
socket.h: Include netinet/in.h instead of arpa/inet.h
In socket.h we are mainly interested in netinet/int.h, since that's the
one defining INET_ADDRSTRLEN, struct sockaddr_in, struct in_addr, ec.
Header arpa/inet.h usually defines several functions which use those,
like htonl(), inet_ntop(), etc.
See POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/arpa_inet.h.html#…https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html
Change-Id: I03919c4adc962bbcfabc9030c6f12c0e10ff060c
---
M include/osmocom/core/socket.h
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index e9979f5..845efd7 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -12,7 +12,7 @@
#include <stdbool.h>
#include <stddef.h>
-#include <arpa/inet.h>
+#include <netinet/in.h>
#include <osmocom/core/defs.h>
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41929?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I03919c4adc962bbcfabc9030c6f12c0e10ff060c
Gerrit-Change-Number: 41929
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41927?usp=email )
Change subject: osmo_io.h: Avoid including sys/socket.h
......................................................................
osmo_io.h: Avoid including sys/socket.h
sys/socket.h may not always be available (eg. arm-none-eabi toolchain).
In the header file we only really need the forward declaration of struct
msghdr, so simply do that.
Change-Id: I5bcba8f72a2be6161d7782a3100d25a7025341d0
---
M include/osmocom/core/osmo_io.h
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index c428191..525c23c 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -4,14 +4,16 @@
#pragma once
-#include <sys/socket.h>
-
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/utils.h>
+/* struct msghdr is defined in sys/socket.h but that header may not be available.
+ * We only really need a forward declaration here: */
+struct msghdr;
+
/*! \defgroup osmo_io Osmocom I/O interface
* @{
*
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41927?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I5bcba8f72a2be6161d7782a3100d25a7025341d0
Gerrit-Change-Number: 41927
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>