All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
preprocessorUtils.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_BASE_TF_PREPROCESSOR_UTILS_H
25 #define PXR_BASE_TF_PREPROCESSOR_UTILS_H
26 
29 
30 #ifndef TF_MAX_ARITY
31 # define TF_MAX_ARITY 7
32 #endif // TF_MAX_ARITY
33 
34 #include "pxr/base/arch/defines.h"
35 #include "pxr/base/arch/pragmas.h"
36 #include <boost/preprocessor/arithmetic/add.hpp>
37 #include <boost/preprocessor/arithmetic/inc.hpp>
38 #include <boost/preprocessor/arithmetic/sub.hpp>
39 #include <boost/preprocessor/cat.hpp>
40 #include <boost/preprocessor/control/expr_iif.hpp>
41 #include <boost/preprocessor/comparison/equal.hpp>
42 #include <boost/preprocessor/facilities/expand.hpp>
43 #include <boost/preprocessor/punctuation/comma.hpp>
44 #include <boost/preprocessor/punctuation/paren.hpp>
45 #include <boost/preprocessor/repetition/repeat.hpp>
46 #include <boost/preprocessor/tuple/eat.hpp>
47 #include <boost/preprocessor/tuple/to_list.hpp>
48 #include <boost/preprocessor/tuple/to_seq.hpp>
49 #if defined(ARCH_COMPILER_MSVC)
50 #include <boost/preprocessor/variadic/size.hpp>
51 #include <boost/vmd/is_empty.hpp>
52 #include <boost/vmd/is_tuple.hpp>
53 ARCH_PRAGMA_MACRO_TOO_FEW_ARGUMENTS
54 #endif
55 
56 // In boost version 1.51, they seem to have neglected to define this.
57 // Without it, some functions will get confused about macros with no arguments
58 #ifndef BOOST_PP_TUPLE_TO_SEQ_0
59 #define BOOST_PP_TUPLE_TO_SEQ_0()
60 #endif
61 
69 #if defined(ARCH_COMPILER_MSVC)
70 #define TF_NUM_ARGS(...) \
71  BOOST_PP_IIF(BOOST_VMD_IS_EMPTY(__VA_ARGS__),\
72  0, BOOST_PP_VARIADIC_SIZE(__VA_ARGS__))
73 #else
74 #define TF_NUM_ARGS(...) \
75  _TF_NUM_ARGS_CHECK(__VA_ARGS__) \
76  BOOST_PP_IIF(BOOST_PP_EQUAL(1, _TF_NUM_ARGS1(__VA_ARGS__)), \
77  BOOST_PP_EXPAND(TF_ARG_2 BOOST_PP_LPAREN() \
78  BOOST_PP_EXPAND(_TF_NUM_ARGS_0X TF_ARG_1(__VA_ARGS__) \
79  (BOOST_PP_REPEAT(TF_MAX_ARITY, _TF_NUM_ARGS_REP, _TF))) \
80  BOOST_PP_COMMA() 1 BOOST_PP_RPAREN()), \
81  _TF_NUM_ARGS1(__VA_ARGS__))
82 
83 #define _TF_NUM_ARGS_CHECK(...) \
84  BOOST_PP_IIF(_TF_EXPAND(TF_ARG_2 BOOST_PP_LPAREN() \
85  BOOST_PP_CAT(_TF_NUM_ARGS_00, _TF_EXPAND( \
86  BOOST_PP_CAT(TF_ARG_, BOOST_PP_INC(TF_MAX_ARITY)) \
87  _TF_NUM_ARGS_TF(__VA_ARGS__))) BOOST_PP_COMMA() 1 BOOST_PP_RPAREN()), \
88  _TF_MAX_ARITY_OVERFLOW_IN_TF_NUM_ARGS, BOOST_PP_TUPLE_EAT(1))(...)
89 
90 #define _TF_NUM_ARGS_00_TF 0, 0
91 #define _TF_MAX_ARITY_OVERFLOW_IN_TF_NUM_ARGS(a, b, c)
92 
93 #define _TF_NUM_ARGS_0X(a, ...) \
94  _TF_NUM_ARGS_CHECK(a, __VA_ARGS__) 0, \
95  BOOST_PP_IIF(BOOST_PP_EQUAL(TF_MAX_ARITY, _TF_NUM_ARGS1(__VA_ARGS__)), \
96  0, 1 BOOST_PP_TUPLE_EAT(BOOST_PP_INC(TF_MAX_ARITY)))
97 
98 #define _TF_EXPAND(x) x // We need this due to a bug in the preprocessor.
99 #define _TF_NUM_ARGS1(...) \
100  _TF_EXPAND(BOOST_PP_CAT(TF_ARG_, BOOST_PP_INC(TF_MAX_ARITY)) \
101  _TF_NUM_ARGS_EXT(__VA_ARGS__))
102 
103 #define _TF_NUM_ARGS_DEC(z, i, n) BOOST_PP_COMMA() BOOST_PP_SUB(n, i)
104 #define _TF_NUM_ARGS_REP(z, i, n) BOOST_PP_COMMA() n
105 
106 #define _TF_NUM_ARGS_EXT(...) \
107  (__VA_ARGS__ BOOST_PP_REPEAT(BOOST_PP_INC(TF_MAX_ARITY), \
108  _TF_NUM_ARGS_DEC, TF_MAX_ARITY))
109 #define _TF_NUM_ARGS_TF(...) \
110  (__VA_ARGS__ BOOST_PP_REPEAT(BOOST_PP_INC(TF_MAX_ARITY), \
111  _TF_NUM_ARGS_REP, _TF))
112 #endif
113 
114 
119 //
120 // If the arguments satisfy _TF_PP_EAT_PARENS_IS_PARENS() then we expand to
121 // _TF_PP_EAT_PARENS_EXPAND1, otherwise to _TF_PP_EAT_PARENS_EXPAND. The
122 // former eats the parentheses while the latter passes the arguments
123 // unchanged.
124 //
125 // We add the ~ after the first __VA_ARGS__ in case there are zero
126 // arguments. MSVC will complain about insufficient arguments otherwise.
127 // The ~ will be discarded in any case.
128 #define TF_PP_EAT_PARENS(...) \
129  _TF_PP_EAT_PARENS_IFF(_TF_PP_EAT_PARENS_IS_PARENS(__VA_ARGS__ ~),\
130  _TF_PP_EAT_PARENS_EXPAND1,_TF_PP_EAT_PARENS_EXPAND)(__VA_ARGS__)
131 
133 // We can't use
134 // BOOST_PP_STRINGIZE because on MSVC passing no arguments will report "not
135 // enough actual parameters" and yield nothing. We want no warnings and an
136 // empty string. We do that by passing an unused first argument to the inner
137 // macro (we need an inner macro to cause expansion). This causes MSVC to
138 // yield "" for an empty __VA_ARGS__ list.
139 #define TF_PP_EAT_PARENS_STR(...) _TF_PP_EAT_PARENS_STR2(~, __VA_ARGS__)
140 #define _TF_PP_EAT_PARENS_STR2(x, ...) #__VA_ARGS__
141 
142 // Expands to the second argument if c is 1 and the third argument if c is
143 // 0. No other values of c are allowed. We can't use BOOST_PP_IFF() because
144 // it won't expand during stringizing under MSVC.
145 #define _TF_PP_EAT_PARENS_IFF(c, t, f) \
146  BOOST_PP_CAT(_TF_PP_EAT_PARENS_IFF_, c)(t, f)
147 #define _TF_PP_EAT_PARENS_IFF_0(t, f) f
148 #define _TF_PP_EAT_PARENS_IFF_1(t, f) t
149 
150 // Force expansion of the arguments.
151 #define _TF_PP_EAT_PARENS_EXPAND(...) __VA_ARGS__
152 
153 // Similar to expand except it will eat the first matching pair of
154 // parentheses. For example, _TF_PP_EAT_PARENS_EXPAND1((x)(y)) yields x(y).
155 // The outer _TF_PP_EAT_PARENS_EXPAND() is needed for MSVC, which otherwise
156 // would stringizing to "_TF_PP_EAT_PARENS_EXPAND " plus the literal
157 // substitution of the arguments.
158 #define _TF_PP_EAT_PARENS_EXPAND1(...) \
159  _TF_PP_EAT_PARENS_EXPAND(_TF_PP_EAT_PARENS_EXPAND __VA_ARGS__)
160 
161 // This works around a MSVC bug. When a macro expands to FOO(__VA_ARGS__,bar),
162 // MSVC will separate the arguments of __VA_ARGS__ even if they're inside
163 // matching parentheses. So, for example, if __VA_ARGS__ is (x,y) then we'll
164 // expand to FOO(x,y,bar) instead of FOO((x,y),bar). This macro works around
165 // that. Use: _TF_PP_EAT_PARENS_CALL(FOO,(__VA_ARGS__,bar)).
166 //
167 // We need the _TF_PP_EAT_PARENS_EXPAND() here otherwise stringizing will
168 // stringize the literal replacements, not the result of the expansion of x y.
169 // If FOO(x,y) expands to x+y then we'd get "FOO ((x,y),bar)" without
170 // _TF_PP_EAT_PARENS_EXPAND() instead of the correct "(x,y)+bar".
171 #define _TF_PP_EAT_PARENS_CALL(x, y) _TF_PP_EAT_PARENS_EXPAND(x y)
172 
173 // Expands to 1 if x starts with a matched parenthesis, otherwise expands to
174 // 0. "_TF_PP_EAT_PARENS_IS_PARENS2 x" eats the parentheses if they exist and
175 // expands to "x, 1,", otherwise it expands to _TF_PP_EAT_PARENS_IS_PARENS2
176 // and the literal expansion of x. This result goes to
177 // _TF_PP_EAT_PARENS_IS_PARENS_CHECK_N() which extracts the 1 expanded from
178 // _TF_PP_EAT_PARENS_IS_PARENS2 or a 0 passed as a final argument. In either
179 // case the desired result is the second argument to
180 // _TF_PP_EAT_PARENS_IS_PARENS_CHECK_N.
181 #define _TF_PP_EAT_PARENS_IS_PARENS(x) \
182  _TF_PP_EAT_PARENS_IS_PARENS_CHECK(_TF_PP_EAT_PARENS_IS_PARENS2 x)
183 #define _TF_PP_EAT_PARENS_IS_PARENS_CHECK(...) \
184  _TF_PP_EAT_PARENS_CALL(_TF_PP_EAT_PARENS_IS_PARENS_CHECK_N,(__VA_ARGS__,0,))
185 #define _TF_PP_EAT_PARENS_IS_PARENS_CHECK_N(x, n, ...) n
186 #define _TF_PP_EAT_PARENS_IS_PARENS_TRUE(x) x, 1,
187 #define _TF_PP_EAT_PARENS_IS_PARENS2(...) _TF_PP_EAT_PARENS_IS_PARENS_TRUE(~)
188 
192 #if defined(ARCH_COMPILER_MSVC)
193  #define TF_PP_IS_TUPLE(sequence) \
194  BOOST_VMD_IS_TUPLE(sequence)
195 #else
196 
197 #define TF_PP_IS_TUPLE(arg) \
198  BOOST_PP_CAT(_TF_PP_IS_TUPLE, BOOST_PP_EXPAND(_TF_PP_IS_TUPLE arg)) )
199 
200 #define _TF_PP_IS_TUPLE(...) _TF
201 
202 #define _TF_PP_IS_TUPLE_TF _TF_PP_IS_TUPLE_TRUE(
203 #define _TF_PP_IS_TUPLE_TF_PP_IS_TUPLE _TF_PP_IS_TUPLE_FALSE(
204 
205 #define _TF_PP_IS_TUPLE_TRUE() 1
206 #define _TF_PP_IS_TUPLE_FALSE(arg) 0
207 
208 #endif
209 
213 #define TF_PP_TUPLE_SIZE(tuple) \
214  BOOST_PP_EXPAND(TF_NUM_ARGS tuple)
215 
219 #define TF_PP_TUPLE_TO_LIST(tuple) \
220  BOOST_PP_IIF( \
221  BOOST_PP_EQUAL(TF_PP_TUPLE_SIZE(tuple), 0), \
222  BOOST_PP_LIST_NIL, \
223  BOOST_PP_TUPLE_TO_LIST(TF_PP_TUPLE_SIZE(tuple), tuple))
224 
228 #define TF_PP_TUPLE_TO_SEQ(tuple) \
229  BOOST_PP_IIF( \
230  BOOST_PP_EQUAL(TF_PP_TUPLE_SIZE(tuple), 0), \
231  BOOST_PP_EMPTY(), \
232  BOOST_PP_TUPLE_TO_SEQ(TF_PP_TUPLE_SIZE(tuple), tuple))
233 
237 #define TF_MAKE_PP_ARRAY(...) \
238  (TF_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__))
239 
243 #define TF_MAKE_PP_LIST(...) \
244  TF_PP_TUPLE_TO_LIST((__VA_ARGS__))
245 
249 #define TF_MAKE_PP_SEQ(...) \
250  TF_PP_TUPLE_TO_SEQ((__VA_ARGS__))
251 
255 #define TF_ARG_1(_1,...) _1
256 #define TF_ARG_2(_1,_2,...) _2
257 #define TF_ARG_3(_1,_2,_3,...) _3
258 #define TF_ARG_4(_1,_2,_3,_4,...) _4
259 #define TF_ARG_5(_1,_2,_3,_4,_5,...) _5
260 #define TF_ARG_6(_1,_2,_3,_4,_5,_6,...) _6
261 #define TF_ARG_7(_1,_2,_3,_4,_5,_6,_7,...) _7
262 #define TF_ARG_8(_1,_2,_3,_4,_5,_6,_7,_8,...) _8
263 #define TF_ARG_9(_1,_2,_3,_4,_5,_6,_7,_8,_9,...) _9
264 #define TF_ARG_10(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,...) _10
265 #define TF_ARG_11(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,...) _11
266 #define TF_ARG_12(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,...) _12
267 #define TF_ARG_13(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,...) _13
268 #define TF_ARG_14(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,...) _14
269 #define TF_ARG_15(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,...) _15
270 #define TF_ARG_16(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,...) _16
271 #define TF_ARG_17(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,...) _17
272 #define TF_ARG_18(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,...) _18
273 #define TF_ARG_19(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,...) _19
274 #define TF_ARG_20(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,...) _20
275 #define TF_ARG_21(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,...) _21
276 #define TF_ARG_22(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,...) _22
277 #define TF_ARG_23(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,...) _23
278 #define TF_ARG_24(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,...) _24
279 #define TF_ARG_25(_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,...) _25
280 #define TF_ARG_26(_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,...) _26
281 #define TF_ARG_27(_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,...) _27
282 #define TF_ARG_28(_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,...) _28
283 #define TF_ARG_29(_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,...) _29
284 #define TF_ARG_30(_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,...) _30
285 #define TF_ARG_31(_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,...) _31
286 #define TF_ARG_32(_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,...) _32
287 #define TF_ARG_33(_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,...) _33
288 #define TF_ARG_34(_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,...) _34
289 #define TF_ARG_35(_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,...) _35
290 #define TF_ARG_36(_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,...) _36
291 #define TF_ARG_37(_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,...) _37
292 #define TF_ARG_38(_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,...) _38
293 #define TF_ARG_39(_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,...) _39
294 #define TF_ARG_40(_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,...) _40
295 #define TF_ARG_41(_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,...) _41
296 #define TF_ARG_42(_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,...) _42
297 #define TF_ARG_43(_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,...) _43
298 #define TF_ARG_44(_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,...) _44
299 #define TF_ARG_45(_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,...) _45
300 #define TF_ARG_46(_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,...) _46
301 #define TF_ARG_47(_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,...) _47
302 #define TF_ARG_48(_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,...) _48
303 #define TF_ARG_49(_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,...) _49
304 #define TF_ARG_50(_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,...) _50
305 #define TF_ARG_51(_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,...) _51
306 #define TF_ARG_52(_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,...) _52
307 #define TF_ARG_53(_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,...) _53
308 #define TF_ARG_54(_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,...) _54
309 #define TF_ARG_55(_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,...) _55
310 #define TF_ARG_56(_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,...) _56
311 #define TF_ARG_57(_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,...) _57
312 #define TF_ARG_58(_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,...) _58
313 #define TF_ARG_59(_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,...) _59
314 #define TF_ARG_60(_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,...) _60
315 #define TF_ARG_61(_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,...) _61
316 #define TF_ARG_62(_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,...) _62
317 #define TF_ARG_63(_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,...) _63
318 #define TF_ARG_64(_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,...) _64
319 
320 #if TF_MAX_ARITY > 64
321 #error "TF_MAX_ARITY is larger than _MAX_ARGS"
322 #endif
323 
324 #endif /* PXR_BASE_TF_PREPROCESSOR_UTILS_H */
Pragmas for controlling compiler-specific behaviors.