laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/33256 )

Change subject: Added generation of include/osmocom/core/socket_compat.h
......................................................................

Added generation of include/osmocom/core/socket_compat.h

This file is required to compile header files on machines that do not
have sys/socket.h.

Change-Id: Ia3eafc992221900bbbf1760f669725bf9da92105
---
M configure.ac
M include/osmocom/core/Makefile.am
A include/osmocom/core/socket_compat.h.tpl
3 files changed, 30 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/configure.ac b/configure.ac
index 5e17c7a..ef15f22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,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 syslog.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
 AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DLOPEN="$LIBS";LIBS=""])
diff --git a/include/osmocom/core/Makefile.am b/include/osmocom/core/Makefile.am
index 1d394cd..e1b52d5 100644
--- a/include/osmocom/core/Makefile.am
+++ b/include/osmocom/core/Makefile.am
@@ -62,6 +62,7 @@
        sockaddr_str.h \
        time_cc.h \
        use_count.h \
+       socket_compat.h \
        $(NULL)

 if ENABLE_PLUGIN
@@ -93,3 +94,9 @@
 crc%gen.h: crcXXgen.h.tpl
        $(AM_V_GEN)$(MKDIR_P) $(dir $@)
        $(AM_V_GEN)sed -e's/XX/$*/g' $< > $@
+
+socket_compat.h: socket_compat.h.tpl
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@)
+       $(AM_V_GEN)sed -e's/XX/$(HAVE_SYS_SOCKET_H)/g' $< > $@
+
+EXTRA_DIST = socket_compat.h.tpl
diff --git a/include/osmocom/core/socket_compat.h.tpl 
b/include/osmocom/core/socket_compat.h.tpl
new file mode 100644
index 0000000..43bee9e
--- /dev/null
+++ b/include/osmocom/core/socket_compat.h.tpl
@@ -0,0 +1,10 @@
+#define HAVE_STRUCT_SOCKADDR_STORAGE XX
+
+#if HAVE_STRUCT_SOCKADDR_STORAGE
+       #include <sys/socket.h>
+#else
+struct sockaddr_storage {
+       unsigned short ss_family;
+       char __data[128 - sizeof(unsigned short)];
+};
+#endif

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33256
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia3eafc992221900bbbf1760f669725bf9da92105
Gerrit-Change-Number: 33256
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-CC: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to