Skip to content

Commit 1e37e2c

Browse files
authored
Merge pull request #25 from antoyo/feature/output-ident
Add support for setting the output ident
2 parents c52a218 + d4b71ef commit 1e37e2c

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
@@ -655,4 +655,7 @@ extern {
655655

656656
#[cfg(feature="master")]
657657
pub fn gcc_jit_context_new_sizeof(ctxt: *mut gcc_jit_context, typ: *mut gcc_jit_type) -> *mut gcc_jit_rvalue;
658+
659+
#[cfg(feature="master")]
660+
pub fn gcc_jit_context_set_output_ident(ctxt: *mut gcc_jit_context, output_ident: *const c_char);
658661
}

src/context.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ impl<'ctx> Context<'ctx> {
194194
}
195195
}
196196

197+
#[cfg(feature="master")]
198+
pub fn set_output_ident(&self, ident: &str) {
199+
let c_str = CString::new(ident).unwrap();
200+
unsafe {
201+
gccjit_sys::gcc_jit_context_set_output_ident(self.ptr, c_str.as_ptr());
202+
}
203+
}
204+
197205
pub fn set_debug_info(&self, value: bool) {
198206
unsafe {
199207
gccjit_sys::gcc_jit_context_set_bool_option(self.ptr,

0 commit comments

Comments
 (0)