diff --git a/harfbuzz-sys-test/build.rs b/harfbuzz-sys-test/build.rs index bd45c082..6f488852 100644 --- a/harfbuzz-sys-test/build.rs +++ b/harfbuzz-sys-test/build.rs @@ -9,7 +9,7 @@ fn main() { #[allow(unused_mut)] let mut pkgconfig = pkg_config::Config::new(); #[cfg(not(feature = "bindgen"))] - pkgconfig.range_version("4.2".."5"); + pkgconfig.range_version("7.1".."8"); // Get the include paths from harfbuzz-sys or pkg-config. if let Some(path) = &env::var_os("DEP_HARFBUZZ_INCLUDE") { diff --git a/harfbuzz-sys/build.rs b/harfbuzz-sys/build.rs index 4323aed2..ed65b51a 100644 --- a/harfbuzz-sys/build.rs +++ b/harfbuzz-sys/build.rs @@ -116,7 +116,7 @@ fn main() { // allow other version of harfbuzz when bindgen enabled. #[cfg(not(feature = "bindgen"))] - pkgcfg.range_version("4.2".."5"); + pkgcfg.range_version("7.1".."8"); match pkgcfg.probe("harfbuzz") { Ok(_lib) => { diff --git a/harfbuzz-sys/src/bindings.rs b/harfbuzz-sys/src/bindings.rs index a0969c8a..b578f2bf 100644 --- a/harfbuzz-sys/src/bindings.rs +++ b/harfbuzz-sys/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.60.1 */ #[doc = " hb_bool_t:"] #[doc = ""] @@ -45,66 +45,108 @@ fn bindgen_test_layout__hb_var_int_t() { 4usize, concat!("Alignment of ", stringify!(_hb_var_int_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u32 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(u32) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i32 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(i32) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u16 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(u16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i16 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(i16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(u8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_int_t), - "::", - stringify!(i8) - ) - ); + fn test_field_u32() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u32) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u32) + ) + ); + } + test_field_u32(); + fn test_field_i32() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i32) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i32) + ) + ); + } + test_field_i32(); + fn test_field_u16() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u16) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u16) + ) + ); + } + test_field_u16(); + fn test_field_i16() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i16) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i16) + ) + ); + } + test_field_i16(); + fn test_field_u8() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u8) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u8) + ) + ); + } + test_field_u8(); + fn test_field_i8() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_int_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i8) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i8) + ) + ); + } + test_field_i8(); } pub type hb_var_int_t = _hb_var_int_t; #[repr(C)] @@ -130,76 +172,125 @@ fn bindgen_test_layout__hb_var_num_t() { 4usize, concat!("Alignment of ", stringify!(_hb_var_num_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).f as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(f) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).u32 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(u32) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).i32 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(i32) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).u16 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(u16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).i16 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(i16) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).u8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(u8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_hb_var_num_t>())).i8 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_hb_var_num_t), - "::", - stringify!(i8) - ) - ); + fn test_field_f() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).f) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(f) + ) + ); + } + test_field_f(); + fn test_field_u32() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u32) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(u32) + ) + ); + } + test_field_u32(); + fn test_field_i32() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i32) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(i32) + ) + ); + } + test_field_i32(); + fn test_field_u16() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u16) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(u16) + ) + ); + } + test_field_u16(); + fn test_field_i16() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i16) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(i16) + ) + ); + } + test_field_i16(); + fn test_field_u8() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).u8) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(u8) + ) + ); + } + test_field_u8(); + fn test_field_i8() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::<_hb_var_num_t>::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).i8) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_num_t), + "::", + stringify!(i8) + ) + ); + } + test_field_i8(); } pub type hb_var_num_t = _hb_var_num_t; #[doc = " hb_tag_t:"] @@ -646,16 +737,23 @@ fn bindgen_test_layout_hb_user_data_key_t() { 1usize, concat!("Alignment of ", stringify!(hb_user_data_key_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).unused as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_user_data_key_t), - "::", - stringify!(unused) - ) - ); + fn test_field_unused() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).unused) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_user_data_key_t), + "::", + stringify!(unused) + ) + ); + } + test_field_unused(); } #[doc = " hb_destroy_func_t:"] #[doc = " @user_data: the data to be destroyed"] @@ -697,46 +795,74 @@ fn bindgen_test_layout_hb_feature_t() { 4usize, concat!("Alignment of ", stringify!(hb_feature_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_feature_t), - "::", - stringify!(tag) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_feature_t), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_feature_t), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_feature_t), - "::", - stringify!(end) - ) - ); + fn test_field_tag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(tag) + ) + ); + } + test_field_tag(); + fn test_field_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(value) + ) + ); + } + test_field_value(); + fn test_field_start() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(start) + ) + ); + } + test_field_start(); + fn test_field_end() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(end) + ) + ); + } + test_field_end(); } extern "C" { pub fn hb_feature_from_string( @@ -779,26 +905,40 @@ fn bindgen_test_layout_hb_variation_t() { 4usize, concat!("Alignment of ", stringify!(hb_variation_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_variation_t), - "::", - stringify!(tag) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_variation_t), - "::", - stringify!(value) - ) - ); + fn test_field_tag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_variation_t), + "::", + stringify!(tag) + ) + ); + } + test_field_tag(); + fn test_field_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_variation_t), + "::", + stringify!(value) + ) + ); + } + test_field_value(); } extern "C" { pub fn hb_variation_from_string( @@ -1783,126 +1923,210 @@ fn bindgen_test_layout_hb_draw_state_t() { 4usize, concat!("Alignment of ", stringify!(hb_draw_state_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).path_open as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(path_open) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).path_start_x as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(path_start_x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).path_start_y as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(path_start_y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current_x as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(current_x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current_y as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(current_y) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved4 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved5 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved6 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved7 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(hb_draw_state_t), - "::", - stringify!(reserved7) - ) - ); + fn test_field_path_open() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).path_open) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(path_open) + ) + ); + } + test_field_path_open(); + fn test_field_path_start_x() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).path_start_x) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(path_start_x) + ) + ); + } + test_field_path_start_x(); + fn test_field_path_start_y() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).path_start_y) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(path_start_y) + ) + ); + } + test_field_path_start_y(); + fn test_field_current_x() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).current_x) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(current_x) + ) + ); + } + test_field_current_x(); + fn test_field_current_y() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).current_y) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(current_y) + ) + ); + } + test_field_current_y(); + fn test_field_reserved1() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved1) + ) + ); + } + test_field_reserved1(); + fn test_field_reserved2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved2) + ) + ); + } + test_field_reserved2(); + fn test_field_reserved3() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved3) + ) + ); + } + test_field_reserved3(); + fn test_field_reserved4() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved4) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved4) + ) + ); + } + test_field_reserved4(); + fn test_field_reserved5() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved5) as usize - ptr as usize + }, + 36usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved5) + ) + ); + } + test_field_reserved5(); + fn test_field_reserved6() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved6) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved6) + ) + ); + } + test_field_reserved6(); + fn test_field_reserved7() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved7) as usize - ptr as usize + }, + 44usize, + concat!( + "Offset of field: ", + stringify!(hb_draw_state_t), + "::", + stringify!(reserved7) + ) + ); + } + test_field_reserved7(); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2261,126 +2485,210 @@ fn bindgen_test_layout_hb_font_extents_t() { 4usize, concat!("Alignment of ", stringify!(hb_font_extents_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(ascender) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(descender) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).line_gap as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(line_gap) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved9 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved9) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved8 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved8) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved7 as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved7) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved6 as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved6) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved5 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved4 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(hb_font_extents_t), - "::", - stringify!(reserved1) - ) - ); + fn test_field_ascender() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ascender) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(ascender) + ) + ); + } + test_field_ascender(); + fn test_field_descender() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).descender) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(descender) + ) + ); + } + test_field_descender(); + fn test_field_line_gap() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).line_gap) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(line_gap) + ) + ); + } + test_field_line_gap(); + fn test_field_reserved9() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved9) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved9) + ) + ); + } + test_field_reserved9(); + fn test_field_reserved8() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved8) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved8) + ) + ); + } + test_field_reserved8(); + fn test_field_reserved7() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved7) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved7) + ) + ); + } + test_field_reserved7(); + fn test_field_reserved6() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved6) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved6) + ) + ); + } + test_field_reserved6(); + fn test_field_reserved5() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved5) as usize - ptr as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved5) + ) + ); + } + test_field_reserved5(); + fn test_field_reserved4() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved4) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved4) + ) + ); + } + test_field_reserved4(); + fn test_field_reserved3() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize + }, + 36usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved3) + ) + ); + } + test_field_reserved3(); + fn test_field_reserved2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved2) + ) + ); + } + test_field_reserved2(); + fn test_field_reserved1() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize + }, + 44usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved1) + ) + ); + } + test_field_reserved1(); } #[doc = " hb_glyph_extents_t:"] #[doc = " @x_bearing: Distance from the x-origin to the left extremum of the glyph."] @@ -2411,46 +2719,74 @@ fn bindgen_test_layout_hb_glyph_extents_t() { 4usize, concat!("Alignment of ", stringify!(hb_glyph_extents_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x_bearing as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_extents_t), - "::", - stringify!(x_bearing) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y_bearing as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_extents_t), - "::", - stringify!(y_bearing) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_extents_t), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_extents_t), - "::", - stringify!(height) - ) - ); + fn test_field_x_bearing() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).x_bearing) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(x_bearing) + ) + ); + } + test_field_x_bearing(); + fn test_field_y_bearing() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).y_bearing) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(y_bearing) + ) + ); + } + test_field_y_bearing(); + fn test_field_width() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(width) + ) + ); + } + test_field_width(); + fn test_field_height() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(height) + ) + ); + } + test_field_height(); } #[doc = " hb_font_get_font_extents_func_t:"] #[doc = " @font: #hb_font_t to work upon"] @@ -3547,56 +3883,91 @@ fn bindgen_test_layout_hb_glyph_info_t() { 4usize, concat!("Alignment of ", stringify!(hb_glyph_info_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).codepoint as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_info_t), - "::", - stringify!(codepoint) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mask as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_info_t), - "::", - stringify!(mask) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cluster as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_info_t), - "::", - stringify!(cluster) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).var1 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_info_t), - "::", - stringify!(var1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).var2 as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_info_t), - "::", - stringify!(var2) - ) - ); + fn test_field_codepoint() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).codepoint) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(codepoint) + ) + ); + } + test_field_codepoint(); + fn test_field_mask() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(mask) + ) + ); + } + test_field_mask(); + fn test_field_cluster() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).cluster) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(cluster) + ) + ); + } + test_field_cluster(); + fn test_field_var1() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).var1) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(var1) + ) + ); + } + test_field_var1(); + fn test_field_var2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).var2) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(var2) + ) + ); + } + test_field_var2(); } pub const HB_GLYPH_FLAG_UNSAFE_TO_BREAK: hb_glyph_flags_t = 1; pub const HB_GLYPH_FLAG_UNSAFE_TO_CONCAT: hb_glyph_flags_t = 2; @@ -3715,56 +4086,91 @@ fn bindgen_test_layout_hb_glyph_position_t() { 4usize, concat!("Alignment of ", stringify!(hb_glyph_position_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x_advance as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_position_t), - "::", - stringify!(x_advance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y_advance as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_position_t), - "::", - stringify!(y_advance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).x_offset as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_position_t), - "::", - stringify!(x_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).y_offset as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_position_t), - "::", - stringify!(y_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).var as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_glyph_position_t), - "::", - stringify!(var) - ) - ); + fn test_field_x_advance() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).x_advance) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(x_advance) + ) + ); + } + test_field_x_advance(); + fn test_field_y_advance() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).y_advance) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(y_advance) + ) + ); + } + test_field_y_advance(); + fn test_field_x_offset() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).x_offset) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(x_offset) + ) + ); + } + test_field_x_offset(); + fn test_field_y_offset() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).y_offset) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(y_offset) + ) + ); + } + test_field_y_offset(); + fn test_field_var() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).var) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(var) + ) + ); + } + test_field_var(); } #[doc = " hb_segment_properties_t:"] #[doc = " @direction: the #hb_direction_t of the buffer, see hb_buffer_set_direction()."] @@ -3795,64 +4201,91 @@ fn bindgen_test_layout_hb_segment_properties_t() { 8usize, concat!("Alignment of ", stringify!(hb_segment_properties_t)) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).direction as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_segment_properties_t), - "::", - stringify!(direction) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).script as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_segment_properties_t), - "::", - stringify!(script) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).language as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_segment_properties_t), - "::", - stringify!(language) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved1 as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_segment_properties_t), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved2 as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(hb_segment_properties_t), - "::", - stringify!(reserved2) - ) - ); + fn test_field_direction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(direction) + ) + ); + } + test_field_direction(); + fn test_field_script() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).script) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(script) + ) + ); + } + test_field_script(); + fn test_field_language() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(language) + ) + ); + } + test_field_language(); + fn test_field_reserved1() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(reserved1) + ) + ); + } + test_field_reserved1(); + fn test_field_reserved2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(reserved2) + ) + ); + } + test_field_reserved2(); } extern "C" { pub fn hb_segment_properties_equal( @@ -4788,36 +5221,57 @@ fn bindgen_test_layout_hb_ot_name_entry_t() { 8usize, concat!("Alignment of ", stringify!(hb_ot_name_entry_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name_id as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_name_entry_t), - "::", - stringify!(name_id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).var as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_name_entry_t), - "::", - stringify!(var) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).language as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_name_entry_t), - "::", - stringify!(language) - ) - ); + fn test_field_name_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).name_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_name_entry_t), + "::", + stringify!(name_id) + ) + ); + } + test_field_name_id(); + fn test_field_var() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).var) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_name_entry_t), + "::", + stringify!(var) + ) + ); + } + test_field_var(); + fn test_field_language() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_name_entry_t), + "::", + stringify!(language) + ) + ); + } + test_field_language(); } extern "C" { pub fn hb_ot_name_list_names( @@ -4928,26 +5382,40 @@ fn bindgen_test_layout_hb_ot_color_layer_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_color_layer_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).glyph as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_color_layer_t), - "::", - stringify!(glyph) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).color_index as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_color_layer_t), - "::", - stringify!(color_index) - ) - ); + fn test_field_glyph() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).glyph) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_color_layer_t), + "::", + stringify!(glyph) + ) + ); + } + test_field_glyph(); + fn test_field_color_index() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).color_index) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_color_layer_t), + "::", + stringify!(color_index) + ) + ); + } + test_field_color_index(); } extern "C" { pub fn hb_ot_color_glyph_get_layers( @@ -5036,56 +5504,91 @@ fn bindgen_test_layout_hb_ot_var_axis_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_var_axis_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_t), - "::", - stringify!(tag) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name_id as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_t), - "::", - stringify!(name_id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min_value as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_t), - "::", - stringify!(min_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).default_value as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_t), - "::", - stringify!(default_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max_value as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_t), - "::", - stringify!(max_value) - ) - ); + fn test_field_tag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_t), + "::", + stringify!(tag) + ) + ); + } + test_field_tag(); + fn test_field_name_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).name_id) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_t), + "::", + stringify!(name_id) + ) + ); + } + test_field_name_id(); + fn test_field_min_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).min_value) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_t), + "::", + stringify!(min_value) + ) + ); + } + test_field_min_value(); + fn test_field_default_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_value) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_t), + "::", + stringify!(default_value) + ) + ); + } + test_field_default_value(); + fn test_field_max_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).max_value) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_t), + "::", + stringify!(max_value) + ) + ); + } + test_field_max_value(); } extern "C" { pub fn hb_ot_var_get_axes( @@ -5650,31 +6153,40 @@ fn bindgen_test_layout_hb_ot_math_kern_entry_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_math_kern_entry_t)) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).max_correction_height as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_kern_entry_t), - "::", - stringify!(max_correction_height) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).kern_value as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_kern_entry_t), - "::", - stringify!(kern_value) - ) - ); + fn test_field_max_correction_height() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).max_correction_height) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_kern_entry_t), + "::", + stringify!(max_correction_height) + ) + ); + } + test_field_max_correction_height(); + fn test_field_kern_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).kern_value) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_kern_entry_t), + "::", + stringify!(kern_value) + ) + ); + } + test_field_kern_value(); } #[doc = " hb_ot_math_glyph_variant_t:"] #[doc = " @glyph: The glyph index of the variant"] @@ -5701,30 +6213,40 @@ fn bindgen_test_layout_hb_ot_math_glyph_variant_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_math_glyph_variant_t)) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).glyph as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_variant_t), - "::", - stringify!(glyph) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).advance as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_variant_t), - "::", - stringify!(advance) - ) - ); + fn test_field_glyph() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).glyph) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_variant_t), + "::", + stringify!(glyph) + ) + ); + } + test_field_glyph(); + fn test_field_advance() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).advance) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_variant_t), + "::", + stringify!(advance) + ) + ); + } + test_field_advance(); } pub const HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER: hb_ot_math_glyph_part_flags_t = 1; #[doc = " hb_ot_math_glyph_part_flags_t:"] @@ -5768,64 +6290,91 @@ fn bindgen_test_layout_hb_ot_math_glyph_part_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_math_glyph_part_t)) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).glyph as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_part_t), - "::", - stringify!(glyph) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).start_connector_length as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_part_t), - "::", - stringify!(start_connector_length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).end_connector_length as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_part_t), - "::", - stringify!(end_connector_length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).full_advance as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_part_t), - "::", - stringify!(full_advance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_math_glyph_part_t), - "::", - stringify!(flags) - ) - ); + fn test_field_glyph() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).glyph) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_part_t), + "::", + stringify!(glyph) + ) + ); + } + test_field_glyph(); + fn test_field_start_connector_length() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).start_connector_length) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_part_t), + "::", + stringify!(start_connector_length) + ) + ); + } + test_field_start_connector_length(); + fn test_field_end_connector_length() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).end_connector_length) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_part_t), + "::", + stringify!(end_connector_length) + ) + ); + } + test_field_end_connector_length(); + fn test_field_full_advance() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).full_advance) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_part_t), + "::", + stringify!(full_advance) + ) + ); + } + test_field_full_advance(); + fn test_field_flags() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_math_glyph_part_t), + "::", + stringify!(flags) + ) + ); + } + test_field_flags(); } extern "C" { pub fn hb_ot_math_has_data(face: *mut hb_face_t) -> hb_bool_t; @@ -6096,90 +6645,142 @@ fn bindgen_test_layout_hb_ot_var_axis_info_t() { 4usize, concat!("Alignment of ", stringify!(hb_ot_var_axis_info_t)) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).axis_index as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(axis_index) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(tag) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name_id as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(name_id) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).min_value as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(min_value) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).default_value as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(default_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).max_value as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(max_value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(hb_ot_var_axis_info_t), - "::", - stringify!(reserved) - ) - ); + fn test_field_axis_index() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).axis_index) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(axis_index) + ) + ); + } + test_field_axis_index(); + fn test_field_tag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(tag) + ) + ); + } + test_field_tag(); + fn test_field_name_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).name_id) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(name_id) + ) + ); + } + test_field_name_id(); + fn test_field_flags() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(flags) + ) + ); + } + test_field_flags(); + fn test_field_min_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).min_value) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(min_value) + ) + ); + } + test_field_min_value(); + fn test_field_default_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_value) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(default_value) + ) + ); + } + test_field_default_value(); + fn test_field_max_value() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).max_value) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(max_value) + ) + ); + } + test_field_max_value(); + fn test_field_reserved() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(hb_ot_var_axis_info_t), + "::", + stringify!(reserved) + ) + ); + } + test_field_reserved(); } extern "C" { pub fn hb_ot_var_get_axis_infos( @@ -7008,58 +7609,78 @@ fn bindgen_test_layout_hb_aat_layout_feature_selector_info_t() { stringify!(hb_aat_layout_feature_selector_info_t) ) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).name_id as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hb_aat_layout_feature_selector_info_t), - "::", - stringify!(name_id) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).enable as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hb_aat_layout_feature_selector_info_t), - "::", - stringify!(enable) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).disable as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hb_aat_layout_feature_selector_info_t), - "::", - stringify!(disable) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hb_aat_layout_feature_selector_info_t), - "::", - stringify!(reserved) - ) - ); + fn test_field_name_id() { + assert_eq!( + unsafe { + let uninit = + ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).name_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_aat_layout_feature_selector_info_t), + "::", + stringify!(name_id) + ) + ); + } + test_field_name_id(); + fn test_field_enable() { + assert_eq!( + unsafe { + let uninit = + ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_aat_layout_feature_selector_info_t), + "::", + stringify!(enable) + ) + ); + } + test_field_enable(); + fn test_field_disable() { + assert_eq!( + unsafe { + let uninit = + ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).disable) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_aat_layout_feature_selector_info_t), + "::", + stringify!(disable) + ) + ); + } + test_field_disable(); + fn test_field_reserved() { + assert_eq!( + unsafe { + let uninit = + ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_aat_layout_feature_selector_info_t), + "::", + stringify!(reserved) + ) + ); + } + test_field_reserved(); } extern "C" { pub fn hb_aat_layout_feature_type_get_selector_infos( diff --git a/harfbuzz-sys/update.sh b/harfbuzz-sys/update.sh index 7d653225..c852765f 100755 --- a/harfbuzz-sys/update.sh +++ b/harfbuzz-sys/update.sh @@ -1,16 +1,19 @@ +#!/bin/bash + set -ex -cd harfbuzz && \ -git fetch -t && \ -git checkout 4.3.0 && \ -cd - && \ -bindgen --no-prepend-enum-name \ - --whitelist-function hb_.\* \ - --whitelist-type hb_.\* wrapper.h | \ - grep -Pv "^pub type __u?int(8|16|32)_t = " | \ - sed 's/ f32/ ::std::os::raw::c_float/' | \ - sed 's/u32_/u32/' | \ - sed 's/i32_/i32/' | \ - sed 's/u16_/u16/' | \ - sed 's/i16_/i16/' | \ - sed 's/u8_/u8/' | - sed 's/i8_/i8/' >src/bindings.rs + +cd harfbuzz && + git fetch -t && + git checkout 7.1.0 && + cd - && + bindgen --no-prepend-enum-name \ + --whitelist-function hb_.\* \ + --whitelist-type hb_.\* wrapper.h | + grep -Pv "^pub type __u?int(8|16|32)_t = " | + sed 's/ f32/ ::std::os::raw::c_float/' | + sed 's/u32_/u32/' | + sed 's/i32_/i32/' | + sed 's/u16_/u16/' | + sed 's/i16_/i16/' | + sed 's/u8_/u8/' | + sed 's/i8_/i8/' >src/bindings.rs