forked from mozilla/cbindgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannotation_both.c
More file actions
89 lines (79 loc) · 1.3 KB
/
Copy pathannotation_both.c
File metadata and controls
89 lines (79 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
enum C
#if __STDC_VERSION__ >= 202311L
: uint32_t
#endif // __STDC_VERSION__ >= 202311L
{
X = 2,
Y,
};
#if __STDC_VERSION__ >= 202311L
typedef enum C C;
#else
typedef uint32_t C;
#endif // __STDC_VERSION__ >= 202311L
typedef struct A {
int32_t m0;
} A;
typedef struct B {
int32_t x;
float y;
} B;
enum F_Tag
#if __STDC_VERSION__ >= 202311L
: uint8_t
#endif // __STDC_VERSION__ >= 202311L
{
Foo,
Bar,
Baz,
};
#if __STDC_VERSION__ >= 202311L
typedef enum F_Tag F_Tag;
#else
typedef uint8_t F_Tag;
#endif // __STDC_VERSION__ >= 202311L
typedef struct Bar_Body {
F_Tag tag;
uint8_t x;
int16_t y;
} Bar_Body;
typedef union F {
F_Tag tag;
struct {
F_Tag foo_tag;
int16_t foo;
};
Bar_Body bar;
} F;
enum H_Tag
#if __STDC_VERSION__ >= 202311L
: uint8_t
#endif // __STDC_VERSION__ >= 202311L
{
Hello,
There,
Everyone,
};
#if __STDC_VERSION__ >= 202311L
typedef enum H_Tag H_Tag;
#else
typedef uint8_t H_Tag;
#endif // __STDC_VERSION__ >= 202311L
typedef struct There_Body {
uint8_t x;
int16_t y;
} There_Body;
typedef struct H {
H_Tag tag;
union {
struct {
int16_t hello;
};
There_Body there;
};
} H;
void root(struct A x, struct B y, C z, union F f, struct H h);