1 #include <stdarg.h> 2 #include <stdbool.h> 3 #include <stdint.h> 4 #include <stdlib.h> 5 6 typedef enum { 7 Foo1, 8 Bar1, 9 Baz1, 10 } MyCLikeEnum; 11 12 typedef enum { 13 Foo1_Prepended, 14 Bar1_Prepended, 15 Baz1_Prepended, 16 } MyCLikeEnum_Prepended; 17 18 typedef struct { 19 int32_t i; 20 #ifdef __cplusplus 21 inline void foo(); 22 #endif 23 } MyFancyStruct; 24 25 typedef enum { 26 Foo, 27 Bar, 28 Baz, 29 } MyFancyEnum_Tag; 30 31 typedef struct { 32 MyFancyEnum_Tag tag; 33 union { 34 struct { 35 int32_t bar; 36 }; 37 struct { 38 int32_t baz; 39 }; 40 }; 41 #ifdef __cplusplus 42 inline void wohoo(); 43 #endif 44 } MyFancyEnum; 45 46 typedef union { 47 float f; 48 uint32_t u; 49 int32_t extra_member; 50 } MyUnion; 51 52 typedef struct { 53 #ifdef __cplusplus 54 inline void prepended_wohoo(); 55 #endif 56 int32_t i; 57 } MyFancyStruct_Prepended; 58 59 typedef enum { 60 Foo_Prepended, 61 Bar_Prepended, 62 Baz_Prepended, 63 } MyFancyEnum_Prepended_Tag; 64 65 typedef struct { 66 #ifdef __cplusplus 67 inline void wohoo(); 68 #endif 69 MyFancyEnum_Prepended_Tag tag; 70 union { 71 struct { 72 int32_t bar_prepended; 73 }; 74 struct { 75 int32_t baz_prepended; 76 }; 77 }; 78 } MyFancyEnum_Prepended; 79 80 typedef union { 81 int32_t extra_member; 82 float f; 83 uint32_t u; 84 } MyUnion_Prepended; 85 86 #ifdef __cplusplus 87 extern "C" { 88 #endif // __cplusplus 89 90 void root(MyFancyStruct s, 91 MyFancyEnum e, 92 MyCLikeEnum c, 93 MyUnion u, 94 MyFancyStruct_Prepended sp, 95 MyFancyEnum_Prepended ep, 96 MyCLikeEnum_Prepended cp, 97 MyUnion_Prepended up); 98 99 #ifdef __cplusplus 100 } // extern "C" 101 #endif // __cplusplus 102