/
cfg_tag.compat.c
128 lines (110 loc) · 1.75 KB
/
cfg_tag.compat.c
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
#if 0
DEF PLATFORM_UNIX = 0
DEF PLATFORM_WIN = 0
DEF X11 = 0
DEF M_32 = 0
#endif
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#if (defined(PLATFORM_WIN) || defined(M_32))
enum BarType
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
{
A,
B,
C,
};
#ifndef __cplusplus
typedef uint32_t BarType;
#endif // __cplusplus
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
enum FooType
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
{
A,
B,
C,
};
#ifndef __cplusplus
typedef uint32_t FooType;
#endif // __cplusplus
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
struct FooHandle {
FooType ty;
int32_t x;
float y;
};
#endif
enum C_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
{
C1,
C2,
#if defined(PLATFORM_WIN)
C3,
#endif
#if defined(PLATFORM_UNIX)
C5,
#endif
};
#ifndef __cplusplus
typedef uint8_t C_Tag;
#endif // __cplusplus
#if defined(PLATFORM_UNIX)
struct C5_Body {
C_Tag tag;
int32_t int_;
};
#endif
union C {
C_Tag tag;
#if defined(PLATFORM_UNIX)
struct C5_Body c5;
#endif
};
#if (defined(PLATFORM_WIN) || defined(M_32))
struct BarHandle {
BarType ty;
int32_t x;
float y;
};
#endif
struct ConditionalField {
#if defined(X11)
int32_t field
#endif
;
};
struct Normal {
int32_t x;
float y;
};
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#if (defined(PLATFORM_UNIX) && defined(X11))
void root(struct FooHandle a, union C c);
#endif
#if (defined(PLATFORM_WIN) || defined(M_32))
void root(struct BarHandle a, union C c);
#endif
void cond(struct ConditionalField a);
#if defined(PLATFORM_WIN)
extern int32_t foo(void);
#endif
#if defined(PLATFORM_WIN)
extern void bar(struct Normal a);
#endif
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus