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 A, 17 B, 18 C, 19 }; 20 typedef uint32_t BarType; 21 #endif 22 23 #if (defined(PLATFORM_UNIX) && defined(X11)) 24 enum FooType { 25 A, 26 B, 27 C, 28 }; 29 typedef uint32_t FooType; 30 #endif 31 32 #if (defined(PLATFORM_UNIX) && defined(X11)) 33 typedef struct FooHandle { 34 FooType ty; 35 int32_t x; 36 float y; 37 } FooHandle; 38 #endif 39 40 enum C_Tag { 41 C1, 42 C2, 43 #if defined(PLATFORM_WIN) 44 C3, 45 #endif 46 #if defined(PLATFORM_UNIX) 47 C5, 48 #endif 49 }; 50 typedef uint8_t C_Tag; 51 52 #if defined(PLATFORM_UNIX) 53 typedef struct C5_Body { 54 C_Tag tag; 55 int32_t int_; 56 } C5_Body; 57 #endif 58 59 typedef union C { 60 C_Tag tag; 61 #if defined(PLATFORM_UNIX) 62 C5_Body c5; 63 #endif 64 } C; 65 66 #if (defined(PLATFORM_WIN) || defined(M_32)) 67 typedef struct BarHandle { 68 BarType ty; 69 int32_t x; 70 float y; 71 } BarHandle; 72 #endif 73 74 typedef struct ConditionalField { 75 #if defined(X11) 76 int32_t field 77 #endif 78 ; 79 } ConditionalField; 80 81 #if (defined(PLATFORM_UNIX) && defined(X11)) 82 void root(struct FooHandle a, union C c); 83 #endif 84 85 #if (defined(PLATFORM_WIN) || defined(M_32)) 86 void root(struct BarHandle a, union C c); 87 #endif 88 89 void cond(struct ConditionalField a); 90