Skip to content

Commit d6e5262

Browse files
committed
Add set_global_personality_function_name
1 parent 98a29dd commit d6e5262

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

gccjit_sys/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,4 +621,7 @@ extern {
621621

622622
#[cfg(feature="master")]
623623
pub fn gcc_jit_function_set_personality_function(func: *mut gcc_jit_function, personality_func: *mut gcc_jit_function);
624+
625+
#[cfg(feature="master")]
626+
pub fn gcc_jit_set_global_personality_function_name(name: *const c_char);
624627
}

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ pub use parameter::Parameter;
5252
pub use function::FnAttribute;
5353
pub use function::{Function, FunctionType};
5454
pub use block::{Block, BinaryOp, UnaryOp, ComparisonOp};
55+
56+
#[cfg(feature="master")]
57+
pub fn set_global_personality_function_name(name: &'static [u8]) {
58+
debug_assert!(name.ends_with(&[b'\0']), "Expecting a NUL-terminated C string");
59+
unsafe {
60+
gccjit_sys::gcc_jit_set_global_personality_function_name(name.as_ptr() as *const _);
61+
}
62+
}

0 commit comments

Comments
 (0)