summaryrefslogtreecommitdiff
path: root/dev-lang/ruby/files/3.2/017-socket-add-full-prototype.patch
blob: a61a2d5aa0fb5e4b9d9f1875124062d33dd3c7af (plain)
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
https://github.com/ruby/ruby/commit/d77e02bd85ab7f841df8d473bac214b9a92a3506

From d77e02bd85ab7f841df8d473bac214b9a92a3506 Mon Sep 17 00:00:00 2001
From: "Z. Liu" <zhixu.liu@gmail.com>
Date: Wed, 2 Jul 2025 09:09:52 +0800
Subject: [PATCH] [Bug #21497] [ruby/socket]: add full prototype
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

otherwise, gcc 15 will complain:

> init.c:573:19: error: too many arguments to function ‘Rconnect’; expected 0, have 3
>   573 |     return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len);
>       |                   ^~~~~~~~ ~~~~~~~
> In file included from init.c:11:
> rubysocket.h:294:5: note: declared here
>   294 | int Rconnect();
>       |     ^~~~~~~~

> sockssocket.c:33:9: error: too many arguments to function ‘SOCKSinit’; expected 0, have 1
>    33 |         SOCKSinit("ruby");
>       |         ^~~~~~~~~ ~~~~~~
> In file included from sockssocket.c:11:
> rubysocket.h:293:6: note: declared here
>   293 | void SOCKSinit();
>       |      ^~~~~~~~~

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>

diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 54a5381da4..dcafbe24e3 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -292,8 +292,8 @@ extern VALUE rb_eResolution;
 #ifdef SOCKS
 extern VALUE rb_cSOCKSSocket;
 #  ifndef SOCKS5
-void SOCKSinit();
-int Rconnect();
+void SOCKSinit(char *);
+int Rconnect(int, const struct sockaddr *, socklen_t);
 #  endif
 #endif
 
-- 
2.49.1