Debian Codegraph @

.cargo/vendor/cbindgen/tests/expectations/cfg.compat.c

raw
1 #if 0
2 DEF PLATFORM_UNIX = 0
3 DEF PLATFORM_WIN = 0
4 DEF X11 = 0
5 DEF M_32 = 0
6 #endif
7
8
9 #include <stdarg.h>
10 #include <stdbool.h>
11 #include <stdint.h>
12 #include <stdlib.h>
13
14 #if (defined(PLATFORM_WIN) || defined(M_32))
15 enum BarType
16 #ifdef __cplusplus
17 : uint32_t
18 #endif // __cplusplus
19 {
20 A,
21 B,
22 C,
23 };
24 #ifndef __cplusplus
25 typedef uint32_t BarType;
26 #endif // __cplusplus
27 #endif
28
29 #if (defined(PLATFORM_UNIX) && defined(X11))
30 enum FooType
31 #ifdef __cplusplus
32 : uint32_t
33 #endif // __cplusplus
34 {
35 A,
36 B,
37 C,
38 };
39 #ifndef __cplusplus
40 typedef uint32_t FooType;
41 #endif // __cplusplus
42 #endif
43
44 #if (defined(PLATFORM_UNIX) && defined(X11))
45 typedef struct {
46 FooType ty;
47 int32_t x;
48 float y;
49 } FooHandle;
50 #endif
51
52 enum C_Tag
53 #ifdef __cplusplus
54 : uint8_t
55 #endif // __cplusplus
56 {
57 C1,
58 C2,
59 #if defined(PLATFORM_WIN)
60 C3,
61 #endif
62 #if defined(PLATFORM_UNIX)
63 C5,
64 #endif
65 };
66 #ifndef __cplusplus
67 typedef uint8_t C_Tag;
68 #endif // __cplusplus
69
70 #if defined(PLATFORM_UNIX)
71 typedef struct {
72 C_Tag tag;
73 int32_t int_;
74 } C5_Body;
75 #endif
76
77 typedef union {
78 C_Tag tag;
79 #if defined(PLATFORM_UNIX)
80 C5_Body c5;
81 #endif
82 } C;
83
84 #if (defined(PLATFORM_WIN) || defined(M_32))
85 typedef struct {
86 BarType ty;
87 int32_t x;
88 float y;
89 } BarHandle;
90 #endif
91
92 typedef struct {
93 #if defined(X11)
94 int32_t field
95 #endif
96 ;
97 } ConditionalField;
98
99 #ifdef __cplusplus
100 extern "C" {
101 #endif // __cplusplus
102
103 #if (defined(PLATFORM_UNIX) && defined(X11))
104 void root(FooHandle a, C c);
105 #endif
106
107 #if (defined(PLATFORM_WIN) || defined(M_32))
108 void root(BarHandle a, C c);
109 #endif
110
111 void cond(ConditionalField a);
112
113 #ifdef __cplusplus
114 } // extern "C"
115 #endif // __cplusplus