1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#![cfg_attr(feature = "no_std", no_std)]
#![crate_type = "lib"]
#![crate_name = "va_list"]
#[cfg(feature = "no_std")]
#[doc(hidden)]
mod std {
pub use core::{mem, ptr};
}
#[cfg(all(target_arch = "x86_64",
any(target_family = "unix", target_os = "redox", target_os = "tifflin")))]
#[path = "impl-x86_64-elf.rs"]
mod imp;
#[cfg(all(target_arch = "x86_64", target_family = "windows"))]
#[path = "impl-x86_64-win64.rs"]
mod imp;
#[cfg(all(target_arch = "x86", target_family = "unix"))]
#[path = "impl-x86-sysv.rs"]
mod imp;
#[cfg(all(target_arch = "aarch64", any(target_family = "unix", target_os = "redox")))]
#[path = "impl-aarch64-elf.rs"]
mod imp;
#[cfg(all(target_arch = "arm", target_family = "unix"))]
#[path = "impl-arm-sysv.rs"]
mod imp;
#[repr(C)]
pub struct VaList {
internal: imp::VaList,
}
impl VaList {
pub unsafe fn get<T: VaPrimitive>(&mut self) -> T {
T::get(&mut self.internal)
}
}
pub trait VaPrimitive: 'static {
#[doc(hidden)]
unsafe fn get(&mut imp::VaList) -> Self;
}