|
|
|
| 1 |
|
// xfwrap1 internal header |
| 2 |
|
// NOTE: no include guards |
| 3 |
|
|
| 4 |
|
// sets up macro arguments for use in the header named by _INCL_FILE |
| 5 |
|
|
| 6 |
|
#if _NARGS == 0 |
| 7 |
|
#define _CORE(x) _CORE_0(x) |
| 8 |
|
#define _CORE15(x, y) _CORE15_0(x, y) |
| 9 |
|
#define _CORE2(x, y) _CORE2_0(x, y) |
| 10 |
|
#define _TAIL(x) _TAIL_0(x) |
| 11 |
|
#define _NARGSm1 _NARGSm1_0 |
| 12 |
|
|
| 13 |
|
#elif _NARGS == 1 |
| 14 |
|
#define _CORE(x) _CORE_1(x) |
| 15 |
|
#define _CORE15(x, y) _CORE15_1(x, y) |
| 16 |
|
#define _CORE2(x, y) _CORE2_1(x, y) |
| 17 |
|
#define _TAIL(x) _TAIL_1(x) |
| 18 |
|
#define _NARGSm1 _NARGSm1_1 |
| 19 |
|
|
| 20 |
|
#elif _NARGS == 2 |
| 21 |
|
#define _CORE(x) _CORE_2(x) |
| 22 |
|
#define _CORE15(x, y) _CORE15_2(x, y) |
| 23 |
|
#define _CORE2(x, y) _CORE2_2(x, y) |
| 24 |
|
#define _TAIL(x) _TAIL_2(x) |
| 25 |
|
#define _NARGSm1 _NARGSm1_2 |
| 26 |
|
|
| 27 |
|
#elif _NARGS == 3 |
| 28 |
|
#define _CORE(x) _CORE_3(x) |
| 29 |
|
#define _CORE15(x, y) _CORE15_3(x, y) |
| 30 |
|
#define _CORE2(x, y) _CORE2_3(x, y) |
| 31 |
|
#define _TAIL(x) _TAIL_3(x) |
| 32 |
|
#define _NARGSm1 _NARGSm1_3 |
| 33 |
|
|
| 34 |
|
#elif _NARGS == 4 |
| 35 |
|
#define _CORE(x) _CORE_4(x) |
| 36 |
|
#define _CORE15(x, y) _CORE15_4(x, y) |
| 37 |
|
#define _CORE2(x, y) _CORE2_4(x, y) |
| 38 |
|
#define _TAIL(x) _TAIL_4(x) |
| 39 |
|
#define _NARGSm1 _NARGSm1_4 |
| 40 |
|
|
| 41 |
|
#elif _NARGS == 5 |
| 42 |
|
#define _CORE(x) _CORE_5(x) |
| 43 |
|
#define _CORE15(x, y) _CORE15_5(x, y) |
| 44 |
|
#define _CORE2(x, y) _CORE2_5(x, y) |
| 45 |
|
#define _TAIL(x) _TAIL_5(x) |
| 46 |
|
#define _NARGSm1 _NARGSm1_5 |
| 47 |
|
|
| 48 |
|
#elif _NARGS == 6 |
| 49 |
|
#define _CORE(x) _CORE_6(x) |
| 50 |
|
#define _CORE15(x, y) _CORE15_6(x, y) |
| 51 |
|
#define _CORE2(x, y) _CORE2_6(x, y) |
| 52 |
|
#define _TAIL(x) _TAIL_6(x) |
| 53 |
|
#define _NARGSm1 _NARGSm1_6 |
| 54 |
|
|
| 55 |
|
#elif _NARGS == 7 |
| 56 |
|
#define _CORE(x) _CORE_7(x) |
| 57 |
|
#define _CORE15(x, y) _CORE15_7(x, y) |
| 58 |
|
#define _CORE2(x, y) _CORE2_7(x, y) |
| 59 |
|
#define _TAIL(x) _TAIL_7(x) |
| 60 |
|
#define _NARGSm1 _NARGSm1_7 |
| 61 |
|
|
| 62 |
|
#elif _NARGS == 8 |
| 63 |
|
#define _CORE(x) _CORE_8(x) |
| 64 |
|
#define _CORE15(x, y) _CORE15_8(x, y) |
| 65 |
|
#define _CORE2(x, y) _CORE2_8(x, y) |
| 66 |
|
#define _TAIL(x) _TAIL_8(x) |
| 67 |
|
#define _NARGSm1 _NARGSm1_8 |
| 68 |
|
|
| 69 |
|
#elif _NARGS == 9 |
| 70 |
|
#define _CORE(x) _CORE_9(x) |
| 71 |
|
#define _CORE15(x, y) _CORE15_9(x, y) |
| 72 |
|
#define _CORE2(x, y) _CORE2_9(x, y) |
| 73 |
|
#define _TAIL(x) _TAIL_9(x) |
| 74 |
|
#define _NARGSm1 _NARGSm1_9 |
| 75 |
|
|
| 76 |
|
#elif _NARGS == 10 |
| 77 |
|
#define _CORE(x) _CORE_10(x) |
| 78 |
|
#define _CORE15(x, y) _CORE15_10(x, y) |
| 79 |
|
#define _CORE2(x, y) _CORE2_10(x, y) |
| 80 |
|
#define _TAIL(x) _TAIL_10(x) |
| 81 |
|
#define _NARGSm1 _NARGSm1_10 |
| 82 |
|
|
| 83 |
|
#else /* _NARGS */ |
| 84 |
|
#error bad number of arguments |
| 85 |
|
#endif /* _NARGS */ |
| 86 |
|
|
| 87 |
|
#if _NARGS == 0 |
| 88 |
|
#define _C_TAIL(x) _TAIL(x) |
| 89 |
|
|
| 90 |
|
#elif _NARGS == _NMAX |
| 91 |
|
#define _C_TAIL(x) |
| 92 |
|
|
| 93 |
|
#else /* _NARGS */ |
| 94 |
|
#define _C_TAIL(x) , _TAIL(x) |
| 95 |
|
#endif /* _NARGS */ |
| 96 |
|
|
| 97 |
|
#if _NARGS == 0 |
| 98 |
|
#define _FIRST(x) |
| 99 |
|
#define _FIRSTm1(x) |
| 100 |
|
#define _FIRST15(x, y) |
| 101 |
|
#define _FIRST15m1(x, y) |
| 102 |
|
#define _FIRST2(x, y) |
| 103 |
|
#define _FIRST2m1(x, y) |
| 104 |
|
#define _LAST(x) |
| 105 |
|
#define _LAST15(x, y) |
| 106 |
|
#define _LAST2(x, y) |
| 107 |
|
#define _COMMA0 |
| 108 |
|
#define _COMMA1 |
| 109 |
|
|
| 110 |
|
#elif _NARGS == 1 |
| 111 |
|
#define _FIRST(x) _YNAME(x, 0) |
| 112 |
|
#define _FIRSTm1(x) |
| 113 |
|
#define _FIRST15(x, y) _YNAME15(x, y, 0) |
| 114 |
|
#define _FIRST15m1(x, y) |
| 115 |
|
#define _FIRST2(x, y) _YNAME2(x, y, 0) |
| 116 |
|
#define _FIRST2m1(x, y) |
| 117 |
|
#define _LAST(x) |
| 118 |
|
#define _LAST15(x, y) |
| 119 |
|
#define _LAST2(x, y) |
| 120 |
|
#define _COMMA0 , |
| 121 |
|
#define _COMMA1 |
| 122 |
|
|
| 123 |
|
#else /* _NARGS */ |
| 124 |
|
#define _FIRST(x) _YNAME(x, 0) |
| 125 |
|
#define _FIRSTm1(x) _FIRST(x) |
| 126 |
|
#define _FIRST15(x, y) _YNAME15(x, y, 0) |
| 127 |
|
#define _FIRST15m1(x, y) _YNAME15(x, y, 0) |
| 128 |
|
#define _FIRST2(x, y) _YNAME2(x, y, 0) |
| 129 |
|
#define _FIRST2m1(x, y) _YNAME2(x, y, 0) |
| 130 |
|
#define _LAST(x) _YNAME(x, _NARGSm1) |
| 131 |
|
#define _LAST15(x, y) _YNAME15(x, y, _NARGSm1) |
| 132 |
|
#define _LAST2(x, y) _YNAME2(x, y, _NARGSm1) |
| 133 |
|
#define _COMMA0 , |
| 134 |
|
#define _COMMA1 , |
| 135 |
|
#endif /* _NARGS */ |
| 136 |
|
|
| 137 |
|
#if _NARGS < 2 |
| 138 |
|
#define _MCOMMA |
| 139 |
|
|
| 140 |
|
#else /* _NARGS < 2 */ |
| 141 |
|
#define _MCOMMA , |
| 142 |
|
#endif /* _NARGS < 2*/ |
| 143 |
|
|
| 144 |
|
#if _NARGS < 3 |
| 145 |
|
#define _LCOMMA |
| 146 |
|
|
| 147 |
|
#else /* _NARGS < 3*/ |
| 148 |
|
#define _LCOMMA , |
| 149 |
|
#endif /* _NARGS < 3*/ |
| 150 |
|
|
| 151 |
|
#define _CLASS_NAME(x) _YNAME(x, _NARGS) |
| 152 |
|
#define _PREV_NAME(x) _YNAME(x, _NARGSm1) |
| 153 |
|
|
| 154 |
|
#define _CDR(x) _CORE(x) _LCOMMA _LAST(x) |
| 155 |
|
#define _CDR15(x, y) _CORE15(x, y) _LCOMMA _LAST15(x, y) |
| 156 |
|
#define _CDR2(x, y) _CORE2(x, y) _LCOMMA _LAST2(x, y) |
| 157 |
|
#define _LIST(x) _FIRST(x) _MCOMMA _CDR(x) |
| 158 |
|
#define _LISTm1(x) _FIRSTm1(x) _LCOMMA _CORE(x) |
| 159 |
|
#define _LIST15(x, y) _FIRST15(x, y) _MCOMMA _CDR15(x, y) |
| 160 |
|
#define _LIST15m1(x, y) _FIRST15m1(x, y) _LCOMMA _CORE15(x, y) |
| 161 |
|
#define _LIST2(x, y) _FIRST2(x, y) _MCOMMA _CDR2(x, y) |
| 162 |
|
#define _LIST2m1(x, y) _FIRST2m1(x, y) _LCOMMA _CORE2(x, y) |
| 163 |
|
|
| 164 |
|
#define _CLASS_ARG0 _LIST(class _Arg) |
| 165 |
|
#define _CLASS_ARG0m1 _LISTm1(class _Arg) |
| 166 |
|
#define _CLASS_ARG1 _CDR(class _Arg) |
| 167 |
|
#define _CLASS_FARG0 _LIST(class _Farg) |
| 168 |
|
#define _ARG0_ARG1 _LIST(_Arg) |
| 169 |
|
#define _ARG0_ARG1_REF _LIST15(_Arg, &) |
| 170 |
|
#define _ARG0_ARG1_CREF _LIST15(const _Arg, &) |
| 171 |
|
#define _ARG0_ARG1m1 _LISTm1(_Arg) |
| 172 |
|
#define _ARG1_ARG2 _CDR(_Arg) |
| 173 |
|
#define _ARG1_ARG2m1 _CORE(_Arg) |
| 174 |
|
#define _FARG0_FARG1 _LIST(_Farg) |
| 175 |
|
#define _FARG0_FARG1_REF _LIST15(_Farg, &) |
| 176 |
|
#define _FARG0_FARG1_CREF _LIST15(const _Farg, &) |
| 177 |
|
#define _FARG1_FARG2 _CDR(_Farg) |
| 178 |
|
#define _FARG1_FARG2_REF _CDR15(_Farg, &) |
| 179 |
|
#define _FARG1_FARG2_CREF _CDR15(const _Farg, &) |
| 180 |
|
#define _ARG0_A0 _LIST2(_Arg, _Ax) |
| 181 |
|
#define _ARG0_A0_REF _LIST2(_Arg, &_Ax) |
| 182 |
|
#define _ARG0_A0_CREF _LIST2(const _Arg, &_Ax) |
| 183 |
|
#define _FARG1_F1 _CDR2(_Farg, _Fx) |
| 184 |
|
#define _FARG1_F1_REF _CDR2(_Farg, &_Fx) |
| 185 |
|
#define _FARG1_F1_CREF _CDR2(const _Farg, &_Fx) |
| 186 |
|
#define _FARG0_F0 _LIST2(_Farg, _Fx) |
| 187 |
|
#define _FARG0_F0_REF _LIST2(_Farg, &_Fx) |
| 188 |
|
#define _FARG0_F0_CREF _LIST2(const _Farg, &_Fx) |
| 189 |
|
#define _A0_A1 _LIST(_Ax) |
| 190 |
|
#define _F0_F1 _LIST(_Fx) |
| 191 |
|
#define _F1_F2 _CDR(_Fx) |
| 192 |
|
#define _A0_A1m1 _LISTm1(_Ax) |
| 193 |
|
#define _A1_A2m1 _CORE(_Ax) |
| 194 |
|
|
| 195 |
|
#define _ARG0_A0_TO_REF \ |
| 196 |
|
_LIST2(typename _Remove_reference<_Arg, >::_Type& _Ax) |
| 197 |
|
#define _ARG0_ARG1_TO_REF \ |
| 198 |
|
_LIST15(typename _Remove_reference<_Arg, >::_Type&) |
| 199 |
|
#define _C_ARG0_ARG1_TO_REF _COMMA0 _ARG0_ARG1_TO_REF |
| 200 |
|
|
| 201 |
|
#define _C_CLASS_ARG0 _COMMA0 _CLASS_ARG0 |
| 202 |
|
#define _C_CLASS_ARG1 _COMMA1 _CLASS_ARG1 |
| 203 |
|
#define _C_ARG0_ARG1 _COMMA0 _ARG0_ARG1 |
| 204 |
|
#define _C_ARG0_ARG1_REF _COMMA0 _ARG0_ARG1_REF |
| 205 |
|
#define _C_ARG0_A0 _COMMA0 _ARG0_A0 |
| 206 |
|
#define _C_A0_A1 _COMMA0 _A0_A1 |
| 207 |
|
#define _C_A0_A1m1 _COMMA1 _A0_A1m1 |
| 208 |
|
#define _C_ARG0_ARG1m1 _COMMA1 _ARG0_ARG1m1 |
| 209 |
|
#define _C_CLASS_FARG0 _COMMA0 _CLASS_FARG0 |
| 210 |
|
#define _C_FARG0_FARG1 _COMMA0 _FARG0_FARG1 |
| 211 |
|
#define _C_FARG0_FARG1_REF _COMMA0 _FARG0_FARG1_REF |
| 212 |
|
#define _C_FARG1_FARG2 _COMMA1 _FARG1_FARG2 |
| 213 |
|
#define _C_FARG1_FARG2_REF _COMMA1 _FARG1_FARG2_REF |
| 214 |
|
#define _C_FARG1_FARG2_CREF _COMMA1 _FARG1_FARG2_CREF |
| 215 |
|
#define _C_FARG1_F1 _COMMA1 _FARG1_F1 |