1 #include <stdarg.h> 2 #include <stdbool.h> 3 #include <stdint.h> 4 #include <stdlib.h> 5 6 typedef struct { 7 bool a; 8 int32_t b; 9 } Foo; 10 11 enum Bar_Tag 12 #ifdef __cplusplus 13 : uint8_t 14 #endif // __cplusplus 15 { 16 Baz, 17 Bazz, 18 FooNamed, 19 FooParen, 20 }; 21 #ifndef __cplusplus 22 typedef uint8_t Bar_Tag; 23 #endif // __cplusplus 24 25 typedef struct { 26 Bar_Tag tag; 27 Foo named; 28 } Bazz_Body; 29 30 typedef struct { 31 Bar_Tag tag; 32 int32_t different; 33 uint32_t fields; 34 } FooNamed_Body; 35 36 typedef struct { 37 Bar_Tag tag; 38 int32_t _0; 39 Foo _1; 40 } FooParen_Body; 41 42 typedef union { 43 Bar_Tag tag; 44 Bazz_Body bazz; 45 FooNamed_Body foo_named; 46 FooParen_Body foo_paren; 47 } Bar; 48 49 #ifdef __cplusplus 50 extern "C" { 51 #endif // __cplusplus 52 53 Foo root(Bar aBar); 54 55 #ifdef __cplusplus 56 } // extern "C" 57 #endif // __cplusplus 58