diff --git a/src/header/netinet_ip/cbindgen.toml b/src/header/netinet_ip/cbindgen.toml index fcb3293718..5a07252db7 100644 --- a/src/header/netinet_ip/cbindgen.toml +++ b/src/header/netinet_ip/cbindgen.toml @@ -11,10 +11,11 @@ cpp_compat = true [export] include = ["ip", "iphdr"] - -[export.rename] -"ip" = "struct ip" -"iphdr" = "struct iphdr" +# NB: do NOT add [export.rename] mapping "ip" -> "struct ip". With style = "Tag" +# cbindgen already emits `struct ip { ... }` for a struct named `ip`; renaming +# the type to "struct ip" makes it emit `struct struct ip { ... }`, which is a +# C syntax error ("expected '{' before 'struct'"). Both `ip` and `iphdr` are +# defined as native Rust structs, so no rename is needed for either name. [enum] prefix_with_name = true \ No newline at end of file