dante: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Fri, 12 Jul 2024 20:00:39 +0000 (13:00 -0700)
committerRosen Penev <rosenp@gmail.com>
Tue, 16 Jul 2024 17:21:24 +0000 (10:21 -0700)
Also added some configure fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/dante/Makefile
net/dante/patches/010-gcc14.patch [new file with mode: 0644]

index 535903c8ea69b0d3f0ee2fd81c13178009eefba0..75a9307eeab6f734cebb0b08c6ab2834831ee026 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dante
 PKG_VERSION:=1.4.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.inet.no/dante/files/
diff --git a/net/dante/patches/010-gcc14.patch b/net/dante/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..b1223dd
--- /dev/null
@@ -0,0 +1,55 @@
+--- a/include/osdep.h
++++ b/include/osdep.h
+@@ -218,6 +218,7 @@
+ #endif /* HAVE_STDDEF_H */
+ #if HAVE_PTHREAD_H
++#define _GNU_SOURCE
+ #include <pthread.h>
+ #endif /* HAVE_PTHREAD_H */
+--- a/lib/Rbindresvport.c
++++ b/lib/Rbindresvport.c
+@@ -72,11 +72,11 @@ Rbindresvport(s, _sin)
+    if (_sin == NULL) {
+       slog(LOG_DEBUG, "%s: fd %d, _sin = %p", function, s, _sin);
+-      return bindresvport(s, _sin);
++      return Rbindresvport(s, _sin);
+    }
+    usrsockaddrcpy(&sin, TOSS(_sin), sizeof(*_sin));
+-   if (bindresvport(s, TOIN(&sin)) != 0) {
++   if (Rbindresvport(s, TOIN(&sin)) != 0) {
+       slog(LOG_DEBUG, "%s: bindresvport(%d, %s) failed: %s",
+            function,
+            s,
+--- a/lib/Rconnect.c
++++ b/lib/Rconnect.c
+@@ -433,7 +433,7 @@ Rconnect(s, _name, namelen)
+                TOIN(&socksfd.local)->sin_port = htons(0);
+                /* LINTED pointer casts may be troublesome */
+-               bindresvport(s, TOIN(&socksfd.local));
++               Rbindresvport(s, TOIN(&socksfd.local));
+             }
+             return Rconnect(s, TOSA(&name), namelen);
+--- a/libscompat.m4
++++ b/libscompat.m4
+@@ -34,6 +34,7 @@ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+ #ifndef SIOCGIFHWADDR
+@@ -103,6 +104,7 @@ AC_CHECK_FUNC(getpassphrase,
+ AC_MSG_CHECKING([for sched_setaffinity])
+ AC_TRY_COMPILE([
++#define _GNU_SOURCE
+ #include <sched.h>
+ ],
+ [   cpu_set_t set1;