.cargo/vendor/cbindgen/tests/expectations/derive_ostream.both.compat.c
raw| 1 | #include <stdarg.h> |
| 2 | #include <stdbool.h> |
| 3 | #include <stdint.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | enum C |
| 7 | #ifdef __cplusplus |
| 8 | : uint32_t |
| 9 | #endif // __cplusplus |
| 10 | { |
| 11 | X = 2, |
| 12 | Y, |
| 13 | }; |
| 14 | #ifndef __cplusplus |
| 15 | typedef uint32_t C; |
| 16 | #endif // __cplusplus |
| 17 | |
| 18 | typedef struct A { |
| 19 | int32_t _0; |
| 20 | } A; |
| 21 | |
| 22 | typedef struct B { |
| 23 | int32_t x; |
| 24 | float y; |
| 25 | } B; |
| 26 | |
| 27 | typedef struct D { |
| 28 | uint8_t List; |
| 29 | uintptr_t Of; |
| 30 | struct B Things; |
| 31 | } D; |
| 32 | |
| 33 | enum F_Tag |
| 34 | #ifdef __cplusplus |
| 35 | : uint8_t |
| 36 | #endif // __cplusplus |
| 37 | { |
| 38 | Foo, |
| 39 | Bar, |
| 40 | Baz, |
| 41 | }; |
| 42 | #ifndef __cplusplus |
| 43 | typedef uint8_t F_Tag; |
| 44 | #endif // __cplusplus |
| 45 | |
| 46 | typedef struct Bar_Body { |
| 47 | F_Tag tag; |
| 48 | uint8_t x; |
| 49 | int16_t y; |
| 50 | } Bar_Body; |
| 51 | |
| 52 | typedef union F { |
| 53 | F_Tag tag; |
| 54 | struct { |
| 55 | F_Tag foo_tag; |
| 56 | int16_t foo; |
| 57 | }; |
| 58 | Bar_Body bar; |
| 59 | } F; |
| 60 | |
| 61 | enum H_Tag |
| 62 | #ifdef __cplusplus |
| 63 | : uint8_t |
| 64 | #endif // __cplusplus |
| 65 | { |
| 66 | Hello, |
| 67 | There, |
| 68 | Everyone, |
| 69 | }; |
| 70 | #ifndef __cplusplus |
| 71 | typedef uint8_t H_Tag; |
| 72 | #endif // __cplusplus |
| 73 | |
| 74 | typedef struct There_Body { |
| 75 | uint8_t x; |
| 76 | int16_t y; |
| 77 | } There_Body; |
| 78 | |
| 79 | typedef struct H { |
| 80 | H_Tag tag; |
| 81 | union { |
| 82 | struct { |
| 83 | int16_t hello; |
| 84 | }; |
| 85 | There_Body there; |
| 86 | }; |
| 87 | } H; |
| 88 | |
| 89 | enum I_Tag |
| 90 | #ifdef __cplusplus |
| 91 | : uint8_t |
| 92 | #endif // __cplusplus |
| 93 | { |
| 94 | ThereAgain, |
| 95 | SomethingElse, |
| 96 | }; |
| 97 | #ifndef __cplusplus |
| 98 | typedef uint8_t I_Tag; |
| 99 | #endif // __cplusplus |
| 100 | |
| 101 | typedef struct ThereAgain_Body { |
| 102 | uint8_t x; |
| 103 | int16_t y; |
| 104 | } ThereAgain_Body; |
| 105 | |
| 106 | typedef struct I { |
| 107 | I_Tag tag; |
| 108 | union { |
| 109 | ThereAgain_Body there_again; |
| 110 | }; |
| 111 | } I; |
| 112 | |
| 113 | #ifdef __cplusplus |
| 114 | extern "C" { |
| 115 | #endif // __cplusplus |
| 116 | |
| 117 | void root(struct A a, struct B b, C c, struct D d, union F f, struct H h, struct I i); |
| 118 | |
| 119 | #ifdef __cplusplus |
| 120 | } // extern "C" |
| 121 | #endif // __cplusplus |