File: 0001-Fixes-for-new-GCC.patch

package info (click to toggle)
bglibs 2.04%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,500 kB
  • sloc: ansic: 15,824; perl: 674; sh: 63; makefile: 29
file content (112 lines) | stat: -rw-r--r-- 3,193 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
From 689e91c2bd499f9bd36bfbae9d9f6054e175bfe6 Mon Sep 17 00:00:00 2001
From: Alexey Sokolov <alexey@asokolov.org>
Date: Sat, 22 Feb 2025 16:21:57 +0000
Subject: Fixes for new GCC

Close #3
---
 include/resolve.h      | 2 +-
 net/resolve_calldns.c  | 2 +-
 net/resolve_ipv4addr.c | 6 +++++-
 sys/hassysselect.h0    | 1 -
 sys/hassysselect.h1    | 1 -
 sys/hasvfork.h0        | 1 -
 sys/hasvfork.h1        | 2 --
 7 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/resolve.h b/include/resolve.h
index 186f5d9..f71cab0 100644
--- a/include/resolve.h
+++ b/include/resolve.h
@@ -26,7 +26,7 @@ extern int __resolve_error;
 #define resolve_error() (__resolve_error)
 
 struct dns_result;
-extern int resolve_calldns(int (*dnsfn)(), struct dns_result* out, const void* param);
+extern int resolve_calldns(int (*dnsfn)(struct dns_result*, const void*), struct dns_result* out, const void* param);
 extern int resolve_qualdns(int (*dnsfn)(struct dns_transmit*, struct dns_result* out, const char*),
                            struct dns_result* out, const char* name);
 
diff --git a/net/resolve_calldns.c b/net/resolve_calldns.c
index afd5617..a257c88 100644
--- a/net/resolve_calldns.c
+++ b/net/resolve_calldns.c
@@ -5,7 +5,7 @@
 int __resolve_error = 0;
 
 /** Call a dns_* function and save an error code if necessary. */
-int resolve_calldns(int (*dnsfn)(), struct dns_result* out, const void* param)
+int resolve_calldns(int (*dnsfn)(struct dns_result*, const void*), struct dns_result* out, const void* param)
 {
   if (dnsfn(out, param) < 0) {
     __resolve_error = RESOLVE_TEMPFAIL;
diff --git a/net/resolve_ipv4addr.c b/net/resolve_ipv4addr.c
index a9c0d23..d50c3f6 100644
--- a/net/resolve_ipv4addr.c
+++ b/net/resolve_ipv4addr.c
@@ -1,11 +1,15 @@
 #include "dns.h"
 #include "resolve.h"
 
+static int dns_name4_wrapper(struct dns_result *res, const void *ptr) {
+  return dns_name4(res, (const ipv4addr*)ptr);
+}
+
 /** Look up the domain name corresponding to an IPv4 address. */
 const char* resolve_ipv4addr(const ipv4addr* addr)
 {
   static struct dns_result out = {0};
-  if (!resolve_calldns(dns_name4, &out, addr))
+  if (!resolve_calldns(dns_name4_wrapper, &out, addr))
     return 0;
   return out.rr.name[0];
 }
diff --git a/sys/hassysselect.h0 b/sys/hassysselect.h0
index b4820e2..2e4d293 100644
--- a/sys/hassysselect.h0
+++ b/sys/hassysselect.h0
@@ -4,6 +4,5 @@
 /* sysdep: -sysselect */
 
 #include <sys/time.h>
-extern int select();
 
 #endif
diff --git a/sys/hassysselect.h1 b/sys/hassysselect.h1
index 5b97903..154eaea 100644
--- a/sys/hassysselect.h1
+++ b/sys/hassysselect.h1
@@ -5,6 +5,5 @@
 
 #include <sys/time.h>
 #include <sys/select.h>
-extern int select();
 
 #endif
diff --git a/sys/hasvfork.h0 b/sys/hasvfork.h0
index a05ad87..174123f 100644
--- a/sys/hasvfork.h0
+++ b/sys/hasvfork.h0
@@ -2,7 +2,6 @@
 #define FORK_H
 
 /* sysdep: -vfork */
-extern pid_t fork();
 #define vfork fork
 
 #endif
diff --git a/sys/hasvfork.h1 b/sys/hasvfork.h1
index 862eaf8..09ab566 100644
--- a/sys/hasvfork.h1
+++ b/sys/hasvfork.h1
@@ -2,7 +2,5 @@
 #define FORK_H
 
 /* sysdep: +vfork */
-extern pid_t fork();
-extern pid_t vfork();
 
 #endif
-- 
2.30.2