-
Notifications
You must be signed in to change notification settings - Fork 386
Expand file tree
/
Copy pathcfg.compat.c
More file actions
178 lines (156 loc) · 3.24 KB
/
Copy pathcfg.compat.c
File metadata and controls
178 lines (156 loc) · 3.24 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#if 0
DEF PLATFORM_UNIX = 0
DEF PLATFORM_WIN = 0
DEF X11 = 0
DEF M_32 = 0
#endif
#define PLATFORM_UNIX 1
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#if defined(X11)
#define __CBINDGEN_CFG_D3_X11(...) __VA_ARGS__
#else
#define __CBINDGEN_CFG_D3_X11(...)
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
enum FooType
#if defined(__cplusplus) || __STDC_VERSION__ >= 202311L
: uint32_t
#endif // defined(__cplusplus) || __STDC_VERSION__ >= 202311L
{
A,
B,
C,
};
#ifndef __cplusplus
#if __STDC_VERSION__ >= 202311L
typedef enum FooType FooType;
#else
typedef uint32_t FooType;
#endif // __STDC_VERSION__ >= 202311L
#endif // __cplusplus
#endif
#if (defined(PLATFORM_WIN) || defined(M_32))
enum BarType
#if defined(__cplusplus) || __STDC_VERSION__ >= 202311L
: uint32_t
#endif // defined(__cplusplus) || __STDC_VERSION__ >= 202311L
{
A,
B,
C,
};
#ifndef __cplusplus
#if __STDC_VERSION__ >= 202311L
typedef enum BarType BarType;
#else
typedef uint32_t BarType;
#endif // __STDC_VERSION__ >= 202311L
#endif // __cplusplus
#endif
typedef struct {
uint8_t _0;
} Flags;
/**
* none
*/
#define Flags_NONE (Flags){ ._0 = (uint8_t)0 }
#if defined(PLATFORM_WIN)
#define Flags_A (Flags){ ._0 = (uint8_t)(1 << 0) }
#endif
#if defined(PLATFORM_UNIX)
#define Flags_A (Flags){ ._0 = (uint8_t)(1 << 1) }
#endif
#if defined(PLATFORM_WIN)
#define Flags_B (Flags){ ._0 = (uint8_t)((Flags_A)._0 | (1 << 3)) }
#endif
#if defined(PLATFORM_UNIX)
#define Flags_B (Flags){ ._0 = (uint8_t)((Flags_A)._0 | (1 << 4)) }
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
typedef struct {
FooType ty;
Flags flags;
int32_t x;
float y;
} FooHandle;
#endif
enum C_Tag
#if defined(__cplusplus) || __STDC_VERSION__ >= 202311L
: uint8_t
#endif // defined(__cplusplus) || __STDC_VERSION__ >= 202311L
{
C1,
C2,
#if defined(PLATFORM_WIN)
C3,
#endif
#if defined(PLATFORM_UNIX)
C5,
#endif
};
#ifndef __cplusplus
#if __STDC_VERSION__ >= 202311L
typedef enum C_Tag C_Tag;
#else
typedef uint8_t C_Tag;
#endif // __STDC_VERSION__ >= 202311L
#endif // __cplusplus
#if defined(PLATFORM_UNIX)
typedef struct {
C_Tag tag;
int32_t int_;
} C5_Body;
#endif
typedef union {
C_Tag tag;
#if defined(PLATFORM_UNIX)
C5_Body c5;
#endif
} C;
#if (defined(PLATFORM_WIN) || defined(M_32))
typedef struct {
BarType ty;
int32_t x;
float y;
} BarHandle;
#endif
typedef struct {
#if defined(X11)
int32_t field
#endif
;
} ConditionalField;
#define ConditionalField_ZERO (ConditionalField){ __CBINDGEN_CFG_D3_X11(.field = 0,) }
#define ConditionalField_ONE (ConditionalField){ __CBINDGEN_CFG_D3_X11(.field = 1,) }
typedef struct {
int32_t x;
float y;
} Normal;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#if defined(PLATFORM_WIN)
extern int32_t global_array_with_different_sizes[2];
#endif
#if defined(PLATFORM_UNIX)
extern int32_t global_array_with_different_sizes[1];
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
void root(FooHandle a, C c);
#endif
#if (defined(PLATFORM_WIN) || defined(M_32))
void root(BarHandle a, C c);
#endif
void cond(ConditionalField a);
#if defined(PLATFORM_WIN)
extern int32_t foo(void);
#endif
#if defined(PLATFORM_WIN)
extern void bar(Normal a);
#endif
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus