File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -887,6 +887,19 @@ impl TypedAstContext {
887
887
CExprKind :: Paren ( _ty, e) => {
888
888
self . ast_context . c_exprs [ & e] . kind . get_qual_type ( )
889
889
}
890
+ CExprKind :: UnaryType ( _, op, _, _) => {
891
+ // All of these `UnTypeOp`s should return `size_t`.
892
+ let kind = match op {
893
+ UnTypeOp :: SizeOf => CTypeKind :: Size ,
894
+ UnTypeOp :: AlignOf => CTypeKind :: Size ,
895
+ UnTypeOp :: PreferredAlignOf => CTypeKind :: Size ,
896
+ } ;
897
+ let ty = self
898
+ . ast_context
899
+ . type_for_kind ( & kind)
900
+ . expect ( "CTypeKind::Size should be size_t" ) ;
901
+ Some ( CQualTypeId :: new ( ty) )
902
+ }
890
903
_ => return ,
891
904
} ;
892
905
if let ( Some ( ty) , Some ( new_ty) ) = (
Original file line number Diff line number Diff line change @@ -344,9 +344,7 @@ pub const ZSTD_WINDOWLOG_MAX_32: std::ffi::c_int = unsafe { 30 as std::ffi::c_in
344
344
pub const ZSTD_WINDOWLOG_MAX_64: std ::ffi ::c_int = unsafe { 31 as std::ffi ::c_int };
345
345
#[no_mangle ]
346
346
pub unsafe extern " C" fn test_zstd () - > U64 {
347
- return (if ::core ::mem ::size_of ::<zstd_platform_dependent_type >() as std::ffi::c_ulong
348
- == 4 as std::ffi::c_ulong
349
- {
347
+ return (if ::core ::mem ::size_of ::<zstd_platform_dependent_type >() as usize == 4 as usize {
350
348
ZSTD_WINDOWLOG_MAX_32
351
349
} else {
352
350
ZSTD_WINDOWLOG_MAX_64
@@ -413,7 +411,7 @@ pub unsafe extern "C" fn size_of_const() -> std::ffi::c_int {
413
411
let mut a : [std ::ffi ::c_int ; 10 ] = [0 ; 10 ];
414
412
return SIZE as std ::ffi ::c_int ;
415
413
}
416
- pub const SIZE: std::ffi::c_ulong = unsafe { ::core ::mem ::size_of ::< [std ::ffi ::c_int ; 10 ]> () } ;
414
+ pub const SIZE: usize = unsafe { ::core ::mem ::size_of ::< [std ::ffi ::c_int ; 10 ]> () } ;
417
415
unsafe extern "C" fn run_static_initializers() {
418
416
global_static_const_ptr_arithmetic = PTR_ARITHMETIC ;
419
417
global_static_const_indexing =
You can’t perform that action at this time.
0 commit comments