/
cfg_tag.pyx
77 lines (60 loc) · 1.24 KB
/
cfg_tag.pyx
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
#if 0
DEF PLATFORM_UNIX = 0
DEF PLATFORM_WIN = 0
DEF X11 = 0
DEF M_32 = 0
#endif
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
cdef extern from *:
ctypedef bint bool
ctypedef struct va_list
cdef extern from *:
IF (PLATFORM_WIN or M_32):
cdef enum:
A,
B,
C,
ctypedef uint32_t BarType;
IF (PLATFORM_UNIX and X11):
cdef enum:
A,
B,
C,
ctypedef uint32_t FooType;
IF (PLATFORM_UNIX and X11):
cdef struct FooHandle:
FooType ty;
int32_t x;
float y;
cdef enum:
C1,
C2,
C3,
C5,
ctypedef uint8_t C_Tag;
cdef struct C5_Body:
C_Tag tag;
int32_t int_;
cdef union C:
C_Tag tag;
C5_Body c5;
IF (PLATFORM_WIN or M_32):
cdef struct BarHandle:
BarType ty;
int32_t x;
float y;
cdef struct ConditionalField:
int32_t field;
cdef struct Normal:
int32_t x;
float y;
IF (PLATFORM_UNIX and X11):
void root(FooHandle a, C c);
IF (PLATFORM_WIN or M_32):
void root(BarHandle a, C c);
void cond(ConditionalField a);
IF PLATFORM_WIN:
extern int32_t foo();
IF PLATFORM_WIN:
extern void bar(Normal a);