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 @@ -1049,7 +1049,6 @@ impl<'ctx> Context<'ctx> {
1049
1049
#[ cfg( feature="master" ) ]
1050
1050
/// Creates a new RValue from a sizeof(type).
1051
1051
pub fn new_sizeof < ' a > ( & ' a self , ty : types:: Type < ' a > ) -> RValue < ' a > {
1052
-
1053
1052
unsafe {
1054
1053
let ptr = gccjit_sys:: gcc_jit_context_new_sizeof ( self . ptr , types:: get_ptr ( & ty) ) ;
1055
1054
#[ cfg( debug_assertions) ]
@@ -1060,6 +1059,19 @@ impl<'ctx> Context<'ctx> {
1060
1059
}
1061
1060
}
1062
1061
1062
+ #[ cfg( feature="master" ) ]
1063
+ /// Creates a new RValue from a _Alignof(type).
1064
+ pub fn new_alignof < ' a > ( & ' a self , ty : types:: Type < ' a > ) -> RValue < ' a > {
1065
+ unsafe {
1066
+ let ptr = gccjit_sys:: gcc_jit_context_new_alignof ( self . ptr , types:: get_ptr ( & ty) ) ;
1067
+ #[ cfg( debug_assertions) ]
1068
+ if let Ok ( Some ( error) ) = self . get_last_error ( ) {
1069
+ panic ! ( "{}" , error) ;
1070
+ }
1071
+ rvalue:: from_ptr ( ptr)
1072
+ }
1073
+ }
1074
+
1063
1075
/// Dumps a small C file to the path that can be used to reproduce a series
1064
1076
/// of API calls. You should only ever need to call this if you are debugging
1065
1077
/// an issue in gccjit itself or this library.
You can’t perform that action at this time.
0 commit comments