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