diff options
author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2022-02-18 14:21:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 17:51:19 +0530 |
commit | b1a6555c0502196174bed1454e446717daf52f12 (patch) | |
tree | 3e0c74d87a63044090564638dee0af22f4e2ca10 /test_ffi/src/lib.rs | |
parent | 4a144c7d6e55a5e047080cb1e2377b70657f1809 (diff) |
feat(ext/ffi): Support read only global statics (#13662)
Diffstat (limited to 'test_ffi/src/lib.rs')
-rw-r--r-- | test_ffi/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
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 }; |