From 494ee50ec7694012b416c19b4e927753eed48baf Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 5 Jun 2024 11:50:49 -0700 Subject: [PATCH] Enable zero-sized section member for openbsd --- impl/src/declaration.rs | 11 ++++++++++- tests/distributed_slice.rs | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/impl/src/declaration.rs b/impl/src/declaration.rs index 425e2ef..ed9256c 100644 --- a/impl/src/declaration.rs +++ b/impl/src/declaration.rs @@ -172,7 +172,16 @@ pub fn expand(input: TokenStream) -> TokenStream { static DUPCHECK_STOP: () = (); #used - #[cfg(any(target_os = "none", target_os = "linux", target_os = "android", target_os = "illumos", target_os = "freebsd", target_os = "psp"))] + #[cfg(any( + target_os = "none", + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "freebsd", + target_os = "openbsd", + target_os = "psp", + ))] #[cfg_attr(any(target_os = "none", target_os = "linux", target_os = "android", target_os = "fuchsia", target_os = "psp"), link_section = #linux_section)] #[cfg_attr(target_os = "illumos", link_section = #illumos_section)] #[cfg_attr(any(target_os = "freebsd", target_os = "openbsd"), link_section = #bsd_section)] diff --git a/tests/distributed_slice.rs b/tests/distributed_slice.rs index f282523..3ae2cd3 100644 --- a/tests/distributed_slice.rs +++ b/tests/distributed_slice.rs @@ -30,7 +30,6 @@ fn test() { } #[test] -#[cfg(not(target_os = "openbsd"))] fn test_empty() { #[distributed_slice] static EMPTY: [i32];