Skip to content

Commit

Permalink
Also block rd_kafka_conf_set_resolve_cb, as it also depends on addrinfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidblewett committed Aug 25, 2023
1 parent d166014 commit 405806f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
16 changes: 1 addition & 15 deletions rdkafka-sys/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* automatically generated by rust-bindgen 0.66.1 */

use libc::{addrinfo, c_char, c_int, c_void, sockaddr, FILE};
use libc::{c_char, c_int, c_void, sockaddr, FILE};
use num_enum::TryFromPrimitive;

pub const RD_KAFKA_VERSION: i32 = 33685759;
Expand Down Expand Up @@ -853,20 +853,6 @@ extern "C" {
closesocket_cb: Option<unsafe extern "C" fn(sockfd: c_int, opaque: *mut c_void) -> c_int>,
);
}
extern "C" {
pub fn rd_kafka_conf_set_resolve_cb(
conf: *mut rd_kafka_conf_t,
resolve_cb: Option<
unsafe extern "C" fn(
node: *const c_char,
service: *const c_char,
hints: *const addrinfo,
res: *mut *mut addrinfo,
opaque: *mut c_void,
) -> c_int,
>,
);
}
extern "C" {
pub fn rd_kafka_conf_set_ssl_cert_verify_cb(
conf: *mut rd_kafka_conf_t,
Expand Down
11 changes: 6 additions & 5 deletions rdkafka-sys/update-bindings.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

# rd_kafka_conf_set_open_cb is blocklisted because it is not compiled on
# Windows due to its usage of the Unix-only `mode_t` type. With a bit of
# elbow grease we could include it if not targeting Windows, but it doesn't
# seem worthwhile at the moment.
# rd_kafka_conf_set_open_cb/rd_kafka_conf_set_resolve_cb are blocklisted
# because it is not compiled on Windows due to its usage of the Unix-only
# `mode_t` type. With a bit of elbow grease we could include it if not
# targeting Windows, but it doesn't seem worthwhile at the moment.

bindgen \
--no-doc-comments \
Expand All @@ -14,7 +14,8 @@ bindgen \
--allowlist-var "rd_kafka.*|RD_KAFKA_.*" \
--no-recursive-allowlist \
--blocklist-function "rd_kafka_conf_set_open_cb" \
--raw-line "use libc::{FILE, addrinfo, sockaddr, c_int, c_void, c_char};" \
--blocklist-function "rd_kafka_conf_set_resolve_cb" \
--raw-line "use libc::{FILE, sockaddr, c_int, c_void, c_char};" \
--raw-line "use num_enum::TryFromPrimitive;" \
--default-macro-constant-type "signed" \
"bindings.h" -o "src/bindings.rs"
Expand Down

0 comments on commit 405806f

Please sign in to comment.