Skip to content

Commit 30cd47b

Browse files
authored
Merge pull request #11 from tigercat2000/use-unwind
Use C-unwind in bindgen, mandatory as of rust 1.81
2 parents 7cf278a + 64e0e57 commit 30cd47b

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

crates/byondapi-macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn extract_args(a: &syn::FnArg) -> &syn::PatType {
1313
#[allow(clippy::test_attr_in_doctest)]
1414
/// Macro for generating byond binds
1515
/// Usage:
16-
/// ```
16+
/// ```ignore
1717
/// use byondapi::prelude::*;
1818
/// #[byondapi::bind]
1919
/// fn example() {Ok(ByondValue::null())}
@@ -23,7 +23,7 @@ fn extract_args(a: &syn::FnArg) -> &syn::PatType {
2323
///
2424
/// ```
2525
/// Then generate the bindings.dm file with
26-
/// ```
26+
/// ```ignore
2727
/// #[test]
2828
/// fn generate_binds() {
2929
/// byondapi::byondapi_macros::generate_bindings(env!("CARGO_CRATE_NAME"));

crates/byondapi-rs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "byondapi"
3-
version = "0.4.8"
3+
version = "0.4.9"
44
authors = ["tigercat2000 <[email protected]>"]
55
edition = "2021"
66
description = "Idiomatic Rust bindings for BYONDAPI"
@@ -13,7 +13,7 @@ exclude = [".vscode/*"]
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
byondapi-sys = { path = "../byondapi-sys", version = "0.11.1" }
16+
byondapi-sys = { path = "../byondapi-sys", version = "0.11.2" }
1717
byondapi-macros = { path = "../byondapi-macros", version = "0.1.2" }
1818
libloading = "0.8.4"
1919
inventory = "0.3.15"

crates/byondapi-rs/src/threadsync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ struct CallbackData<F: FnOnce() -> ByondValue + Send> {
77
callback: Option<F>,
88
}
99

10-
extern "C" fn trampoline<F: FnOnce() -> ByondValue + Send>(data: *mut c_void) -> CByondValue {
10+
extern "C-unwind" fn trampoline<F: FnOnce() -> ByondValue + Send>(
11+
data: *mut c_void,
12+
) -> CByondValue {
1113
let data = unsafe { Box::from_raw(data as *mut CallbackData<F>) };
1214
(data.callback.unwrap())().into_inner()
1315
}

crates/byondapi-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "byondapi-sys"
3-
version = "0.11.1"
3+
version = "0.11.2"
44
authors = ["tigercat2000 <[email protected]>"]
55
edition = "2021"
66
description = "Raw bindgen bindings for byondapi"

crates/byondapi-sys/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bindgen::callbacks::ParseCallbacks;
1+
use bindgen::{callbacks::ParseCallbacks, Abi};
22
use std::path::{Path, PathBuf};
33

44
fn main() {
@@ -55,6 +55,7 @@ fn generate_all() {
5555
.header(wrapper.to_string_lossy())
5656
.dynamic_library_name("ByondApi")
5757
.dynamic_link_require_all(true)
58+
.override_abi(Abi::CUnwind, "Byond.*")
5859
// Also make headers included by main header dependencies of the build
5960
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
6061
.parse_callbacks(Box::new(DoxygenCallbacks));

0 commit comments

Comments
 (0)