1#[derive(Debug, Clone, Copy)]
5pub struct LinkSection {
6 pub link_section: &'static str,
8 pub name: &'static str,
10}
11
12impl LinkSection {
13 pub const ALL: &'static [&'static LinkSection] =
15 &[Self::WASM, Self::MACOS, Self::WINDOWS, Self::ILLUMOS];
16
17 pub const WASM: &'static LinkSection = &LinkSection {
19 link_section: "manganis",
20 name: "manganis",
21 };
22
23 pub const MACOS: &'static LinkSection = &LinkSection {
25 link_section: "__DATA,manganis,regular,no_dead_strip",
26 name: "manganis",
27 };
28
29 pub const WINDOWS: &'static LinkSection = &LinkSection {
31 link_section: "mg",
32 name: "mg",
33 };
34
35 pub const ILLUMOS: &'static LinkSection = &LinkSection {
37 link_section: "set_manganis",
38 name: "set_manganis",
39 };
40
41 pub const CURRENT: &'static LinkSection = {
43 #[cfg(any(
44 target_os = "none",
45 target_os = "linux",
46 target_os = "android",
47 target_os = "fuchsia",
48 target_os = "psp",
49 target_os = "freebsd",
50 target_arch = "wasm32"
51 ))]
52 {
53 Self::WASM
54 }
55
56 #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))]
57 {
58 Self::MACOS
59 }
60
61 #[cfg(target_os = "windows")]
62 {
63 Self::WINDOWS
64 }
65
66 #[cfg(target_os = "illumos")]
67 {
68 Self::ILLUMOS
69 }
70 };
71}