From b1a6555c0502196174bed1454e446717daf52f12 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Fri, 18 Feb 2022 14:21:19 +0200 Subject: feat(ext/ffi): Support read only global statics (#13662) --- test_ffi/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test_ffi/src') diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs index a04c2c2fd..9a06e29e7 100644 --- a/test_ffi/src/lib.rs +++ b/test_ffi/src/lib.rs @@ -112,3 +112,14 @@ pub extern "C" fn get_add_u32_ptr() -> *const c_void { pub extern "C" fn get_sleep_blocking_ptr() -> *const c_void { sleep_blocking as *const c_void } + +#[no_mangle] +pub static static_u32: u32 = 42; + +#[repr(C)] +pub struct Structure { + _data: u32, +} + +#[no_mangle] +pub static static_ptr: Structure = Structure { _data: 42 }; -- cgit v1.2.3