File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ while IFS= read -r file; do
26
26
27
27
# Turn all braced macro `foo! { /* ... */ }` invocations into
28
28
# `fn foo_fmt_tmp() { /* ... */ }`.
29
- perl -pi -e ' s/(?!macro_rules|c_enum )\b(\w+)!\s*\{/fn $1_fmt_tmp() {/g' " $file "
29
+ perl -pi -e ' s/(?!macro_rules)\b(\w+)!\s*\{/fn $1_fmt_tmp() {/g' " $file "
30
30
31
31
# Replace `if #[cfg(...)]` within `cfg_if` with `if cfg_tmp!([...])` which
32
32
# `rustfmt` will format. We put brackets within the parens so it is easy to
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ macro_rules! e {
223
223
macro_rules! c_enum {
224
224
(
225
225
$( #[ repr( $repr: ty) ] ) ?
226
- $ty_name: ident {
226
+ enum $ty_name: ident {
227
227
$( $variant: ident $( = $value: literal) ?, ) +
228
228
}
229
229
) => {
@@ -377,7 +377,7 @@ mod tests {
377
377
fn c_enumbasic ( ) {
378
378
// By default, variants get sequential values.
379
379
c_enum ! {
380
- e {
380
+ enum e {
381
381
VAR0 ,
382
382
VAR1 ,
383
383
VAR2 ,
@@ -394,7 +394,7 @@ mod tests {
394
394
// By default, variants get sequential values.
395
395
c_enum ! {
396
396
#[ repr( u16 ) ]
397
- e {
397
+ enum e {
398
398
VAR0 ,
399
399
}
400
400
}
@@ -406,7 +406,7 @@ mod tests {
406
406
fn c_enumset_value ( ) {
407
407
// Setting an explicit value resets the count.
408
408
c_enum ! {
409
- e {
409
+ enum e {
410
410
VAR2 = 2 ,
411
411
VAR3 ,
412
412
VAR4 ,
@@ -423,7 +423,7 @@ mod tests {
423
423
// C enums always take one more than the previous value, unless set to a specific
424
424
// value. Duplicates are allowed.
425
425
c_enum ! {
426
- e {
426
+ enum e {
427
427
VAR0 ,
428
428
VAR2_0 = 2 ,
429
429
VAR3_0 ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub type Elf64_Xword = u64;
39
39
pub type iconv_t = * mut c_void ;
40
40
41
41
c_enum ! {
42
- fae_action {
42
+ enum fae_action {
43
43
FAE_OPEN ,
44
44
FAE_DUP2 ,
45
45
FAE_CLOSE ,
Original file line number Diff line number Diff line change @@ -86,15 +86,15 @@ cfg_if! {
86
86
}
87
87
88
88
c_enum ! {
89
- tpacket_versions {
89
+ enum tpacket_versions {
90
90
TPACKET_V1 ,
91
91
TPACKET_V2 ,
92
92
TPACKET_V3 ,
93
93
}
94
94
}
95
95
96
96
c_enum ! {
97
- pid_type {
97
+ enum pid_type {
98
98
PIDTYPE_PID ,
99
99
PIDTYPE_TGID ,
100
100
PIDTYPE_PGID ,
@@ -4528,14 +4528,14 @@ pub const RTNLGRP_STATS: c_uint = 0x24;
4528
4528
4529
4529
// linux/cn_proc.h
4530
4530
c_enum ! {
4531
- proc_cn_mcast_op {
4531
+ enum proc_cn_mcast_op {
4532
4532
PROC_CN_MCAST_LISTEN = 1 ,
4533
4533
PROC_CN_MCAST_IGNORE = 2 ,
4534
4534
}
4535
4535
}
4536
4536
4537
4537
c_enum ! {
4538
- proc_cn_event {
4538
+ enum proc_cn_event {
4539
4539
PROC_EVENT_NONE = 0x00000000 ,
4540
4540
PROC_EVENT_FORK = 0x00000001 ,
4541
4541
PROC_EVENT_EXEC = 0x00000002 ,
You can’t perform that action at this time.
0 commit comments