File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -670,4 +670,7 @@ extern {
670
670
#[ cfg( feature="master" ) ]
671
671
pub fn gcc_jit_rvalue_set_location ( rvalue : * mut gcc_jit_rvalue ,
672
672
loc : * mut gcc_jit_location ) ;
673
+
674
+ #[ cfg( feature="master" ) ]
675
+ pub fn gcc_jit_context_new_alignof ( ctxt : * mut gcc_jit_context , typ : * mut gcc_jit_type ) -> * mut gcc_jit_rvalue ;
673
676
}
Original file line number Diff line number Diff line change @@ -1048,7 +1048,6 @@ impl<'ctx> Context<'ctx> {
1048
1048
#[ cfg( feature="master" ) ]
1049
1049
/// Creates a new RValue from a sizeof(type).
1050
1050
pub fn new_sizeof < ' a > ( & ' a self , ty : types:: Type < ' a > ) -> RValue < ' a > {
1051
-
1052
1051
unsafe {
1053
1052
let ptr = gccjit_sys:: gcc_jit_context_new_sizeof ( self . ptr , types:: get_ptr ( & ty) ) ;
1054
1053
#[ cfg( debug_assertions) ]
@@ -1059,6 +1058,19 @@ impl<'ctx> Context<'ctx> {
1059
1058
}
1060
1059
}
1061
1060
1061
+ #[ cfg( feature="master" ) ]
1062
+ /// Creates a new RValue from a _Alignof(type).
1063
+ pub fn new_alignof < ' a > ( & ' a self , ty : types:: Type < ' a > ) -> RValue < ' a > {
1064
+ unsafe {
1065
+ let ptr = gccjit_sys:: gcc_jit_context_new_alignof ( self . ptr , types:: get_ptr ( & ty) ) ;
1066
+ #[ cfg( debug_assertions) ]
1067
+ if let Ok ( Some ( error) ) = self . get_last_error ( ) {
1068
+ panic ! ( "{}" , error) ;
1069
+ }
1070
+ rvalue:: from_ptr ( ptr)
1071
+ }
1072
+ }
1073
+
1062
1074
/// Dumps a small C file to the path that can be used to reproduce a series
1063
1075
/// of API calls. You should only ever need to call this if you are debugging
1064
1076
/// an issue in gccjit itself or this library.
You can’t perform that action at this time.
0 commit comments