Skip to content

Commit 821bc0b

Browse files
committed
uv_getnameinfo const wrapper harmful on ctypes 0.23.0
Fixes #159.
1 parent ae9ee9b commit 821bc0b

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/c/helpers.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ static void luv_getaddrinfo_trampoline(
181181
}
182182

183183
static void luv_getnameinfo_trampoline(
184-
uv_getnameinfo_t *c_request, int status, char *hostname, char *service)
184+
uv_getnameinfo_t *c_request, int status, const char *hostname,
185+
const char *service)
185186
{
186187
caml_acquire_runtime_system();
187188
value callback;
@@ -413,7 +414,7 @@ uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline(void)
413414
return luv_getaddrinfo_trampoline;
414415
}
415416

416-
luv_getnameinfo_cb luv_get_getnameinfo_trampoline(void)
417+
uv_getnameinfo_cb luv_get_getnameinfo_trampoline(void)
417418
{
418419
return luv_getnameinfo_trampoline;
419420
}
@@ -619,15 +620,6 @@ int luv_fs_poll_start(
619620
return uv_fs_poll_start(handle, (uv_fs_poll_cb)poll_cb, path, interval);
620621
}
621622

622-
int luv_getnameinfo(
623-
uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb,
624-
const struct sockaddr *addr, int flags)
625-
{
626-
return
627-
uv_getnameinfo(
628-
loop, req, (uv_getnameinfo_cb)getnameinfo_cb, addr, flags);
629-
}
630-
631623
int luv_read_start(
632624
uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb)
633625
{

src/c/helpers.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ typedef void (*luv_fs_event_cb)(
5555
typedef void (*luv_fs_poll_cb)(
5656
uv_fs_poll_t *handle, int status, uv_stat_t *prev, uv_stat_t *curr);
5757

58-
typedef void (*luv_getnameinfo_cb)(
59-
uv_getnameinfo_t *req, int status, char *hostname, char *service);
60-
6158
typedef void (*luv_read_cb)(uv_stream_t *stream, ssize_t nread, uv_buf_t *buf);
6259

6360
typedef void (*luv_udp_recv_cb)(
@@ -78,7 +75,7 @@ uv_fs_cb luv_null_fs_callback_pointer(void);
7875
luv_fs_event_cb luv_get_fs_event_trampoline(void);
7976
luv_fs_poll_cb luv_get_fs_poll_trampoline(void);
8077
uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline(void);
81-
luv_getnameinfo_cb luv_get_getnameinfo_trampoline(void);
78+
uv_getnameinfo_cb luv_get_getnameinfo_trampoline(void);
8279
uv_idle_cb luv_get_idle_trampoline(void);
8380
luv_once_cb luv_get_once_trampoline(void);
8481
uv_poll_cb luv_get_poll_trampoline(void);
@@ -173,10 +170,6 @@ int luv_fs_poll_start(
173170
uv_fs_poll_t *handle, luv_fs_poll_cb poll_cb, const char *path,
174171
unsigned int interval);
175172

176-
int luv_getnameinfo(
177-
uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb,
178-
const struct sockaddr *addr, int flags);
179-
180173
int luv_read_start(
181174
uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb);
182175

src/c/luv_c_function_descriptions.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ struct
13531353
(void @-> returning trampoline)
13541354

13551355
let getnameinfo =
1356-
foreign "luv_getnameinfo"
1356+
foreign "uv_getnameinfo"
13571357
(ptr Loop.t @->
13581358
ptr t @->
13591359
trampoline @->

0 commit comments

Comments
 (0)