1macro_rules! if_signed {
17 (Signed; $($rem:tt)+) => {
18 $($rem)+
19 };
20 (Unsigned; $($rem:tt)+) => {};
21}
22
23macro_rules! if_unsigned {
24 (Signed; $($rem:tt)+) => {};
25 (Unsigned; $($rem:tt)+) => {
26 $($rem)+
27 };
28}
29
30macro_rules! if_signed_unsigned {
31 (Signed, $signed:expr, $unsigned:expr $(,)?) => {
32 $signed
33 };
34 (Unsigned, $signed:expr, $unsigned:expr $(,)?) => {
35 $unsigned
36 };
37}
38
39macro_rules! if_signed_else_empty_str {
40 (Signed; $($signed:tt)*) => {
41 concat!($($signed)*)
42 };
43 (Unsigned; $($signed:tt)*) => {
44 ""
45 };
46}
47macro_rules! if_unsigned_else_empty_str {
48 (Signed; $($unsigned:tt)*) => {
49 ""
50 };
51 (Unsigned; $($unsigned:tt)*) => {
52 concat!($($unsigned)*)
53 };
54}
55
56macro_rules! doc_comment {
57 ($comment:expr; $($tt:tt)*) => {
58 #[doc = $comment]
59 $($tt)*
60 };
61}
62
63macro_rules! comment {
64 ($($comment:expr),* $(,)?; $($tt:tt)*) => {
65 doc_comment! {
66 concat!($($comment),*);
67 $($tt)*
68 }
69 };
70}