.cargo/vendor/cbindgen/tests/expectations/annotation.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 { |
| 19 | int32_t m0; |
| 20 | } A; |
| 21 | |
| 22 | typedef struct { |
| 23 | int32_t x; |
| 24 | float y; |
| 25 | } B; |
| 26 | |
| 27 | enum F_Tag |
| 28 | #ifdef __cplusplus |
| 29 | : uint8_t |
| 30 | #endif // __cplusplus |
| 31 | { |
| 32 | Foo, |
| 33 | Bar, |
| 34 | Baz, |
| 35 | }; |
| 36 | #ifndef __cplusplus |
| 37 | typedef uint8_t F_Tag; |
| 38 | #endif // __cplusplus |
| 39 | |
| 40 | typedef struct { |
| 41 | F_Tag tag; |
| 42 | uint8_t x; |
| 43 | int16_t y; |
| 44 | } Bar_Body; |
| 45 | |
| 46 | typedef union { |
| 47 | F_Tag tag; |
| 48 | struct { |
| 49 | F_Tag foo_tag; |
| 50 | int16_t foo; |
| 51 | }; |
| 52 | Bar_Body bar; |
| 53 | } F; |
| 54 | |
| 55 | enum H_Tag |
| 56 | #ifdef __cplusplus |
| 57 | : uint8_t |
| 58 | #endif // __cplusplus |
| 59 | { |
| 60 | Hello, |
| 61 | There, |
| 62 | Everyone, |
| 63 | }; |
| 64 | #ifndef __cplusplus |
| 65 | typedef uint8_t H_Tag; |
| 66 | #endif // __cplusplus |
| 67 | |
| 68 | typedef struct { |
| 69 | uint8_t x; |
| 70 | int16_t y; |
| 71 | } There_Body; |
| 72 | |
| 73 | typedef struct { |
| 74 | H_Tag tag; |
| 75 | union { |
| 76 | struct { |
| 77 | int16_t hello; |
| 78 | }; |
| 79 | There_Body there; |
| 80 | }; |
| 81 | } H; |
| 82 | |
| 83 | #ifdef __cplusplus |
| 84 | extern "C" { |
| 85 | #endif // __cplusplus |
| 86 | |
| 87 | void root(A x, B y, C z, F f, H h); |
| 88 | |
| 89 | #ifdef __cplusplus |
| 90 | } // extern "C" |
| 91 | #endif // __cplusplus |