28 @
"RGB", FB_RTL_OPT_NONE, _
34 ( FB_DEFTOK_TYPE_TEX, @
"((cuint(" ), _
35 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
36 ( FB_DEFTOK_TYPE_TEX, @
") shl 16) or (cuint(" ), _
37 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
38 ( FB_DEFTOK_TYPE_TEX, @
") shl 8) or cuint(" ), _
39 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
40 ( FB_DEFTOK_TYPE_TEX, @
") or &hFF000000)" ), _
46 @
"RGBA", FB_RTL_OPT_NONE, _
49 @
"R", @
"G", @
"B", @
"A" _
52 ( FB_DEFTOK_TYPE_TEX, @
"((cuint(" ), _
53 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
54 ( FB_DEFTOK_TYPE_TEX, @
") shl 16) or (cuint(" ), _
55 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
56 ( FB_DEFTOK_TYPE_TEX, @
") shl 8) or cuint(" ), _
57 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
58 ( FB_DEFTOK_TYPE_TEX, @
") or (cuint(" ), _
59 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 3 ) ), _
60 ( FB_DEFTOK_TYPE_TEX, @
") shl 24))" ), _
66 @
"VA_ARG", FB_RTL_OPT_NOGCC, _
72 ( FB_DEFTOK_TYPE_TEX, @
"peek(" ), _
73 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
74 ( FB_DEFTOK_TYPE_TEX, @
"," ), _
75 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
76 ( FB_DEFTOK_TYPE_TEX, @
")" ), _
82 @
"VA_NEXT", FB_RTL_OPT_NOGCC, _
88 ( FB_DEFTOK_TYPE_TEX, @
"(cptr(" ), _
89 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
90 ( FB_DEFTOK_TYPE_TEX, @
" ptr, cptr(byte ptr, " ), _
91 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
92 ( FB_DEFTOK_TYPE_TEX, @
") + (sizeof(" ), _
93 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
94 ( FB_DEFTOK_TYPE_TEX, @
") + sizeof(any ptr)-1 and -sizeof(any ptr)) ) )" ), _
100 @
"ASSERT", FB_RTL_OPT_DBGONLY, _
106 ( FB_DEFTOK_TYPE_TEX, @
"if (" ), _
107 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
108 ( FB_DEFTOK_TYPE_TEX, @
") = 0 then fb_Assert(__FILE__, __LINE__, __FUNCTION__, " ), _
109 ( FB_DEFTOK_TYPE_PARAMSTR,
cast(
any ptr, 0 ) ), _
110 ( FB_DEFTOK_TYPE_TEX, @
") end if" ), _
116 @
"ASSERTWARN", FB_RTL_OPT_DBGONLY, _
122 ( FB_DEFTOK_TYPE_TEX, @
"if (" ), _
123 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
124 ( FB_DEFTOK_TYPE_TEX, @
") = 0 then fb_AssertWarn(__FILE__, __LINE__, __FUNCTION__, " ), _
125 ( FB_DEFTOK_TYPE_PARAMSTR,
cast(
any ptr, 0 ) ), _
126 ( FB_DEFTOK_TYPE_TEX, @
") end if" ), _
132 @
"OFFSETOF", FB_RTL_OPT_NONE, _
138 ( FB_DEFTOK_TYPE_TEX, @
"cint( @cast( " ), _
139 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
140 ( FB_DEFTOK_TYPE_TEX, @
" ptr, 0 )->" ), _
141 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
142 ( FB_DEFTOK_TYPE_TEX, @
" )" ), _
148 @
"__FB_MIN_VERSION__", FB_RTL_OPT_NONE, _
151 @
"MAJOR", @
"MINOR", @
"PATCH_LEVEL" _
154 ( FB_DEFTOK_TYPE_TEX, @
"((__FB_VER_MAJOR__ > (" ), _
155 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
156 ( FB_DEFTOK_TYPE_TEX, @
")) or ((__FB_VER_MAJOR__ = (" ), _
157 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
158 ( FB_DEFTOK_TYPE_TEX, @
")) and ((__FB_VER_MINOR__ > (" ), _
159 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
160 ( FB_DEFTOK_TYPE_TEX, @
")) or (__FB_VER_MINOR__ = (" ), _
161 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
162 ( FB_DEFTOK_TYPE_TEX, @
") and __FB_VER_PATCH__ >= (" ), _
163 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
164 ( FB_DEFTOK_TYPE_TEX, @
")))))" ), _
170 @
"LOWORD", FB_RTL_OPT_NONE, _
176 ( FB_DEFTOK_TYPE_TEX, @
"(cuint(" ), _
177 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
178 ( FB_DEFTOK_TYPE_TEX, @
") and &h0000FFFF)" ), _
184 @
"HIWORD", FB_RTL_OPT_NONE, _
190 ( FB_DEFTOK_TYPE_TEX, @
"(cuint(" ), _
191 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
192 ( FB_DEFTOK_TYPE_TEX, @
") shr 16)" ), _
198 @
"LOBYTE", FB_RTL_OPT_NONE, _
204 ( FB_DEFTOK_TYPE_TEX, @
"(cuint(" ), _
205 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
206 ( FB_DEFTOK_TYPE_TEX, @
") and &h000000FF)" ), _
212 @
"HIBYTE", FB_RTL_OPT_NONE, _
218 ( FB_DEFTOK_TYPE_TEX, @
"((cuint(" ), _
219 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
220 ( FB_DEFTOK_TYPE_TEX, @
") and &h0000FF00) shr 8)" ), _
226 @
"BIT", FB_RTL_OPT_NONE, _
232 ( FB_DEFTOK_TYPE_TEX, @
"(((" ), _
233 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
234 ( FB_DEFTOK_TYPE_TEX, @
") and (cast(typeof(" ), _
235 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
236 ( FB_DEFTOK_TYPE_TEX, @
"), 1) shl (" ), _
237 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
238 ( FB_DEFTOK_TYPE_TEX, @
"))) <> 0)" ), _
244 @
"BITSET", FB_RTL_OPT_NONE, _
250 ( FB_DEFTOK_TYPE_TEX, @
"((" ), _
251 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
252 ( FB_DEFTOK_TYPE_TEX, @
") or (cast(typeof(" ), _
253 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
254 ( FB_DEFTOK_TYPE_TEX, @
"), 1) shl (" ), _
255 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
256 ( FB_DEFTOK_TYPE_TEX, @
")))" ), _
262 @
"BITRESET", FB_RTL_OPT_NONE, _
268 ( FB_DEFTOK_TYPE_TEX, @
"((" ), _
269 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
270 ( FB_DEFTOK_TYPE_TEX, @
") and not (cast(typeof(" ), _
271 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
272 ( FB_DEFTOK_TYPE_TEX, @
"), 1) shl (" ), _
273 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
274 ( FB_DEFTOK_TYPE_TEX, @
")))" ), _
290 @
"__RGB", FB_RTL_OPT_NONE, _
296 ( FB_DEFTOK_TYPE_TEX, @
"((__cuint(" ), _
297 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
298 ( FB_DEFTOK_TYPE_TEX, @
") __shl 16) or (__cuint(" ), _
299 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
300 ( FB_DEFTOK_TYPE_TEX, @
") __shl 8) or __cuint(" ), _
301 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
302 ( FB_DEFTOK_TYPE_TEX, @
") or &hFF000000)" ), _
308 @
"__RGBA", FB_RTL_OPT_NONE, _
311 @
"R", @
"G", @
"B", @
"A" _
314 ( FB_DEFTOK_TYPE_TEX, @
"((__cuint(" ), _
315 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
316 ( FB_DEFTOK_TYPE_TEX, @
") __shl 16) or (__cuint(" ), _
317 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
318 ( FB_DEFTOK_TYPE_TEX, @
") __shl 8) or __cuint(" ), _
319 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
320 ( FB_DEFTOK_TYPE_TEX, @
") or (__cuint(" ), _
321 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 3 ) ), _
322 ( FB_DEFTOK_TYPE_TEX, @
") __shl 24))" ), _
328 @
"__VA_ARG", FB_RTL_OPT_NOGCC, _
334 ( FB_DEFTOK_TYPE_TEX, @
"peek(" ), _
335 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
336 ( FB_DEFTOK_TYPE_TEX, @
"," ), _
337 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
338 ( FB_DEFTOK_TYPE_TEX, @
")" ), _
344 @
"__VA_NEXT", FB_RTL_OPT_NOGCC, _
350 ( FB_DEFTOK_TYPE_TEX, @
"(__cptr(" ), _
351 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
352 ( FB_DEFTOK_TYPE_TEX, @
" __ptr, __cptr(__byte __ptr, " ), _
353 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
354 ( FB_DEFTOK_TYPE_TEX, @
") + (__sizeof(" ), _
355 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
356 ( FB_DEFTOK_TYPE_TEX, @
") + __sizeof(any __ptr)-1 and -__sizeof(any __ptr)) ) )" ), _
362 @
"__ASSERT", FB_RTL_OPT_DBGONLY, _
368 ( FB_DEFTOK_TYPE_TEX, @
"if (" ), _
369 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
370 ( FB_DEFTOK_TYPE_TEX, @
") = 0 then fb_Assert(__FILE__, __LINE__, __FUNCTION__, " ), _
371 ( FB_DEFTOK_TYPE_PARAMSTR,
cast(
any ptr, 0 ) ), _
372 ( FB_DEFTOK_TYPE_TEX, @
") end if" ), _
378 @
"__ASSERTWARN", FB_RTL_OPT_DBGONLY, _
384 ( FB_DEFTOK_TYPE_TEX, @
"if (" ), _
385 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
386 ( FB_DEFTOK_TYPE_TEX, @
") = 0 then fb_AssertWarn(__FILE__, __LINE__, __FUNCTION__, " ), _
387 ( FB_DEFTOK_TYPE_PARAMSTR,
cast(
any ptr, 0 ) ), _
388 ( FB_DEFTOK_TYPE_TEX, @
") end if" ), _
394 @
"__OFFSETOF", FB_RTL_OPT_NONE, _
400 ( FB_DEFTOK_TYPE_TEX, @
"cint( @__cast( " ), _
401 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
402 ( FB_DEFTOK_TYPE_TEX, @
" __ptr, 0 )->" ), _
403 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
404 ( FB_DEFTOK_TYPE_TEX, @
" )" ), _
410 @
"__FB_MIN_VERSION__", FB_RTL_OPT_NONE, _
413 @
"MAJOR", @
"MINOR", @
"PATCH_LEVEL" _
416 ( FB_DEFTOK_TYPE_TEX, @
"((__FB_VER_MAJOR__ > (" ), _
417 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
418 ( FB_DEFTOK_TYPE_TEX, @
")) or ((__FB_VER_MAJOR__ = (" ), _
419 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
420 ( FB_DEFTOK_TYPE_TEX, @
")) and ((__FB_VER_MINOR__ > (" ), _
421 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
422 ( FB_DEFTOK_TYPE_TEX, @
")) or (__FB_VER_MINOR__ = (" ), _
423 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
424 ( FB_DEFTOK_TYPE_TEX, @
") and __FB_VER_PATCH__ >= (" ), _
425 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 2 ) ), _
426 ( FB_DEFTOK_TYPE_TEX, @
")))))" ), _
432 @
"__LOWORD", FB_RTL_OPT_NONE, _
438 ( FB_DEFTOK_TYPE_TEX, @
"(__cuint(" ), _
439 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
440 ( FB_DEFTOK_TYPE_TEX, @
") and &h0000FFFF)" ), _
446 @
"__HIWORD", FB_RTL_OPT_NONE, _
452 ( FB_DEFTOK_TYPE_TEX, @
"(__cuint(" ), _
453 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
454 ( FB_DEFTOK_TYPE_TEX, @
") __shr 16)" ), _
460 @
"__LOBYTE", FB_RTL_OPT_NONE, _
466 ( FB_DEFTOK_TYPE_TEX, @
"(__cuint(" ), _
467 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
468 ( FB_DEFTOK_TYPE_TEX, @
") and &h000000FF)" ), _
474 @
"__HIBYTE", FB_RTL_OPT_NONE, _
480 ( FB_DEFTOK_TYPE_TEX, @
"((__cuint(" ), _
481 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
482 ( FB_DEFTOK_TYPE_TEX, @
") and &h0000FF00) __shr 8)" ), _
488 @
"__BIT", FB_RTL_OPT_NONE, _
494 ( FB_DEFTOK_TYPE_TEX, @
"(((" ), _
495 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
496 ( FB_DEFTOK_TYPE_TEX, @
") and (__cast(__typeof(" ), _
497 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
498 ( FB_DEFTOK_TYPE_TEX, @
"), 1) __shl (" ), _
499 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
500 ( FB_DEFTOK_TYPE_TEX, @
"))) <> 0)" ), _
506 @
"__BITSET", FB_RTL_OPT_NONE, _
512 ( FB_DEFTOK_TYPE_TEX, @
"((" ), _
513 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
514 ( FB_DEFTOK_TYPE_TEX, @
") or (__cast(__typeof(" ), _
515 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
516 ( FB_DEFTOK_TYPE_TEX, @
"), 1) __shl (" ), _
517 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
518 ( FB_DEFTOK_TYPE_TEX, @
")))" ), _
524 @
"__BITRESET", FB_RTL_OPT_NONE, _
530 ( FB_DEFTOK_TYPE_TEX, @
"((" ), _
531 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
532 ( FB_DEFTOK_TYPE_TEX, @
") and not (__cast(__typeof(" ), _
533 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 0 ) ), _
534 ( FB_DEFTOK_TYPE_TEX, @
"), 1) __shl (" ), _
535 ( FB_DEFTOK_TYPE_PARAM,
cast(
any ptr, 1 ) ), _
536 ( FB_DEFTOK_TYPE_TEX, @
")))" ), _
547 dim as FB_DEFPARAM
ptr param_head =
any, lastparam =
any
548 dim as FB_DEFTOK
ptr tok =
any, tok_head =
any
553 var flags = FB_DEFINE_FLAGS_NONE
554 if( macdef->
name = NULL )
then
562 for i
as integer = 0
to macdef->
params-1
564 if( param_head = NULL )
then
565 param_head = lastparam
572 dim as integer addbody = TRUE
575 if( (macdef->
options and FB_RTL_OPT_DBGONLY) <> 0 )
then
576 if( env.clopt.debug = FALSE )
then
582 if( (macdef->
options and FB_RTL_OPT_NOGCC) <> 0 )
then
583 if( env.clopt.backend = FB_BACKEND_GCC )
then
585 flags
or= FB_DEFINE_FLAGS_NOGCC
594 if( ptk->
type = -1 )
then
599 if( tok_head = NULL )
then
603 select case ptk->
type
604 case FB_DEFTOK_TYPE_PARAM, FB_DEFTOK_TYPE_PARAMSTR
605 symbGetDefTokParamNum( tok ) =
cint( ptk->
data )
607 case FB_DEFTOK_TYPE_TEX
608 ZstrAssign( @symbGetDefTokText( tok ),
cast(
zstring ptr, ptk->
data ) )
626 if( fbLangIsSet( FB_LANG_QB ) )
then