Improve grd program in Gambit REPL iOS example (add "mv" command, on Windows provide...
[gambit-c.git] / include / gambit.h.in
blobf08839966f19393adab301d4b4c53bc09b6efc46
1 /* File: "gambit.h" */
3 /*
4 * Copyright (c) 1994-2012 by Marc Feeley, All Rights Reserved.
5 */
7 #ifndef ___VERSION
8 #error "___VERSION has not been set by includer"
9 #endif
11 #if ___VERSION != 406004
12 #include "gambit-not406004.h"
13 #else
15 #ifndef ___GAMBIT_H
16 #define ___GAMBIT_H
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
22 /*---------------------------------------------------------------------------*/
25 * This section determines the following characteristics of the target
26 * platform:
28 * - target operating system (WIN32, POSIX, etc)
29 * - target processor type (x86, PowerPC, etc)
30 * - byte order endianness (big-endian or little-endian)
31 * - width of the integer and floating-point types (char, short, int, etc)
35 * Determine the target operating system type. This is used mainly in
36 * the implementation of operating system dependent runtime library
37 * functions (i.e. lib/os*.c), but also to handle some OS quirks in
38 * this include file.
41 #ifdef _WIN32
42 #define ___OS_WIN32
43 #endif
47 * Determine the target processor type. This is used for dynamic code
48 * generation (to convert Scheme procedures into C functions) and to
49 * determine byte order endianness.
52 #ifndef ___CPU_x86
54 #ifdef I386
55 #define ___CPU_x86
56 #else
57 #ifdef _I386
58 #define ___CPU_x86
59 #else
60 #ifdef i386
61 #define ___CPU_x86
62 #else
63 #ifdef _i386
64 #define ___CPU_x86
65 #else
66 #ifdef __i386
67 #define ___CPU_x86
68 #else
69 #ifdef __i386__
70 #define ___CPU_x86
71 #else
72 #ifdef __i486
73 #define ___CPU_x86
74 #else
75 #ifdef __i486__
76 #define ___CPU_x86
77 #else
78 #ifdef __i586
79 #define ___CPU_x86
80 #else
81 #ifdef __i586__
82 #define ___CPU_x86
83 #else
84 #ifdef __i686
85 #define ___CPU_x86
86 #else
87 #ifdef __i686__
88 #define ___CPU_x86
89 #else
90 #ifdef __ix86
91 #define ___CPU_x86
92 #else
93 #ifdef M_I386
94 #define ___CPU_x86
95 #else
96 #ifdef _M_I386
97 #define ___CPU_x86
98 #else
99 #ifdef M_I86
100 #define ___CPU_x86
101 #else
102 #ifdef _M_I86
103 #define ___CPU_x86
104 #else
105 #ifdef _M_IX86
106 #define ___CPU_x86
107 #else
108 #ifdef _X86_
109 #define ___CPU_x86
110 #endif
111 #endif
112 #endif
113 #endif
114 #endif
115 #endif
116 #endif
117 #endif
118 #endif
119 #endif
120 #endif
121 #endif
122 #endif
123 #endif
124 #endif
125 #endif
126 #endif
127 #endif
128 #endif
130 #endif
132 #ifndef ___CPU_x86_64
134 #ifdef __x86_64__
135 #define ___CPU_x86_64
136 #else
137 #ifdef _M_AMD64
138 #define ___CPU_x86_64
139 #endif
140 #endif
142 #endif
144 #ifndef ___CPU_ppc
146 #ifdef PPC
147 #define ___CPU_ppc
148 #else
149 #ifdef ppc
150 #define ___CPU_ppc
151 #else
152 #ifdef __ppc
153 #define ___CPU_ppc
154 #else
155 #ifdef __ppc__
156 #define ___CPU_ppc
157 #else
158 #ifdef _ARCH_PPC
159 #define ___CPU_ppc
160 #else
161 #ifdef __POWERPC__
162 #define ___CPU_ppc
163 #else
164 #ifdef powerpc
165 #define ___CPU_ppc
166 #else
167 #ifdef _POWER
168 #define ___CPU_ppc
169 #else
170 #ifdef _ARCH_PWR
171 #define ___CPU_ppc
172 #else
173 #ifdef _ARCH_PWR2
174 #define ___CPU_ppc
175 #else
176 #ifdef _M_PPC
177 #define ___CPU_ppc
178 #else
179 #ifdef _M_MPPC
180 #define ___CPU_ppc
181 #endif
182 #endif
183 #endif
184 #endif
185 #endif
186 #endif
187 #endif
188 #endif
189 #endif
190 #endif
191 #endif
192 #endif
194 #endif
196 #ifndef ___CPU_ppc_64
198 #ifdef __ppc_64__
199 #define ___CPU_ppc_64
200 #endif
202 #endif
204 #ifndef ___CPU_sparc
206 #ifdef SPARC
207 #define ___CPU_sparc
208 #else
209 #ifdef __sparc
210 #define ___CPU_sparc
211 #else
212 #ifdef __sparc__
213 #define ___CPU_sparc
214 #else
215 #ifdef sparc
216 #define ___CPU_sparc
217 #else
218 #ifdef sparc64
219 #define ___CPU_sparc
220 #else
221 #ifdef sparclite
222 #define ___CPU_sparc
223 #endif
224 #endif
225 #endif
226 #endif
227 #endif
228 #endif
230 #endif
232 #ifndef ___CPU_alpha
234 #ifdef alpha
235 #define ___CPU_alpha
236 #else
237 #ifdef __alpha
238 #define ___CPU_alpha
239 #else
240 #ifdef __alpha__
241 #define ___CPU_alpha
242 #else
243 #ifdef ALPHA
244 #define ___CPU_alpha
245 #else
246 #ifdef _ALPHA_
247 #define ___CPU_alpha
248 #else
249 #ifdef __ALPHA
250 #define ___CPU_alpha
251 #else
252 #ifdef _M_ALPHA
253 #define ___CPU_alpha
254 #endif
255 #endif
256 #endif
257 #endif
258 #endif
259 #endif
260 #endif
262 #endif
264 #ifndef ___CPU_mips
266 #ifdef mips
267 #define ___CPU_mips
268 #else
269 #ifdef _mips
270 #define ___CPU_mips
271 #else
272 #ifdef __mips
273 #define ___CPU_mips
274 #else
275 #ifdef __mips__
276 #define ___CPU_mips
277 #else
278 #ifdef MIPSEB
279 #define ___CPU_mips
280 #else
281 #ifdef _MIPSEB
282 #define ___CPU_mips
283 #else
284 #ifdef __MIPSEB
285 #define ___CPU_mips
286 #else
287 #ifdef __MIPSEB__
288 #define ___CPU_mips
289 #else
290 #ifdef MIPSEL
291 #define ___CPU_mips
292 #else
293 #ifdef _MIPSEL
294 #define ___CPU_mips
295 #else
296 #ifdef __MIPSEL
297 #define ___CPU_mips
298 #else
299 #ifdef __MIPSEL__
300 #define ___CPU_mips
301 #else
302 #ifdef _M_MRX000
303 #define ___CPU_mips
304 #endif
305 #endif
306 #endif
307 #endif
308 #endif
309 #endif
310 #endif
311 #endif
312 #endif
313 #endif
314 #endif
315 #endif
316 #endif
318 #endif
320 #ifndef ___CPU_arm
322 #ifdef arm
323 #define ___CPU_arm
324 #else
325 #ifdef __arm
326 #define ___CPU_arm
327 #else
328 #ifdef __arm__
329 #define ___CPU_arm
330 #endif
331 #endif
332 #endif
334 #endif
336 #ifndef ___CPU_vax
338 #ifdef vax
339 #define ___CPU_vax
340 #else
341 #ifdef __vax
342 #define ___CPU_vax
343 #else
344 #ifdef __vax__
345 #define ___CPU_vax
346 #endif
347 #endif
348 #endif
350 #endif
353 * Determine the byte order endianness based on the processor type.
354 * We assume that all processors are big-endian, except the x86, x86_64,
355 * alpha and vax. The PowerPC, MIPS and ARM can be either big-endian or
356 * little-endian so extra tests are needed.
359 #ifndef ___BIG_ENDIAN
360 #ifndef ___LITTLE_ENDIAN
362 #ifdef ___CPU_x86
363 #define ___LITTLE_ENDIAN
364 #endif
366 #ifdef ___CPU_x86_64
367 #define ___LITTLE_ENDIAN
368 #endif
370 #ifdef ___CPU_ppc
371 #ifdef _LITTLE_ENDIAN
372 #define ___LITTLE_ENDIAN
373 #endif
374 #ifdef __LITTLE_ENDIAN__
375 #define ___LITTLE_ENDIAN
376 #endif
377 #ifdef __LITTLE_ENDIAN_DATA__
378 #define ___LITTLE_ENDIAN
379 #endif
380 #endif
382 #ifdef ___CPU_ppc_64
383 #ifdef _LITTLE_ENDIAN
384 #define ___LITTLE_ENDIAN
385 #endif
386 #ifdef __LITTLE_ENDIAN__
387 #define ___LITTLE_ENDIAN
388 #endif
389 #ifdef __LITTLE_ENDIAN_DATA__
390 #define ___LITTLE_ENDIAN
391 #endif
392 #endif
394 #ifdef ___CPU_alpha
395 #define ___LITTLE_ENDIAN
396 #endif
398 #ifdef ___CPU_mips
399 #ifdef _MIPSEL
400 #define ___LITTLE_ENDIAN
401 #endif
402 #endif
404 #ifdef ___CPU_arm
405 #ifdef _LITTLE_ENDIAN
406 #define ___LITTLE_ENDIAN
407 #endif
408 #ifdef __LITTLE_ENDIAN__
409 #define ___LITTLE_ENDIAN
410 #endif
411 #ifdef __LITTLE_ENDIAN_DATA__
412 #define ___LITTLE_ENDIAN
413 #endif
414 #ifdef __ARMEL__
415 #define ___LITTLE_ENDIAN
416 #endif
417 #endif
419 #ifdef ___CPU_vax
420 #define ___LITTLE_ENDIAN
421 #endif
423 #ifndef ___LITTLE_ENDIAN
424 #define ___BIG_ENDIAN
425 #endif
427 #endif
428 #endif
431 * Determine the number of bits in various integer and floating point
432 * types and define appropriate macros accordingly. The macro for a
433 * given type is not defined if the type is not supported by the C
434 * compiler or if it is not 8, 16, 32 or 64 bits wide.
437 #ifndef ___CHAR_WIDTH
438 #ifdef ___DONT_HAVE_LIMITS_H
441 * If the file "limits.h" is not available then the symbol
442 * ___DONT_HAVE_LIMITS_H must be defined (for example on the compiler's
443 * command line) and the following definitions will be used:
446 #define ___CHAR_WIDTH 8 /* if needed, edit to suit your platform */
447 #define ___SHORT_WIDTH 16
448 #define ___INT_WIDTH 32
449 #define ___LONG_WIDTH 32
451 #ifdef __GNUC__
452 #define ___LONGLONG_WIDTH 64
453 #endif
455 #else
458 * If the file "limits.h" is available then it contains macros
459 * defining the range of the integer types. The following
460 * preprocessor conditional definitions are written so that they will
461 * work regardless of the number of bits in the integer types
462 * supported by the compiler (many compilers for 32 bit machines give
463 * an error for C preprocessor expressions like ULONG_MAX >> 32 or
464 * ULLONG_MAX == 18446744073709551615UL). Some parentheses seem
465 * redundant, but they are required for MS Visual C/C++ whose
466 * preprocessor signals an error on: x >> 8 >> 8.
469 #include <limits.h>
471 #ifdef UCHAR_MAX
472 #if (UCHAR_MAX & 255) == 255
473 #if (UCHAR_MAX >> 8) == 0
474 #define ___CHAR_WIDTH 8
475 #else
476 #if ((UCHAR_MAX >> 8) & 255) == 255
477 #if ((UCHAR_MAX >> 8) >> 8) == 0
478 #define ___CHAR_WIDTH 16
479 #else
480 #if (((UCHAR_MAX >> 8) >> 8) & 255) == 255
481 #if (((UCHAR_MAX >> 8) >> 8) >> 8) != 0
482 #if ((((UCHAR_MAX >> 8) >> 8) >> 8) & 255) == 255
483 #if ((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) == 0
484 #define ___CHAR_WIDTH 32
485 #else
486 #if (((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
487 #if (((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
488 #if ((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
489 #if ((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
490 #if (((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
491 #if (((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
492 #if ((((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
493 #if ((((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
494 #define ___CHAR_WIDTH 64
495 #endif
496 #endif
497 #endif
498 #endif
499 #endif
500 #endif
501 #endif
502 #endif
503 #endif
504 #endif
505 #endif
506 #endif
507 #endif
508 #endif
509 #endif
510 #endif
511 #endif
513 #ifdef USHRT_MAX
514 #if (USHRT_MAX & 255) == 255
515 #if (USHRT_MAX >> 8) == 0
516 #define ___SHORT_WIDTH 8
517 #else
518 #if ((USHRT_MAX >> 8) & 255) == 255
519 #if ((USHRT_MAX >> 8) >> 8) == 0
520 #define ___SHORT_WIDTH 16
521 #else
522 #if (((USHRT_MAX >> 8) >> 8) & 255) == 255
523 #if (((USHRT_MAX >> 8) >> 8) >> 8) != 0
524 #if ((((USHRT_MAX >> 8) >> 8) >> 8) & 255) == 255
525 #if ((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) == 0
526 #define ___SHORT_WIDTH 32
527 #else
528 #if (((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
529 #if (((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
530 #if ((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
531 #if ((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
532 #if (((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
533 #if (((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
534 #if ((((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
535 #if ((((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
536 #define ___SHORT_WIDTH 64
537 #endif
538 #endif
539 #endif
540 #endif
541 #endif
542 #endif
543 #endif
544 #endif
545 #endif
546 #endif
547 #endif
548 #endif
549 #endif
550 #endif
551 #endif
552 #endif
553 #endif
555 #ifdef UINT_MAX
556 #if (UINT_MAX & 255) == 255
557 #if (UINT_MAX >> 8) == 0
558 #define ___INT_WIDTH 8
559 #else
560 #if ((UINT_MAX >> 8) & 255) == 255
561 #if ((UINT_MAX >> 8) >> 8) == 0
562 #define ___INT_WIDTH 16
563 #else
564 #if (((UINT_MAX >> 8) >> 8) & 255) == 255
565 #if (((UINT_MAX >> 8) >> 8) >> 8) != 0
566 #if ((((UINT_MAX >> 8) >> 8) >> 8) & 255) == 255
567 #if ((((UINT_MAX >> 8) >> 8) >> 8) >> 8) == 0
568 #define ___INT_WIDTH 32
569 #else
570 #if (((((UINT_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
571 #if (((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
572 #if ((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
573 #if ((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
574 #if (((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
575 #if (((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
576 #if ((((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
577 #if ((((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
578 #define ___INT_WIDTH 64
579 #endif
580 #endif
581 #endif
582 #endif
583 #endif
584 #endif
585 #endif
586 #endif
587 #endif
588 #endif
589 #endif
590 #endif
591 #endif
592 #endif
593 #endif
594 #endif
595 #endif
597 #ifdef ULONG_MAX
598 #if (ULONG_MAX & 255) == 255
599 #if (ULONG_MAX >> 8) == 0
600 #define ___LONG_WIDTH 8
601 #else
602 #if ((ULONG_MAX >> 8) & 255) == 255
603 #if ((ULONG_MAX >> 8) >> 8) == 0
604 #define ___LONG_WIDTH 16
605 #else
606 #if (((ULONG_MAX >> 8) >> 8) & 255) == 255
607 #if (((ULONG_MAX >> 8) >> 8) >> 8) != 0
608 #if ((((ULONG_MAX >> 8) >> 8) >> 8) & 255) == 255
609 #if ((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) == 0
610 #define ___LONG_WIDTH 32
611 #else
612 #if (((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
613 #if (((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
614 #if ((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
615 #if ((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
616 #if (((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
617 #if (((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
618 #if ((((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
619 #if ((((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
620 #define ___LONG_WIDTH 64
621 #endif
622 #endif
623 #endif
624 #endif
625 #endif
626 #endif
627 #endif
628 #endif
629 #endif
630 #endif
631 #endif
632 #endif
633 #endif
634 #endif
635 #endif
636 #endif
637 #endif
639 #ifdef __GNUC__
641 #define ___LONGLONG_WIDTH 64
643 #else
645 /* Handle some non ISO C99 compilers that nevertheless support "long long". */
647 #ifndef ULLONG_MAX
648 #ifdef ULONGLONG_MAX
649 #define ULLONG_MAX ULONGLONG_MAX
650 #else
651 #ifdef ULONG_LONG_MAX
652 #define ULLONG_MAX ULONG_LONG_MAX
653 #endif
654 #endif
655 #endif
657 #ifdef ULLONG_MAX
658 #if (ULLONG_MAX & 255) == 255
659 #if (ULLONG_MAX >> 8) == 0
660 #define ___LONGLONG_WIDTH 8
661 #else
662 #if ((ULLONG_MAX >> 8) & 255) == 255
663 #if ((ULLONG_MAX >> 8) >> 8) == 0
664 #define ___LONGLONG_WIDTH 16
665 #else
666 #if (((ULLONG_MAX >> 8) >> 8) & 255) == 255
667 #if (((ULLONG_MAX >> 8) >> 8) >> 8) != 0
668 #if ((((ULLONG_MAX >> 8) >> 8) >> 8) & 255) == 255
669 #if ((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) == 0
670 #define ___LONGLONG_WIDTH 32
671 #else
672 #if (((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
673 #if (((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
674 #if ((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
675 #if ((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
676 #if (((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
677 #if (((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
678 #if ((((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
679 #if ((((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
680 #define ___LONGLONG_WIDTH 64
681 #endif
682 #endif
683 #endif
684 #endif
685 #endif
686 #endif
687 #endif
688 #endif
689 #endif
690 #endif
691 #endif
692 #endif
693 #endif
694 #endif
695 #endif
696 #endif
697 #endif
699 #endif
701 #endif
704 * If the "long long" type is not supported, then substitute the type
705 * "long".
708 #ifndef ___LONGLONG_WIDTH
709 #define ___LONGLONG_WIDTH ___LONG_WIDTH
710 #define ___LONGLONG long
711 #define ___ULONGLONG unsigned long
712 #else
713 #define ___LONGLONG long long
714 #define ___ULONGLONG unsigned long long
715 #endif
718 * Some old C compilers do not support the "signed char" and "wchar_t"
719 * types. The following preprocessor directives allow these types to
720 * be redefined (such as on the C compiler's command line, in
721 * "config.h", ...).
724 #ifndef ___SCHAR
725 #define ___SCHAR signed char
726 #endif
728 #ifndef ___WCHAR
729 #ifdef ___DONT_HAVE_WCHAR_H
732 * If the file "wchar.h" is not available then the symbol
733 * ___DONT_HAVE_WCHAR_H must be defined (for example on the compiler's
734 * command line) and the following definitions will be used:
737 #define ___WCHAR unsigned char
738 #define ___WCHAR_MIN 0
739 #define ___WCHAR_MAX ((1<<___CHAR_WIDTH)-1)
741 #else
744 * If the file "wchar.h" is available then it should contain macros
745 * defining the range of the wchar_t type.
748 #include <wchar.h>
750 #define ___WCHAR wchar_t
752 #ifdef WCHAR_MIN
753 #define ___WCHAR_MIN WCHAR_MIN
754 #else
755 #define ___WCHAR_MIN 0
756 #endif
758 #ifdef WCHAR_MAX
759 #define ___WCHAR_MAX WCHAR_MAX
760 #else
761 #ifdef UINT_MAX
762 #define ___WCHAR_MAX UINT_MAX
763 #else
764 #define ___WCHAR_MAX ((1<<___CHAR_WIDTH)-1)
765 #endif
766 #endif
768 #endif
769 #endif
771 #ifdef ___DONT_HAVE_FLOAT_H
774 * If the file "float.h" is not available then the symbol
775 * ___DONT_HAVE_FLOAT_H must be defined (for example on the compiler's
776 * command line) and the following definitions will be used:
779 #define ___FLOAT_WIDTH 32 /* if needed, edit to suit your platform */
780 #define ___DOUBLE_WIDTH 64
782 #else
785 * If the file "float.h" is available then it contains macros defining
786 * the range of the floating point types. The following preprocessor
787 * conditional definitions are not completely correct (and may not
788 * even compile properly because it is possible that FLT_MAX_EXP and
789 * DBL_MAX_EXP are not constant expressions). However, it appears to
790 * work on a wide range of platforms.
793 #include <float.h>
795 #ifdef FLT_MAX_EXP
796 #if FLT_MAX_EXP == 128
797 #define ___FLOAT_WIDTH 32
798 #else
799 #if FLT_MAX_EXP == 1024
800 #define ___FLOAT_WIDTH 64
801 #endif
802 #endif
803 #endif
805 #ifdef DBL_MAX_EXP
806 #if DBL_MAX_EXP == 128
807 #define ___DOUBLE_WIDTH 32
808 #else
809 #if DBL_MAX_EXP == 1024
810 #define ___DOUBLE_WIDTH 64
811 #endif
812 #endif
813 #endif
815 #endif
816 #endif
819 * Size of pointers.
821 * ___VOIDSTAR_WIDTH must be equal to sizeof(void*) * ___CHAR_WIDTH.
822 * This value can't be computed with the "sizeof" operator because it
823 * must be known at macro expansion time. If in doubt just do
825 * #define ___VOIDSTAR_WIDTH ___LONG_WIDTH
829 #ifndef ___VOIDSTAR_WIDTH
830 #define ___VOIDSTAR_WIDTH @CONF_VOIDSTAR_WIDTH@
831 #endif
833 #if ___VOIDSTAR_WIDTH == 32
834 #undef ___USE_32_BIT_ADDR
835 #define ___USE_32_BIT_ADDR
836 #endif
838 /*---------------------------------------------------------------------------*/
841 * The following symbols must be defined to reflect the integer and
842 * floating-point data types supported by the C compiler. A symbol is
843 * only defined if the data type exists. At least ___F64 and one of
844 * the pairs ___S32/___U32 and ___S64/___U64 must be defined.
846 * define ___S8 as the signed integer type of exactly 8 bits
847 * define ___U8 as the unsigned integer type of exactly 8 bits
848 * define ___SM8 as the signed integer type of at least 8 bits
849 * define ___UM8 as the unsigned integer type of at least 8 bits
851 * define ___S16 as the signed integer type of exactly 16 bits
852 * define ___U16 as the unsigned integer type of exactly 16 bits
853 * define ___SM16 as the signed integer type of at least 16 bits
854 * define ___UM16 as the unsigned integer type of at least 16 bits
856 * define ___S32 as the signed integer type of exactly 32 bits
857 * define ___U32 as the unsigned integer type of exactly 32 bits
858 * define ___SM32 as the signed integer type of at least 32 bits
859 * define ___UM32 as the unsigned integer type of at least 32 bits
861 * define ___S64 as the signed integer type of exactly 64 bits
862 * define ___U64 as the unsigned integer type of exactly 64 bits
863 * define ___SM64 as the signed integer type of at least 64 bits
864 * define ___UM64 as the unsigned integer type of at least 64 bits
866 * define ___F32 as the 32 bit floating-point type
867 * define ___F64 as the 64 bit floating-point type
871 * First we make sure that the width of all the integer and
872 * floating-point types is known.
875 #ifndef ___CHAR_WIDTH
876 #error "The definition for ___CHAR_WIDTH is missing"
877 #endif
879 #ifndef ___SHORT_WIDTH
880 #error "The definition for ___SHORT_WIDTH is missing"
881 #endif
883 #ifndef ___INT_WIDTH
884 #error "The definition for ___INT_WIDTH is missing"
885 #endif
887 #ifndef ___LONG_WIDTH
888 #error "The definition for ___LONG_WIDTH is missing"
889 #endif
891 #ifndef ___LONGLONG_WIDTH
892 #error "The definition for ___LONGLONG_WIDTH is missing"
893 #endif
895 #ifndef ___FLOAT_WIDTH
896 #error "The definition for ___FLOAT_WIDTH is missing"
897 #endif
899 #ifndef ___DOUBLE_WIDTH
900 #error "The definition for ___DOUBLE_WIDTH is missing"
901 #endif
903 #if ___INT_WIDTH == 8
904 #define ___S8 int
905 #define ___U8 unsigned int
906 #else
907 #if ___LONG_WIDTH == 8
908 #define ___S8 long
909 #define ___U8 unsigned long
910 #else
911 #if ___SHORT_WIDTH == 8
912 #define ___S8 short
913 #define ___U8 unsigned short
914 #else
915 #if ___CHAR_WIDTH == 8
916 #define ___S8 ___SCHAR
917 #define ___U8 unsigned char
918 #else
919 #if ___LONGLONG_WIDTH == 8
920 #define ___S8 ___LONGLONG
921 #define ___U8 unsigned ___LONGLONG
922 #endif
923 #endif
924 #endif
925 #endif
926 #endif
928 #if ___INT_WIDTH == 16
929 #define ___S16 int
930 #define ___U16 unsigned int
931 #else
932 #if ___LONG_WIDTH == 16
933 #define ___S16 long
934 #define ___U16 unsigned long
935 #else
936 #if ___SHORT_WIDTH == 16
937 #define ___S16 short
938 #define ___U16 unsigned short
939 #else
940 #if ___CHAR_WIDTH == 16
941 #define ___S16 ___SCHAR
942 #define ___U16 unsigned char
943 #else
944 #if ___LONGLONG_WIDTH == 16
945 #define ___S16 ___LONGLONG
946 #define ___U16 unsigned ___LONGLONG
947 #endif
948 #endif
949 #endif
950 #endif
951 #endif
953 #if ___INT_WIDTH == 32
954 #define ___S32 int
955 #define ___U32 unsigned int
956 #else
957 #if ___LONG_WIDTH == 32
958 #define ___S32 long
959 #define ___U32 unsigned long
960 #else
961 #if ___SHORT_WIDTH == 32
962 #define ___S32 short
963 #define ___U32 unsigned short
964 #else
965 #if ___CHAR_WIDTH == 32
966 #define ___S32 ___SCHAR
967 #define ___U32 unsigned char
968 #else
969 #if ___LONGLONG_WIDTH == 32
970 #define ___S32 ___LONGLONG
971 #define ___U32 unsigned ___LONGLONG
972 #endif
973 #endif
974 #endif
975 #endif
976 #endif
978 #if ___INT_WIDTH == 64
979 #define ___S64 int
980 #define ___U64 unsigned int
981 #else
982 #if ___LONG_WIDTH == 64
983 #define ___S64 long
984 #define ___U64 unsigned long
985 #else
986 #if ___SHORT_WIDTH == 64
987 #define ___S64 short
988 #define ___U64 unsigned short
989 #else
990 #if ___CHAR_WIDTH == 64
991 #define ___S64 ___SCHAR
992 #define ___U64 unsigned char
993 #else
994 #if ___LONGLONG_WIDTH == 64
995 #define ___S64 ___LONGLONG
996 #define ___U64 unsigned ___LONGLONG
997 #endif
998 #endif
999 #endif
1000 #endif
1001 #endif
1003 #if ___FLOAT_WIDTH == 32
1004 #define ___F32 float
1005 #else
1006 #if ___DOUBLE_WIDTH == 32
1007 #define ___F32 double
1008 #endif
1009 #endif
1011 #if ___DOUBLE_WIDTH == 64
1012 #define ___F64 double
1013 #else
1014 #if ___FLOAT_WIDTH == 64
1015 #define ___F64 float
1016 #endif
1017 #endif
1019 #ifdef ___S64
1020 #define ___BUILTIN_64BIT_INT_TYPE
1021 #define ___SM64 ___S64
1022 #define ___UM64 ___U64
1023 #endif
1025 #ifdef ___S32
1026 #define ___SM32 ___S32
1027 #define ___UM32 ___U32
1028 #else
1029 #define ___SM32 ___SM64
1030 #define ___UM32 ___UM64
1031 #endif
1033 #ifdef ___S16
1034 #define ___SM16 ___S16
1035 #define ___UM16 ___U16
1036 #else
1037 #define ___SM16 ___SM32
1038 #define ___UM16 ___UM32
1039 #endif
1041 #ifdef ___S8
1042 #define ___SM8 ___S8
1043 #define ___UM8 ___U8
1044 #else
1045 #define ___SM8 ___SM16
1046 #define ___UM8 ___UM16
1047 #endif
1049 /*---------------------------------------------------------------------------*/
1051 /* SANITY CHECKS AND SETTING OF DEFAULT OPTIONS */
1054 * Verify that the byte order endianness is known.
1057 #ifdef ___BIG_ENDIAN
1058 #ifdef ___LITTLE_ENDIAN
1059 #error "Define either ___BIG_ENDIAN or ___LITTLE_ENDIAN"
1060 #endif
1061 #else
1062 #ifndef ___LITTLE_ENDIAN
1063 #error "Define either ___BIG_ENDIAN or ___LITTLE_ENDIAN"
1064 #endif
1065 #endif
1068 * Generate a single host C procedure or multiple C host
1069 * procedures (default) per Scheme module?
1072 #ifdef ___SINGLE_HOST
1073 #ifdef ___MULTIPLE_HOSTS
1074 #error "Define either ___SINGLE_HOST or ___MULTIPLE_HOSTS"
1075 #endif
1076 #else
1077 #ifndef ___MULTIPLE_HOSTS
1078 #define ___MULTIPLE_HOSTS
1079 #endif
1080 #endif
1083 * Compiling for dynamic loading or not (default).
1086 #ifdef ___DYNAMIC
1087 #ifdef ___NONDYNAMIC
1088 #error "Define either ___DYNAMIC or ___NONDYNAMIC"
1089 #endif
1090 #else
1091 #ifndef ___NONDYNAMIC
1092 #define ___NONDYNAMIC
1093 #endif
1094 #endif
1097 * Define symbols appropriate for dynamic loading.
1100 #ifdef ___DYNAMIC
1101 #undef ___PRIMAL
1102 #define ___PRIMAL
1103 #undef ___LIBRARY
1104 #define ___LIBRARY
1105 #undef ___SHARED
1106 #define ___SHARED
1107 #undef ___BIND_LATE
1108 #define ___BIND_LATE
1109 #endif
1112 * Compiling to produce a library or an application with a "main" (default
1113 * unless compiling a flat link file).
1116 #ifdef ___LIBRARY
1117 #ifdef ___APPLICATION
1118 #error "Define either ___LIBRARY or ___APPLICATION"
1119 #endif
1120 #else
1121 #ifndef ___APPLICATION
1122 #ifdef ___FLAT_LINKFILE
1123 #define ___LIBRARY
1124 #else
1125 #define ___APPLICATION
1126 #endif
1127 #endif
1128 #endif
1131 * Compiling to produce a shared-library or not (default).
1134 #ifdef ___DYNAMIC_LIB
1135 #define ___SHARED
1136 #endif
1138 #ifdef ___SHARED
1139 #ifdef ___NONSHARED
1140 #error "Define either ___SHARED or ___NONSHARED"
1141 #endif
1142 #else
1143 #ifndef ___NONSHARED
1144 #define ___NONSHARED
1145 #endif
1146 #endif
1149 * Select binding time for global variables, symbols, and keywords.
1150 * Early binding (default) produces faster code because it directly
1151 * accesses the resource. Late binding does an indirection at run
1152 * time.
1155 #ifdef ___BIND_LATE
1156 #ifdef ___BIND_EARLY
1157 #error "Define either ___BIND_LATE or ___BIND_EARLY"
1158 #endif
1159 #else
1160 #ifndef ___BIND_EARLY
1161 #define ___BIND_EARLY
1162 #endif
1163 #endif
1166 * Range and size of Scheme characters.
1168 * ___MAX_CHR must be 0xff, 0xffff or 0x10ffff. The value 0xff is
1169 * appropriate when text is limited to the ISO-8859-1 subset of
1170 * Unicode. The value 0xffff is for when text is limited to the BMP
1171 * (Basic Multilingual Plane) subset of Unicode. The value 0x10ffff
1172 * allows all Unicode characters in text. Note that the number of
1173 * bytes per character in a string depends on ___MAX_CHR as follows:
1175 * ___MAX_CHR = 0xff => 1 byte per character
1176 * ___MAX_CHR = 0xffff => 2 bytes per character
1177 * ___MAX_CHR = 0x10ffff => 4 bytes per character
1179 * If in doubt just do
1181 * #define ___MAX_CHR 0x10ffff
1185 #ifndef ___MAX_CHR
1186 #define ___MAX_CHR @CONF_MAX_CHR@
1187 #endif
1190 * Number of registers in the virtual machine. These definitions must
1191 * agree with those in the file "gsc/_t-c-1.scm". All Scheme sources
1192 * must be recompiled if these definitions are changed.
1194 * ___NB_GVM_REGS = total number of registers available
1195 * 3 <= ___NB_GVM_REGS <= 25
1196 * ___NB_ARG_REGS = maximum number of arguments passed in registers
1197 * 1 <= ___NB_ARG_REGS <= min( 12, ___NB_GVM_REGS-2 )
1200 #define ___NB_GVM_REGS 5
1201 #define ___NB_ARG_REGS 3
1204 * Determine if label values (a gcc extension to C) should be used.
1207 #ifdef ___USE_LABEL_VALUES
1208 #ifdef ___NOT_USE_LABEL_VALUES
1209 #error "Define either ___USE_LABEL_VALUES or ___NOT_USE_LABEL_VALUES"
1210 #endif
1211 #else
1212 #ifndef ___NOT_USE_LABEL_VALUES
1213 #ifdef __GNUC__
1214 #if __llvm__ && !__clang__ && (__GNUC__*1000+__GNUC_MINOR__)<4005
1215 /* Avoid possible LLVM GCC bug with label values */
1216 #define ___NOT_USE_LABEL_VALUES
1217 #else
1218 #define ___USE_LABEL_VALUES
1219 #endif
1220 #else
1221 #define ___NOT_USE_LABEL_VALUES
1222 #endif
1223 #endif
1224 #endif
1227 /*---------------------------------------------------------------------------*/
1229 /* Dependencies on language (i.e. C++, ANSI-C, and K&R C). */
1231 #ifdef __cplusplus
1233 #define ___P(ansi,kr)ansi
1234 #define ___PVOID ()
1236 #define ___BEGIN_C_LINKAGE extern "C" {
1237 #define ___END_C_LINKAGE }
1240 * Define ___BOOL as "bool" or "int", according to what is supported
1241 * by the compiler (this is determined by the configure script) unless
1242 * it is defined elsewhere.
1245 #ifndef ___BOOL
1246 #define ___BOOL @CONF_BOOL@
1247 #endif
1249 #define ___USE_CPLUSPLUS_NEW_DELETE
1250 #define ___USE_CPLUSPLUS_CLEANUP
1252 #else
1254 #ifdef __STDC__
1256 #define ___P(ansi,kr)ansi
1257 #define ___PVOID (void)
1259 #else
1261 #define ___P(ansi,kr)kr
1262 #define ___PVOID ()
1264 #endif
1266 #define ___BEGIN_C_LINKAGE
1267 #define ___END_C_LINKAGE
1269 #ifndef ___BOOL
1270 #define ___BOOL int
1271 #endif
1273 #undef ___USE_SETJMP
1274 #define ___USE_SETJMP
1276 #endif
1279 #ifdef ___USE_SETJMP
1281 #ifdef ___DONT_HAVE_SETJMP_H
1284 * If the file "setjmp.h" is not available then the symbol
1285 * ___DONT_HAVE_SETJMP_H must be defined (for example on the compiler's
1286 * command line). In this case we assume that setjmp is defined as
1287 * a macro.
1290 #undef ___CAN_IMPORT_SETJMP_DYNAMICALLY
1291 #define ___CAN_IMPORT_SETJMP_DYNAMICALLY
1293 #else
1296 * If the file "setjmp.h" is available then we can use the C
1297 * preprocessor to check if setjmp is a macro (otherwise it has to be
1298 * a function). If it is a macro then we can't get a pointer to it!
1301 #include <setjmp.h>
1303 #ifdef setjmp
1304 #undef ___CAN_IMPORT_SETJMP_DYNAMICALLY
1305 #define ___CAN_IMPORT_SETJMP_DYNAMICALLY
1306 #endif
1308 #endif
1310 #endif
1313 /*---------------------------------------------------------------------------*/
1315 /* Visibility directives. */
1317 #ifndef ___HIDDEN
1318 #define ___HIDDEN static
1319 #endif
1321 #ifndef ___LOCAL
1322 #define ___LOCAL static
1323 #endif
1325 #ifdef _MSC_VER
1326 #define ___USE_DECLSPEC
1327 #endif
1329 #ifdef __WATCOMC__
1330 #define ___USE_DECLSPEC
1331 #endif
1333 #ifdef ___USE_DECLSPEC
1334 #define ___EXPORT_FUNC(type,name)__declspec(dllexport) type name
1335 #define ___EXPORT_DATA(type,name)__declspec(dllexport) type name
1336 #define ___IMPORT_FUNC(type,name)__declspec(dllimport) type name
1337 #define ___IMPORT_DATA(type,name)__declspec(dllimport) type name
1338 #endif
1340 #ifndef ___EXPORT_FUNC
1341 #define ___EXPORT_FUNC(type,name)type name
1342 #endif
1344 #ifndef ___EXPORT_DATA
1345 #define ___EXPORT_DATA(type,name)type name
1346 #endif
1348 #ifndef ___IMPORT_FUNC
1349 #define ___IMPORT_FUNC(type,name)extern type name
1350 #endif
1352 #ifndef ___IMPORT_DATA
1353 #define ___IMPORT_DATA(type,name)extern type name
1354 #endif
1356 #define ___EXP_FUNC(type,name)type name
1357 #define ___EXP_DATA(type,name)type name
1358 #define ___IMP_FUNC(type,name)extern type name
1359 #define ___IMP_DATA(type,name)extern type name
1361 #ifdef ___SHARED
1362 #ifdef ___LIBRARY
1363 #undef ___EXP_FUNC
1364 #define ___EXP_FUNC(type,name)___EXPORT_FUNC(type,name)
1365 #undef ___EXP_DATA
1366 #define ___EXP_DATA(type,name)___EXPORT_DATA(type,name)
1367 #endif
1368 #ifndef ___PRIMAL
1369 #undef ___IMP_FUNC
1370 #define ___IMP_FUNC(type,name)___IMPORT_FUNC(type,name)
1371 #undef ___IMP_DATA
1372 #define ___IMP_DATA(type,name)___IMPORT_DATA(type,name)
1373 #endif
1374 #endif
1376 #ifndef ___OS_WIN32
1377 #define ___CAN_IMPORT_EXPORTED
1378 #endif
1380 #ifndef ___CAN_IMPORT_EXPORTED
1381 #ifdef ___SHARED
1382 #ifndef ___PRIMAL
1383 #undef ___BIND_LATE
1384 #define ___BIND_LATE
1385 #endif
1386 #endif
1387 #endif
1389 /*---------------------------------------------------------------------------*/
1391 #ifdef __GNUC__
1392 #if __GNUC__ >= 3
1393 #define ___USE_builtin_expect
1394 #endif
1395 #endif
1397 #ifdef ___USE_builtin_expect
1398 #define ___EXPECT_TRUE(x) __builtin_expect((x),1)
1399 #define ___EXPECT_FALSE(x) __builtin_expect((x),0)
1400 #else
1401 #define ___EXPECT_TRUE(x) (x)
1402 #define ___EXPECT_FALSE(x) (x)
1403 #endif
1405 /*---------------------------------------------------------------------------*/
1408 * IMPORTANT NOTE
1410 * As a general principle, the macros are written in such a way that all
1411 * macros which expand into C expressions yield PRIMARY C expressions.
1412 * Also, macros assume that arguments are PRIMARY expressions. A PRIMARY
1413 * expression is either:
1415 * an identifier, or
1416 * a non-negative constant, or
1417 * a parenthesized expression.
1419 * This convention avoids many operator priority problems and helps keep
1420 * the number of parentheses down. On the other hand, it is easy to
1421 * introduce errors when modifying these macros so be careful.
1424 /*---------------------------------------------------------------------------*/
1427 * The "___CAST" macro is useful to easily locate type casts in the
1428 * source code. Unfortunately there are still places in the sources
1429 * that don't use this macro.
1432 #define ___CAST(type,val)((type)(val))
1435 * Macros to access ___S64 and ___U64 data types. Note that ___S64
1436 * and ___U64 are either defined as a macro or as a typedef.
1439 #define ___FETCH_S64(base,i)*(___CAST(___S64*,base)+(i))
1440 #define ___STORE_S64(base,i,val)*(___CAST(___S64*,base)+(i)) = (val)
1441 #define ___FETCH_U64(base,i)*(___CAST(___U64*,base)+(i))
1442 #define ___STORE_U64(base,i,val)*(___CAST(___U64*,base)+(i)) = (val)
1443 #define ___CAST_S64(x)___CAST(___S64,x)
1444 #define ___CAST_U64(x)___CAST(___U64,x)
1447 * Macros to access ___S32 and ___U32 data types.
1450 #ifdef ___S32
1452 #define ___FETCH_S32(base,i)*(___CAST(___S32*,base)+(i))
1453 #define ___STORE_S32(base,i,val)*(___CAST(___S32*,base)+(i)) = (val)
1454 #define ___FETCH_U32(base,i)*(___CAST(___U32*,base)+(i))
1455 #define ___STORE_U32(base,i,val)*(___CAST(___U32*,base)+(i)) = (val)
1456 #define ___CAST_S32(x)___CAST(___S32,x)
1457 #define ___CAST_U32(x)___CAST(___U32,x)
1459 #else
1461 #define ___FETCH_S32(base,i)___CAST_S32(___FETCH_U32(base,i))
1462 #define ___STORE_S32(base,i,val)___STORE_U32(base,i,___CAST_U32(val))
1464 #ifdef ___BIG_ENDIAN
1465 #define ___FETCH_U32(base,i)(((i)&1) \
1466 ? (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff) \
1467 : ((*(___CAST(___U64*,base)+((i)>>1)))>>32))
1468 #define ___STORE_U32(base,i,val)*(___CAST(___U64*,base)+((i)>>1)) = ((i)&1) \
1469 ? (*(___CAST(___U64*,base)+((i)>>1))&___CAST_U64(0xffffffff<<32))|(val) \
1470 : (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff)|___CAST_U64((val)<<32)
1471 #else
1472 #define ___FETCH_U32(base,i)(((i)&1) \
1473 ? ((*(___CAST(___U64*,base)+((i)>>1)))>>32) \
1474 : (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff))
1475 #define ___STORE_U32(base,i,val)*(___CAST(___U64*,base)+((i)>>1)) = ((i)&1) \
1476 ? (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff)|___CAST_U64((val)<<32) \
1477 : (*(___CAST(___U64*,base)+((i)>>1))&___CAST_U64(0xffffffff<<32))|(val)
1478 #endif
1480 #define ___CAST_S32(x)(___CAST_S64((x)<<32)>>32)
1481 #define ___CAST_U32(x)___CAST_U64((x)&0xffffffff)
1483 #endif
1486 * Macros to access ___S16 and ___U16 data types.
1489 #ifdef ___S16
1491 #define ___FETCH_S16(base,i)*(___CAST(___S16*,base)+(i))
1492 #define ___STORE_S16(base,i,val)*(___CAST(___S16*,base)+(i)) = (val)
1493 #define ___FETCH_U16(base,i)*(___CAST(___U16*,base)+(i))
1494 #define ___STORE_U16(base,i,val)*(___CAST(___U16*,base)+(i)) = (val)
1495 #define ___CAST_S16(x)___CAST(___S16,x)
1496 #define ___CAST_U16(x)___CAST(___U16,x)
1498 #else
1500 #define ___FETCH_S16(base,i)___CAST_S16(___FETCH_U16(base,i))
1501 #define ___STORE_S16(base,i,val)___STORE_U16(base,i,___CAST_U16(val))
1503 #ifdef ___S32
1505 #ifdef ___BIG_ENDIAN
1506 #define ___FETCH_U16(base,i)(((i)&1) \
1507 ? (*(___CAST(___U32*,base)+((i)>>1))&0xffff) \
1508 : ((*(___CAST(___U32*,base)+((i)>>1)))>>16))
1509 #define ___STORE_U16(base,i,val)*(___CAST(___U32*,base)+((i)>>1)) = ((i)&1) \
1510 ? (*(___CAST(___U32*,base)+((i)>>1))&___CAST_U32(0xffff<<16))|(val) \
1511 : (*(___CAST(___U32*,base)+((i)>>1))&0xffff)|___CAST_U32((val)<<16)
1512 #else
1513 #define ___FETCH_U16(base,i)(((i)&1) \
1514 ? ((*(___CAST(___U32*,base)+((i)>>1)))>>16) \
1515 : (*(___CAST(___U32*,base)+((i)>>1))&0xffff))
1516 #define ___STORE_U16(base,i,val)*(___CAST(___U32*,base)+((i)>>1)) = ((i)&1) \
1517 ? (*(___CAST(___U32*,base)+((i)>>1))&0xffff)|___CAST_U32((val)<<16) \
1518 : (*(___CAST(___U32*,base)+((i)>>1))&(0xffff<<16))|(___U32)(val)
1519 #endif
1521 #define ___CAST_S16(x)(___CAST_S32((x)<<16)>>16)
1522 #define ___CAST_U16(x)___CAST_U32((x)&0xffff)
1524 #else
1526 #ifdef ___BIG_ENDIAN
1527 #define ___FETCH_S16(base,i)(((i)&1) \
1528 ? ((*(___CAST(___S64*,base)+((i)>>1)))>>16) \
1529 : ((*(___CAST(___S64*,base)+((i)>>1))<<16)>>16))
1530 #define ___FETCH_U16(base,i) \
1531 ((*(___CAST(___U64*,base)+((i)>>2))>>((~(i)&3)<<4))&0xffff)
1532 #define ___STORE_U16(base,i,val)*(___CAST(___U64*,base)+((i)>>2)) = \
1533 (*(___CAST(___U64*,base)+((i)>>2))&~___CAST_U64(0xffff<<((~(i)&3)<<4))) | \
1534 ___CAST_U64((val)<<((~(i)&3)<<4))
1535 #else
1536 #define ___FETCH_U16(base,i) \
1537 ((*(___CAST(___U64*,base)+((i)>>2))>>(((i)&3)<<4))&0xffff)
1538 #define ___STORE_U16(base,i,val)*(___CAST(___U64*,base)+((i)>>2)) = \
1539 (*(___CAST(___U64*,base)+((i)>>2))&~___CAST_U64(0xffff<<(((i)&3)<<4))) | \
1540 ___CAST_U64((val)<<(((i)&3)<<4))
1541 #endif
1543 #define ___CAST_S16(x)(___CAST_S64((x)<<48)>>48)
1544 #define ___CAST_U16(x)___CAST_U64((x)&0xffff)
1546 #endif
1548 #endif
1551 * Macros to access ___S8 and ___U8 data types.
1554 #ifdef ___S8
1556 #define ___FETCH_S8(base,i)*(___CAST(___S8*,base)+(i))
1557 #define ___FETCH_U8(base,i)*(___CAST(___U8*,base)+(i))
1558 #define ___STORE_S8(base,i,val)*(___CAST(___S8*,base)+(i)) = (val)
1559 #define ___STORE_U8(base,i,val)*(___CAST(___U8*,base)+(i)) = (val)
1560 #define ___CAST_S8(x)(___S8)(x)
1561 #define ___CAST_U8(x)(___U8)(x)
1563 #else
1565 #define ___FETCH_S8(base,i)___CAST_S8(___FETCH_U8(base,i))
1566 #define ___STORE_S8(base,i,val)___STORE_U8(base,i,___CAST_U8(val))
1568 #ifdef ___S32
1570 #ifdef ___BIG_ENDIAN
1571 #define ___FETCH_U8(base,i) \
1572 ((*(___CAST(___U32*,base)+((i)>>2))>>((~(i)&3)<<3))&0xff)
1573 #define ___STORE_U8(base,i,val)*(___CAST(___U32*,base)+((i)>>2)) = \
1574 (*(___CAST(___U32*,base)+((i)>>2))&~___CAST_U32(0xff<<((~(i)&3)<<3))) | \
1575 ___CAST_U32((val)<<((~(i)&3)<<3))
1576 #else
1577 #define ___FETCH_U8(base,i) \
1578 ((*(___CAST(___U32*,base)+((i)>>2))>>(((i)&3)<<3))&0xff)
1579 #define ___STORE_U8(base,i,val)*(___CAST(___U32*,base)+((i)>>2)) = \
1580 (*(___CAST(___U32*,base)+((i)>>2))&~___CAST_U32(0xff<<(((i)&3)<<3))) | \
1581 ___CAST_U32((val)<<(((i)&3)<<3))
1582 #endif
1584 #define ___CAST_S8(x)(___CAST_S32((x)<<24)>>24)
1585 #define ___CAST_U8(x)___CAST_U32((x)&0xff)
1587 #else
1589 #ifdef ___BIG_ENDIAN
1590 #define ___FETCH_U8(base,i) \
1591 ((*(___CAST(___U64*,base)+((i)>>3))>>((~(i)&7)<<3))&0xff)
1592 #define ___STORE_U8(base,i,val)*(___CAST(___U64*,base)+((i)>>3)) = \
1593 (*(___CAST(___U64*,base)+((i)>>3))&~___CAST_U64(0xff<<((~(i)&7)<<3))) | \
1594 ___CAST_U64((val)<<((~(i)&7)<<3))
1595 #else
1596 #define ___FETCH_U8(base,i) \
1597 ((*(___CAST(___U64*,base)+((i)>>3))>>(((i)&7)<<3))&0xff)
1598 #define ___STORE_U8(base,i,val)*(___CAST(___U64*,base)+((i)>>3)) = \
1599 (*(___CAST(___U64*,base)+((i)>>3))&~___CAST_U64(0xff<<(((i)&7)<<3))) | \
1600 ___CAST_U64((val)<<(((i)&7)<<3))
1601 #endif
1603 #define ___CAST_S8(x)(___CAST_S64((x)<<56)>>56)
1604 #define ___CAST_U8(x)___CAST_U64((x)&0xff)
1606 #endif
1608 #endif
1610 /*---------------------------------------------------------------------------*/
1613 * GENERAL DEFINITIONS
1615 * ___WORD an integer type able to contain a pointer with no loss
1616 * ___WORD_WIDTH is equal to the number of bits in the type ___WORD
1617 * ___LOG_WORD_WIDTH is equal to the base 2 logarithm of ___WORD_WIDTH
1618 * ___WS is equal to sizeof (___WORD)
1619 * ___LWS is equal to the base 2 logarithm of ___WS
1620 * ___FLONUM_SIZE is equal to sizeof (___F64) / ___WS
1623 #ifdef ___USE_32_BIT_ADDR
1624 #define ___WORD ___S32
1625 #define ___WORD_WIDTH 32
1626 #define ___LOG_WORD_WIDTH 5
1627 #define ___WS 4
1628 #define ___LWS 2
1629 #define ___FLONUM_SIZE 2
1630 #else
1631 #define ___WORD ___S64
1632 #define ___WORD_WIDTH 64
1633 #define ___LOG_WORD_WIDTH 6
1634 #define ___WS 8
1635 #define ___LWS 3
1636 #define ___FLONUM_SIZE 1
1637 #endif
1639 #define ___SCMOBJ ___WORD
1640 #define ___SCMOBJ_WIDTH ___WORD_WIDTH
1642 #define ___ISO_8859_1 ___UM8
1643 #define ___UTF_8 char
1644 #define ___UTF_16 ___UM16
1645 #define ___UCS_2 ___UM16
1646 #define ___UCS_4 ___UM32
1647 #define ___ISO_8859_1STRING ___ISO_8859_1*
1648 #define ___UTF_8STRING ___UTF_8*
1649 #define ___UTF_16STRING ___UTF_16*
1650 #define ___UCS_2STRING ___UCS_2*
1651 #define ___UCS_4STRING ___UCS_4*
1652 #define ___WCHARSTRING ___WCHAR*
1654 #if ___MAX_CHR <= 0xff
1655 #define ___CS 1
1656 #else
1657 #if ___MAX_CHR <= 0xffff
1658 #define ___CS 2
1659 #else
1660 #define ___CS 4
1661 #endif
1662 #endif
1664 #if ___CS == 1
1665 #define ___CS_SELECT(cs1,cs2,cs4)cs1
1666 #else
1667 #if ___CS == 2
1668 #define ___CS_SELECT(cs1,cs2,cs4)cs2
1669 #else
1670 #define ___CS_SELECT(cs1,cs2,cs4)cs4
1671 #endif
1672 #endif
1674 #define ___LCS ___CS_SELECT(0,1,2)
1676 #define ___C ___CS_SELECT(___U8,___U16,___U32)
1678 #if ___WORD_WIDTH == ___VOIDSTAR_WIDTH
1679 #define ___FAKEWORD ___WORD*
1680 #define ___CAST_FAKEWORD_TO_WORD(x)___CAST(___WORD,x)
1681 #define ___CAST_WORDSTAR_TO_FAKEWORD(x)x
1682 #define ___FAKEHOST ___host
1683 #define ___CAST_HOST_TO_FAKEHOST(x)x
1684 #define ___CAST_FAKEHOST_TO_HOST(x)x
1685 #define ___FAKEVOIDSTAR void*
1686 #define ___CAST_VOIDSTAR_TO_FAKEVOIDSTAR(x)___CAST(___FAKEVOIDSTAR,x)
1687 #define ___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(x)___CAST(void*,x)
1688 #else
1689 #define ___FAKEWORD ___WORD
1690 #define ___CAST_FAKEWORD_TO_WORD(x)x
1691 #define ___CAST_WORDSTAR_TO_FAKEWORD(x)___CAST(___WORD,x)
1692 #define ___FAKEHOST ___WORD
1693 #define ___CAST_HOST_TO_FAKEHOST(x)___CAST(___WORD,x)
1694 #define ___CAST_FAKEHOST_TO_HOST(x)___CAST(___host,x)
1695 #define ___FAKEVOIDSTAR ___WORD
1696 #define ___CAST_VOIDSTAR_TO_FAKEVOIDSTAR(x)___CAST(___WORD,x)
1697 #define ___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(x)___CAST(void*,x)
1698 #endif
1700 /* Padding at end of objects so that they can be aligned to an address */
1701 /* multiple of 4 or 8 by moving them up in memory. */
1703 #ifdef ___USE_32_BIT_ADDR
1704 #define ___PADDING ,0
1705 #define ___PADDING_SIZE 1
1706 #define ___PADDING_LBL ,{0,0,0,0}
1707 #define ___PADDING_64 ,0,0
1708 #else
1709 #define ___PADDING
1710 #define ___PADDING_SIZE 0
1711 #define ___PADDING_LBL
1712 #define ___PADDING_64
1713 #endif
1715 /* Utility macro to select code for SINGLE/MULTIPLE host. */
1717 #ifdef ___SINGLE_HOST
1718 #define ___SM(s,m)s
1719 #else
1720 #define ___SM(s,m)m
1721 #endif
1723 /*---------------------------------------------------------------------------*/
1725 /* OBJECT REPRESENTATION */
1728 * For a complete description of the object representation, read the
1729 * file "lib/mem.c". These definitions must agree with those in the
1730 * files "lib/_gambit#.scm" and "gsc/_t-c-3.scm".
1734 * Type tag assignment.
1736 * Type tags are located in the lower 2 bits of a ___SCMOBJ.
1738 * ___TB = number of tag bits
1739 * ___tFIXNUM = tag for fixnums (small integers), must be 0
1740 * ___tSPECIAL = tag for other immediates (#f, #t, (), #!eof, chars, ...)
1741 * ___tPAIR = tag for pairs
1742 * ___tSUBTYPED = tag for other memory allocated objects
1745 #define ___TB 2
1746 #define ___tFIXNUM 0
1747 #define ___tSPECIAL 2
1748 #define ___tPAIR 3
1749 #define ___tSUBTYPED 1
1751 #define ___MEM_ALLOCATED(obj)((obj)&1)
1752 #define ___MEM_ALLOCATED_CLEAR(obj)((obj)&~___CAST(___WORD,1))
1753 #define ___MEM_ALLOCATED_SET(obj)((obj)|1)
1756 * Subtype tag assignment.
1758 * These tags are stored in the head of memory allocated objects
1759 * (including pairs).
1761 * ___SB = number of subtype tag bits
1762 * ___sVECTOR = tag for vectors
1763 * ___sPAIR = tag for pairs
1764 * ___sRATNUM = tag for ratnums
1765 * ___sCPXNUM = tag for cpxnums
1766 * ___sSTRUCTURE = tag for structures
1767 * ___sBOXVALUES = tag for box and multiple-values objects
1768 * ___sMEROON = tag for Meroon objects
1769 * ___sJAZZ = tag for Jazz objects
1770 * ___sSYMBOL = tag for symbols
1771 * ___sKEYWORD = tag for keywords
1772 * ___sFRAME = tag for continuation frames
1773 * ___sCONTINUATION = tag for continuations
1774 * ___sPROMISE = tag for promises
1775 * ___sWEAK = tag for weak objects (wills and GC hash tables)
1776 * ___sPROCEDURE = tag for procedures
1777 * ___sRETURN = tag for returns
1778 * ___sFOREIGN = tag for foreign data
1779 * ___sSTRING = tag for strings
1780 * ___sS8VECTOR = tag for 8-bit signed integer vectors
1781 * ___sU8VECTOR = tag for 8-bit unsigned integer vectors
1782 * ___sS16VECTOR = tag for 16-bit signed integer vectors
1783 * ___sU16VECTOR = tag for 16-bit unsigned integer vectors
1784 * ___sS32VECTOR = tag for 32-bit signed integer vectors
1785 * ___sU32VECTOR = tag for 32-bit unsigned integer vectors
1786 * ___sF32VECTOR = tag for 32-bit floating point number vectors
1787 * ___sS64VECTOR = tag for 64-bit signed integer vectors
1788 * ___sU64VECTOR = tag for 64-bit unsigned integer vectors
1789 * ___sF64VECTOR = tag for 64-bit floating point number vectors
1790 * ___sFLONUM = tag for flonums
1791 * ___sBIGNUM = tag for bignums
1793 * The five subtype tags ___sS64VECTOR, ___sU64VECTOR, ___sF64VECTOR,
1794 * ___sFLONUM, ___sBIGNUM must come last. These object types (and
1795 * ___sFOREIGN which is always allocated as a ___STILL object) must
1796 * be aligned on a multiple of 8.
1799 #define ___SB 5
1800 #define ___sVECTOR 0
1801 #define ___sPAIR 1
1802 #define ___sRATNUM 2
1803 #define ___sCPXNUM 3
1804 #define ___sSTRUCTURE 4
1805 #define ___sBOXVALUES 5
1806 #define ___sMEROON 6
1807 #define ___sJAZZ 7
1808 #define ___sSYMBOL 8
1809 #define ___sKEYWORD 9
1810 #define ___sFRAME 10
1811 #define ___sCONTINUATION 11
1812 #define ___sPROMISE 12
1813 #define ___sWEAK 13
1814 #define ___sPROCEDURE 14
1815 #define ___sRETURN 15
1816 #define ___sFOREIGN 18
1817 #define ___sSTRING 19
1818 #define ___sS8VECTOR 20
1819 #define ___sU8VECTOR 21
1820 #define ___sS16VECTOR 22
1821 #define ___sU16VECTOR 23
1822 #define ___sS32VECTOR 24
1823 #define ___sU32VECTOR 25
1824 #define ___sF32VECTOR 26
1825 #define ___sS64VECTOR 27
1826 #define ___sU64VECTOR 28
1827 #define ___sF64VECTOR 29
1828 #define ___sFLONUM 30
1829 #define ___sBIGNUM 31
1832 * Head type tag assignment.
1834 * Head type tags are stored in the lower 3 bits of the head of memory
1835 * allocated objects.
1837 * ___HTB = number of head tag bits
1838 * ___MOVABLE0 = tag for movable objects in generation 0
1839 * ___MOVABLE1 = tag for movable objects in generation 1
1840 * ___MOVABLE2 = tag for movable objects in generation 2
1841 * ___FORW = tag for movable objects that have been forwarded
1842 * ___STILL = tag for still objects
1843 * ___PERM = tag for permanent objects
1845 * note: the tag ___FORW+(1<<___TB) is also used for forwarding pointers
1848 #define ___HTB 3
1849 #define ___MOVABLE0 0
1850 #define ___MOVABLE1 1
1851 #define ___MOVABLE2 2
1852 #define ___FORW 3
1853 #define ___STILL 5
1854 #define ___PERM 6
1857 * Miscellaneous masks.
1860 #define ___LF (___HTB+___SB)
1862 #define ___TMASK ((1<<___TB)-1)
1863 #define ___HTMASK ((1<<___HTB)-1)
1864 #define ___SMASK (((1<<___SB)-1)<<___HTB)
1865 #define ___LMASK (~___CAST(unsigned ___WORD,0)<<___LF)
1866 #define ___LSMASK (~___CAST(unsigned ___WORD,0)<<___HTB)
1869 * Value constructors for object references inside executable code.
1872 #define ___FAL ((___CAST(___WORD,-1)<<___TB)+___tSPECIAL)
1873 #define ___TRU ((___CAST(___WORD,-2)<<___TB)+___tSPECIAL)
1874 #define ___NUL ((___CAST(___WORD,-3)<<___TB)+___tSPECIAL)
1875 #define ___EOF ((___CAST(___WORD,-4)<<___TB)+___tSPECIAL)
1876 #define ___VOID ((___CAST(___WORD,-5)<<___TB)+___tSPECIAL)
1877 #define ___ABSENT ((___CAST(___WORD,-6)<<___TB)+___tSPECIAL)
1878 #define ___UNB1 ((___CAST(___WORD,-7)<<___TB)+___tSPECIAL)
1879 #define ___UNB2 ((___CAST(___WORD,-8)<<___TB)+___tSPECIAL)
1880 #define ___OPTIONAL ((___CAST(___WORD,-9)<<___TB)+___tSPECIAL)
1881 #define ___KEY_OBJ ((___CAST(___WORD,-10)<<___TB)+___tSPECIAL)
1882 #define ___REST ((___CAST(___WORD,-11)<<___TB)+___tSPECIAL)
1883 #define ___UNUSED ((___CAST(___WORD,-14)<<___TB)+___tSPECIAL)
1884 #define ___DELETED ((___CAST(___WORD,-15)<<___TB)+___tSPECIAL)
1885 #define ___FIX(x)(___CAST(___WORD,x)<<___TB)
1886 #if ___SCMOBJ_WIDTH == 32
1887 #define ___BIGFIX(i,x)___SUB(i)
1888 #else
1889 #define ___BIGFIX(i,x)___FIX(x)
1890 #endif
1891 #define ___CHR(x)((___CAST(___WORD,___CS_SELECT(___CAST_U8(x),___CAST_U16(x),___CAST_U32(x)))<<___TB)+___tSPECIAL)
1893 #define ___SYM(i,id)___CAST_FAKEWORD_TO_WORD(___sym_tbl[i])
1894 #define ___KEY(i,id)___CAST_FAKEWORD_TO_WORD(___key_tbl[i])
1895 #define ___CNS(i)___TAG((___ALIGNUP(___cns_tbl,___WS)+i*(___PAIR_SIZE+1)),___tPAIR)
1896 #define ___SUB(i)___CAST_FAKEWORD_TO_WORD(___sub_tbl[i])
1899 * Value constructors for object references inside constant
1900 * memory allocated objects.
1903 #define ___REF_FAL ___FAL
1904 #define ___REF_TRU ___TRU
1905 #define ___REF_NUL ___NUL
1906 #define ___REF_EOF ___EOF
1907 #define ___REF_VOID ___VOID
1908 #define ___REF_ABSENT ___ABSENT
1909 #define ___REF_UNB1 ___UNB1
1910 #define ___REF_UNB2 ___UNB2
1911 #define ___REF_OPTIONAL ___OPTIONAL
1912 #define ___REF_KEY_OBJ ___KEY_OBJ
1913 #define ___REF_REST ___REST
1914 #define ___REF_UNUSED ___UNUSED
1915 #define ___REF_DELETED ___DELETED
1916 #define ___REF_FIX(x)___FIX(x)
1917 #if ___SCMOBJ_WIDTH == 32
1918 #define ___REF_BIGFIX(i,x)___REF_SUB(i)
1919 #else
1920 #define ___REF_BIGFIX(i,x)___REF_FIX(x)
1921 #endif
1922 #define ___REF_CHR(x)___CHR(x)
1924 #define ___REF_SYM(i,id)((___CAST(___WORD,-1-i)<<___TB)+___tPAIR)
1925 #define ___REF_KEY(i,id)((___CAST(___WORD,-1-i)<<___TB)+___tSUBTYPED)
1926 #define ___REF_CNS(i)((___CAST(___WORD,i)<<___TB)+___tPAIR)
1927 #define ___REF_SUB(i)((___CAST(___WORD,i)<<___TB)+___tSUBTYPED)
1929 /*---------------------------------------------------------------------------*/
1931 /* Miscellaneous macros */
1933 #define ___IF(x) if (x) {
1934 #define ___END_IF }
1936 #define ___NOTHING
1938 #define ___NBELEMS(table) (sizeof (table) / sizeof ((table)[0]))
1940 #define ___INT(x)((x)>>___TB)
1942 #define ___FIX_WIDTH (___SCMOBJ_WIDTH-___TB)
1943 #define ___MIN_FIX (-(___CAST(___WORD,1)<<(___FIX_WIDTH-1)))
1944 #define ___MAX_FIX ((___CAST(___WORD,1)<<(___FIX_WIDTH-1))-1)
1946 #define ___MAX_FIX32 ((___CAST(___WORD,1)<<(32-___TB-1))-1)
1949 * Module prefix and C id prefix must match the definitions
1950 * in the file "gsc/_parms.scm".
1953 #define ___MODULE_PREFIX " "
1954 #define ___C_ID_PREFIX "___"
1956 /*---------------------------------------------------------------------------*/
1958 #define ___ALIGNUP(x,mult) \
1959 ___CAST(___WORD*,(___CAST(___WORD,x)+((mult)-1))&~((mult)-1))
1961 #define ___ALLOC(n) ___hp += (n)
1963 #if ___SCMOBJ_WIDTH == 32
1965 #define ___ALLOC_ALIGN64(n) \
1966 ___hp = ___CAST(___WORD*, (___CAST(___WORD,___hp) + (((n)<<___LWS) + 7)) & ~7)
1968 #else
1970 #define ___ALLOC_ALIGN64(n) ___ALLOC(n)
1972 #endif
1974 /* Type tests */
1976 #define ___TAG(ptr,tag)(___CAST(___WORD,ptr)+(tag))
1977 #define ___UNTAG(obj)___CAST(___WORD*,(obj)&-(1<<___TB))
1978 #define ___UNTAG_AS(obj,tag)___CAST(___WORD*,(obj)-(tag))
1980 #define ___TYP(x)((x)&___TMASK)
1981 #define ___TESTTYPE(x,typ)(___TYP(x)==(typ))
1983 #define ___TESTHEADERTAG(x,s)(((x)&___SMASK)==((s)<<___HTB))
1984 #define ___TESTSUBTYPETAG(x,s)___TESTHEADERTAG(___HEADER(x),s)
1985 #define ___TESTSUBTYPE(x,s)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTSUBTYPETAG(___temp,(s)))
1986 #define ___TESTLENGTHSUBTYPETAG(x,bytes,s)((___HEADER(x)&___LSMASK)==___MAKE_HD(bytes,s,0))
1987 #define ___TESTLENGTHSUBTYPE(x,bytes,s)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTLENGTHSUBTYPETAG(___temp,bytes,s))
1988 #define ___HEADER(x)(*___UNTAG_AS(x,___tSUBTYPED))
1990 #define ___BODY_OFS 1
1992 #ifdef ___USE_HANDLES
1993 #define ___PAIR_OVERHEAD 2
1994 #define ___SUBTYPED_OVERHEAD 2
1995 #define ___BODY(obj)___CAST(___WORD*,*(___UNTAG(obj)+___BODY_OFS)+___BODY_OFS)
1996 #define ___BODY_AS(obj,tag)___CAST(___WORD*,*(___UNTAG_AS(obj,tag)+___BODY_OFS)+___BODY_OFS)
1997 #else
1998 #define ___PAIR_OVERHEAD 1
1999 #define ___SUBTYPED_OVERHEAD 1
2000 #define ___BODY(obj)(___UNTAG(obj)+___BODY_OFS)
2001 #define ___BODY_AS(obj,tag)(___UNTAG_AS(obj,tag)+___BODY_OFS)
2002 #endif
2004 #define ___MAKE_HD(bytes,subtype,tag)(((bytes)<<___LF)+((subtype)<<___HTB)+(tag))
2005 #define ___HD_TYP(head)((head)&___HTMASK)
2006 #define ___HD_BYTES(head)(___CAST(unsigned ___WORD,head)>>___LF)
2007 #define ___HD_WORDS(head)(((___CAST(unsigned ___WORD,head)+((___WS-1)<<___LF)))>>(___LF+___LWS))
2008 #define ___HD_FIELDS(head)(___CAST(unsigned ___WORD,head)>>(___LF+___LWS))
2009 #define ___HD_SUBTYPE(head)((head)>>___HTB&((1<<___SB)-1))
2011 #define ___FIELD(obj,i)(*(___BODY_AS(obj,___tSUBTYPED)+i))
2013 #define ___WORDS(bytes)(((bytes)+___WS-1)>>___LWS)
2015 #define ___MAKE_HD_BYTES(bytes,subtype)___MAKE_HD(bytes,subtype,___MOVABLE0)
2016 #define ___MAKE_HD_WORDS(words,subtype)___MAKE_HD(((words)<<___LWS),subtype,___MOVABLE0)
2018 #define ___SYMBOL_SIZE 4
2019 #define ___KEYWORD_SIZE 3
2020 #define ___WILL_SIZE 3
2021 #define ___TABLE_SIZE 5
2022 #define ___PROMISE_SIZE 2
2023 #define ___RATNUM_SIZE 2
2024 #define ___CPXNUM_SIZE 2
2025 #define ___CONTINUATION_SIZE 2
2026 #define ___THREAD_SIZE 26
2027 #define ___BOX_SIZE 1
2028 #define ___FOREIGN_SIZE 3
2029 #define ___FOREIGN_TAGS 0
2030 #define ___FOREIGN_RELEASE_FN 1
2031 #define ___FOREIGN_PTR 2
2033 /* Flonum boxing and unboxing */
2035 #define ___FLONUM_VAL(obj) *___CAST(___F64*,___BODY_AS(obj,___tSUBTYPED))
2037 #define ___F64UNBOX(x) ___FLONUM_VAL(x)
2039 #define ___F64BOX(x) \
2040 (___ALLOC_ALIGN64(1+___FLONUM_SIZE), \
2041 ___hp[-(1+___FLONUM_SIZE)] = ___MAKE_HD_WORDS(___FLONUM_SIZE,___sFLONUM), \
2042 *___CAST(___F64*,___hp-___FLONUM_SIZE) = (x), \
2043 ___TAG((___hp-(1+___FLONUM_SIZE)),___tSUBTYPED))
2045 #define ___D_F64(x)___F64 x;
2046 #define ___SET_F64(x,y)x=y;
2048 /* Bignum representation */
2050 #define ___BIG_FBASE_WIDTH 8
2052 #if ___SCMOBJ_WIDTH == 32
2053 #define ___BIG_MBASE_WIDTH 16
2054 #else
2055 #define ___BIG_MBASE_WIDTH 32
2056 #endif
2058 #ifndef ___BUILTIN_64BIT_INT_TYPE
2059 #define ___BIG_ABASE_WIDTH 32
2060 #else
2061 #define ___BIG_ABASE_WIDTH 64
2062 #endif
2064 #if ___BIG_ABASE_WIDTH == 32
2066 #define ___BIGAFETCH(base,i) ___FETCH_U32(base,i)
2067 #define ___BIGAFETCHSIGNED(base,i) ___FETCH_S32(base,i)
2068 #define ___BIGASTORE(base,i,val) ___STORE_U32(base,i,val)
2069 #define ___BIGASTORESIGNED(base,i,val) ___STORE_S32(base,i,val)
2070 #define ___BIGALENGTH(vect) ___U32VECTORLENGTH(vect)
2071 #define ___BIGADIGIT ___U32
2072 #define ___BIGADIGITSIGNED ___S32
2073 #define ___BIGASHRINK(x,y) ___U32VECTORSHRINK(x,y)
2074 #define ___BIGATEMP ___u32_temp
2076 #else
2078 #define ___BIGAFETCH(base,i) ___FETCH_U64(base,i)
2079 #define ___BIGAFETCHSIGNED(base,i) ___FETCH_S64(base,i)
2080 #define ___BIGASTORE(base,i,val) ___STORE_U64(base,i,val)
2081 #define ___BIGASTORESIGNED(base,i,val) ___STORE_S64(base,i,val)
2082 #define ___BIGALENGTH(vect) ___U64VECTORLENGTH(vect)
2083 #define ___BIGADIGIT ___U64
2084 #define ___BIGADIGITSIGNED ___S64
2085 #define ___BIGASHRINK(x,y) ___U64VECTORSHRINK(x,y)
2086 #define ___BIGATEMP ___u64_temp
2088 #endif
2090 #define ___BIG_ABASE_MIN_1 (~___CAST(___BIGADIGIT,0))
2092 #if ___BIG_ABASE_WIDTH == 32
2094 #define ___S32UNBOX(x) \
2095 (___TYP((___temp=x)) == ___tFIXNUM \
2096 ? ___INT(___temp) \
2097 : ___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0))
2099 #define ___U32UNBOX(x) \
2100 (___TYP((___temp=x)) == ___tFIXNUM \
2101 ? ___CAST_U32(___INT(___temp)) \
2102 : ___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))
2104 #define ___S64UNBOX(x) \
2105 (___TYP((___temp=x)) == ___tFIXNUM \
2106 ? ___S64_from_SM32(___INT(___temp)) \
2107 : (___HD_BYTES(___HEADER(___temp)) == (1<<2) \
2108 ? ___S64_from_SM32(___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0)) \
2109 : ___S64_from_SM32_UM32(___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),1),___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2111 #define ___U64UNBOX(x) \
2112 (___TYP((___temp=x)) == ___tFIXNUM \
2113 ? ___U64_from_UM32(___CAST_U32(___INT(___temp))) \
2114 : (___HD_BYTES(___HEADER(___temp)) == (1<<2) \
2115 ? ___U64_from_UM32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0)) \
2116 : ___U64_from_UM32_UM32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),1),___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2118 #if ___SCMOBJ_WIDTH == 32
2120 #define ___S32BOX(x) \
2121 (___s32_temp=(x), \
2122 (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2123 ? ___FIX(___s32_temp) \
2124 : (___ALLOC(1+___WORDS(1<<2)), \
2125 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2126 ___BIGASTORESIGNED(___hp,-1,___s32_temp), \
2127 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))))
2129 #define ___U32BOX(x) \
2130 (___u32_temp=(x), \
2131 (___u32_temp <= ___CAST_U32(___MAX_FIX) \
2132 ? ___FIX(___u32_temp) \
2133 : (___CAST_S32(___u32_temp) < 0 \
2134 ? (___ALLOC(1+___WORDS(2<<2)), \
2135 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2136 ___BIGASTORE(___hp,-2,___u32_temp), \
2137 ___BIGASTORE(___hp,-1,0), \
2138 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)) \
2139 : (___ALLOC(1+___WORDS(1<<2)), \
2140 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2141 ___BIGASTORE(___hp,-1,___u32_temp), \
2142 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)))))
2144 #define ___S64BOX(x) \
2145 (___s64_temp=(x), \
2146 (((___s32_temp = ___CAST_S32(___S64_lo32(___s64_temp)))>>31) \
2147 == ___S64_hi32(___s64_temp) \
2148 ? (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2149 ? ___FIX(___s32_temp) \
2150 : (___ALLOC(1+___WORDS(1<<2)), \
2151 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2152 ___BIGASTORE(___hp,-1,___s32_temp), \
2153 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))) \
2154 : (___ALLOC(1+___WORDS(2<<2)), \
2155 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2156 ___BIGASTORE(___hp,-2,___s32_temp), \
2157 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___s64_temp)), \
2158 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))))
2160 #define ___U64BOX(x) \
2161 (___u64_temp=(x), \
2162 (___CAST_S32(___U64_hi32(___u64_temp)) < 0 \
2163 ? (___ALLOC(1+___WORDS(3<<2)), \
2164 ___hp[-(1+___WORDS(3<<2))] = ___MAKE_HD_BYTES(3<<2,___sBIGNUM), \
2165 ___BIGASTORE(___hp,-3,___U64_lo32(___u64_temp)), \
2166 ___BIGASTORE(___hp,-2,___U64_hi32(___u64_temp)), \
2167 ___BIGASTORE(___hp,-1,0), \
2168 ___TAG((___hp-(1+___WORDS(3<<2))),___tSUBTYPED)) \
2169 : (((___u32_temp = ___U64_lo32(___u64_temp)) & (___CAST_U32(1)<<31)) \
2170 == ___U64_hi32(___u64_temp) \
2171 ? (___u32_temp <= ___MAX_FIX \
2172 ? ___FIX(___u32_temp) \
2173 : (___ALLOC(1+___WORDS(1<<2)), \
2174 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2175 ___BIGASTORE(___hp,-1,___u32_temp), \
2176 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))) \
2177 : (___ALLOC(1+___WORDS(2<<2)), \
2178 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2179 ___BIGASTORE(___hp,-2,___u32_temp), \
2180 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___u64_temp)), \
2181 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)))))
2183 #else
2185 #define ___S32BOX(x) ___FIX(___CAST_S64(x))
2186 #define ___U32BOX(x) ___FIX(___CAST_U64(x))
2188 #define ___S64BOX(x) \
2189 (___s64_temp=(x), \
2190 (___s64_temp >= ___MIN_FIX && ___s64_temp <= ___MAX_FIX \
2191 ? ___FIX(___s64_temp) \
2192 : ((___CAST_S32(___S64_lo32(___s64_temp))>>31) == ___S64_hi32(___s64_temp) \
2193 ? (___ALLOC(1+___WORDS(1<<2)), \
2194 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2195 ___BIGASTORE(___hp,-1,___S64_lo32(___s64_temp)), \
2196 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)) \
2197 : (___ALLOC(1+___WORDS(2<<2)), \
2198 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2199 ___BIGASTORE(___hp,-2,___S64_lo32(___s64_temp)), \
2200 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___s64_temp)), \
2201 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)))))
2203 #define ___U64BOX(x) \
2204 (___u64_temp=(x), \
2205 (___u64_temp <= ___CAST_U64(___MAX_FIX) \
2206 ? ___FIX(___u64_temp) \
2207 : (___CAST_S64(___u64_temp) < 0 \
2208 ? (___ALLOC(1+___WORDS(3<<2)), \
2209 ___hp[-(1+___WORDS(3<<2))] = ___MAKE_HD_BYTES(3<<2,___sBIGNUM), \
2210 ___BIGASTORE(___hp,-3,___U64_lo32(___u64_temp)), \
2211 ___BIGASTORE(___hp,-2,___U64_hi32(___u64_temp)), \
2212 ___BIGASTORE(___hp,-1,0), \
2213 ___TAG((___hp-(1+___WORDS(3<<2))),___tSUBTYPED)) \
2214 : ((___U64_lo32(___u64_temp) & (___CAST_U32(1)<<31)) == ___U64_hi32(___u64_temp) \
2215 ? (___ALLOC(1+___WORDS(1<<2)), \
2216 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2217 ___BIGASTORE(___hp,-1,___S64_lo32(___u64_temp)), \
2218 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)) \
2219 : (___ALLOC(1+___WORDS(2<<2)), \
2220 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2221 ___BIGASTORE(___hp,-2,___S64_lo32(___u64_temp)), \
2222 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___u64_temp)), \
2223 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))))))
2225 #endif
2227 #else
2229 #define ___S32UNBOX(x) \
2230 (___TYP((___temp=x)) == ___tFIXNUM \
2231 ? ___INT(___temp) \
2232 : ___CAST_S32(___U64_lo32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2234 #define ___U32UNBOX(x) \
2235 (___TYP((___temp=x)) == ___tFIXNUM \
2236 ? ___CAST_U32(___INT(___temp)) \
2237 : ___U64_lo32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0)))
2239 #define ___S64UNBOX(x) \
2240 (___TYP((___temp=x)) == ___tFIXNUM \
2241 ? ___INT(___temp) \
2242 : ___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0))
2244 #define ___U64UNBOX(x) \
2245 (___TYP((___temp=x)) == ___tFIXNUM \
2246 ? ___CAST_U64(___INT(___temp)) \
2247 : ___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))
2249 #if ___SCMOBJ_WIDTH == 32
2251 #define ___S32BOX(x) \
2252 (___s32_temp=(x), \
2253 (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2254 ? ___FIX(___s32_temp) \
2255 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2256 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2257 ___BIGASTORESIGNED(___hp,-1,___S64_from_SM32(___s32_temp)), \
2258 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2260 #define ___U32BOX(x) \
2261 (___u32_temp=(x), \
2262 (___u32_temp <= ___CAST_U32(___MAX_FIX) \
2263 ? ___FIX(___u32_temp) \
2264 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2265 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2266 ___BIGASTORE(___hp,-1,___U64_from_UM32(___u32_temp)), \
2267 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2269 #else
2271 #define ___S32BOX(x) ___FIX(___CAST_S64(x))
2272 #define ___U32BOX(x) ___FIX(___CAST_U64(x))
2274 #endif
2276 #define ___S64BOX(x) \
2277 (___s64_temp=(x), \
2278 (___s64_temp >= ___MIN_FIX && ___s64_temp <= ___MAX_FIX \
2279 ? ___FIX(___s64_temp) \
2280 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2281 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2282 ___BIGASTORESIGNED(___hp,-1,___s64_temp), \
2283 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2285 #define ___U64BOX(x) \
2286 (___u64_temp=(x), \
2287 (___u64_temp <= ___CAST_U64(___MAX_FIX) \
2288 ? ___FIX(___u64_temp) \
2289 : (___CAST_S64(___u64_temp) < 0 \
2290 ? (___ALLOC_ALIGN64(1+___WORDS(2<<3)), \
2291 ___hp[-(1+___WORDS(2<<3))] = ___MAKE_HD_BYTES(2<<3,___sBIGNUM), \
2292 ___BIGASTORE(___hp,-2,___u64_temp), \
2293 ___BIGASTORE(___hp,-1,0), \
2294 ___TAG((___hp-(1+___WORDS(2<<3))),___tSUBTYPED)) \
2295 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2296 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2297 ___BIGASTORE(___hp,-1,___u64_temp), \
2298 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED)))))
2300 #endif
2302 #if ___BIG_ABASE_WIDTH == 32
2304 #if ___SCMOBJ_WIDTH == 32
2306 #define ___BIGFROMFIX(x) \
2307 (___ALLOC(1+___WORDS(1<<2)), \
2308 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2309 ___BIGASTORESIGNED(___hp,-1,___INT(x)), \
2310 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))
2312 #else
2314 #define ___BIGFROMFIX(x) \
2315 (___ALLOC(1+___WORDS(2<<2)), \
2316 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2317 ___BIGASTORE(___hp,-2,___S64_lo32(___INT(x))), \
2318 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___INT(x))), \
2319 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))
2321 #endif
2323 #else
2325 #define ___BIGFROMFIX(x) \
2326 (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2327 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2328 ___BIGASTORESIGNED(___hp,-1,___CAST(___BIGADIGIT,___INT(x))), \
2329 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))
2331 #endif
2333 #define ___BIGALESSP(x,y,i) \
2334 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) \
2335 < (___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(i)>>___TB)))
2337 #define ___BIGAEQP(x,y,i) \
2338 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) \
2339 == (___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(i)>>___TB)))
2341 #define ___BIGAONESP(x,i) \
2342 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) == ___BIG_ABASE_MIN_1)
2344 #define ___BIGAZEROP(x,i) \
2345 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) == 0)
2347 #define ___BIGANEGATIVEP(x,i) \
2348 (___BIGAFETCHSIGNED(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) < 0)
2350 #define ___BIGTOFIX(x) \
2351 (___BIGATEMP=___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),0), \
2352 (___BIGATEMP == ___CAST(___BIGADIGIT,___INT(___FIX(___BIGATEMP))) ? ___FIX(___BIGATEMP) : ___FAL))
2355 #define ___BIGACAT(x,i,hi,j,lo,k,divider) \
2356 ___BIGATEMP=((___BIGADIGIT)___BIGAFETCH(___BODY_AS(hi,___tSUBTYPED),(j)>>___TB) << ___INT(divider)) | \
2357 ((___BIGADIGIT)___BIGAFETCH(___BODY_AS(lo,___tSUBTYPED),(k)>>___TB) >> (___BIG_ABASE_WIDTH - ___INT(divider))); \
2358 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2360 #define ___BIGAAND(x,i,y,j) \
2361 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) & ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2362 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2364 #define ___BIGAIOR(x,i,y,j) \
2365 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) | ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2366 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2368 #define ___BIGAXOR(x,i,y,j) \
2369 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) ^ ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2370 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2372 #define ___BIGANOT(x,i) \
2373 ___BIGATEMP= ~___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB); \
2374 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2378 #define ___BIGNEGATIVEP(x) \
2379 (___BIGAFETCHSIGNED(___BODY_AS(x,___tSUBTYPED),___FIXSUB(___BIGALENGTH(x),___FIX_1)>>___TB) < 0)
2381 #define ___BIGACOPY(result,i,y,j) \
2382 ___BIGASTORE(___BODY_AS(result,___tSUBTYPED),(i)>>___TB, \
2383 ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB));
2385 #define ___BIGAINC(x,i) \
2386 (___BIGATEMP = (___BIGADIGIT)___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB)+(___BIGADIGIT) 1, \
2387 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP), \
2388 (___BIGATEMP == 0 ? ___FIX_1 : ___FIX_0))
2390 #define ___BIGADEC(x,i) \
2391 (___BIGATEMP = (___BIGADIGIT)___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB)-(___BIGADIGIT) 1, \
2392 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP), \
2393 (___BIGATEMP == ___BIG_ABASE_MIN_1 ? ___FIX_1 : ___FIX_0))
2395 #define ___BIGAADD(result,i,y,j,carry) \
2396 (carry ? (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))+ \
2397 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j))+ \
2398 (___BIGADIGIT) 1, \
2399 ((___BIGADIGIT) ___BIGATEMP <= (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2401 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2403 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))) \
2405 (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))+ \
2406 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j)), \
2407 ((___BIGADIGIT) ___BIGATEMP < (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2409 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2411 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))))
2413 #define ___BIGASUB(result,i,y,j,borrow) \
2414 (borrow ? (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))- \
2415 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j))- \
2416 (___BIGADIGIT) 1, \
2417 ((___BIGADIGIT) ___BIGATEMP >= (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2419 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2421 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))) \
2423 (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))- \
2424 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j)), \
2425 ((___BIGADIGIT) ___BIGATEMP > (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2427 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2429 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))))
2431 #if ___BIG_MBASE_WIDTH == 16
2433 #ifdef ___BIG_ENDIAN
2435 #if ___BIG_ABASE_WIDTH == 64
2436 #define ___BIG_END_MFLIP(x)((x)^___FIX(3))
2437 #else
2438 #define ___BIG_END_MFLIP(x)((x)^___FIX(1))
2439 #endif
2440 #else
2441 #define ___BIG_END_MFLIP(x)(x)
2442 #endif
2444 #define ___BIGMLENGTH(v) ___U16VECTORLENGTH(v)
2445 #define ___BIGMFETCH(base,i) ___FETCH_U16(base,i)
2446 #define ___BIGMSTORE(base,i,val) ___STORE_U16(base,i,val)
2447 #define ___BIGMDIGIT ___U16
2448 #define ___BIGMDOUBLEDIGIT ___U32
2450 #else
2452 #ifdef ___BIG_ENDIAN
2453 #define ___BIG_END_MFLIP(x)((x)^___FIX(1))
2454 #else
2455 #define ___BIG_END_MFLIP(x)(x)
2456 #endif
2458 #define ___BIGMLENGTH(v) ___U32VECTORLENGTH(v)
2459 #define ___BIGMFETCH(base,i) ___FETCH_U32(base,i)
2460 #define ___BIGMSTORE(base,i,val) ___STORE_U32(base,i,val)
2461 #define ___BIGMDIGIT ___U32
2462 #define ___BIGMDOUBLEDIGIT ___U64
2464 #endif
2466 #define ___BIG_MBASE ((___BIGMDOUBLEDIGIT)1 << ___BIG_MBASE_WIDTH)
2468 #define ___BIGMREF(x,j) \
2469 ___FIX(___BIGMFETCH(___BODY_AS(x,___tSUBTYPED),___BIG_END_MFLIP(j)>>___TB))
2471 #define ___BIGMSET(result,i,carry) \
2472 ___BIGMSTORE(___BODY_AS(result,___tSUBTYPED),___BIG_END_MFLIP(i)>>___TB,___INT(carry));
2474 #define ___BIGMMUL(result,i,y,j,multiplier,carry) \
2475 (___temp=(___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(result,___tSUBTYPED),___INT(___BIG_END_MFLIP(i))) \
2476 + (___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(y,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) \
2477 * (___BIGMDOUBLEDIGIT)___INT(multiplier) \
2478 + (___BIGMDOUBLEDIGIT)___INT(carry), \
2479 ___BIGMSTORE(___BODY_AS(result,___tSUBTYPED),___INT(___BIG_END_MFLIP(i)),(___BIGMDIGIT)___temp), \
2480 ___FIX((___BIGMDOUBLEDIGIT)___temp >> ___BIG_MBASE_WIDTH))
2482 #define ___BIGMDIV(u,i,v,k,q,borrow) \
2483 (___temp = (___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(i))) \
2484 -(___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(v,___tSUBTYPED),___INT(___BIG_END_MFLIP(k))) \
2485 * (___BIGMDOUBLEDIGIT)___INT(q) \
2486 + (___BIGMDOUBLEDIGIT)___INT(borrow),\
2487 ___BIGMSTORE(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(i)),((___BIGMDIGIT) ___temp)), \
2488 ___temp >>= ___BIG_MBASE_WIDTH, \
2489 (___temp > 0 ? ___FIX(___temp - ___BIG_MBASE) : ___FIX(___temp)))
2492 #define ___BIGMQUO(u,j,v) \
2493 ___FIX((((___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) << ___BIG_MBASE_WIDTH) \
2494 +___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j-___FIX(1)))))/___INT(v))
2497 #define ___BIGMREM(u,j,v,q) \
2498 ___FIX((((___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) << ___BIG_MBASE_WIDTH) \
2499 +___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j-___FIX(1))))) \
2500 -((___BIGMDOUBLEDIGIT)___INT(v)*(___BIGMDOUBLEDIGIT)___INT(q)))
2502 #define ___BIGMTESTP(q,v,r,u) \
2503 (((___BIGMDOUBLEDIGIT)___INT(v)*___INT(q))>((___BIGMDOUBLEDIGIT)___INT(r) << ___BIG_MBASE_WIDTH) +___INT(u))
2508 #ifdef ___BIG_ENDIAN
2510 #if ___BIG_ABASE_WIDTH == 64
2511 #define ___BIG_END_FFLIP(x)((x)^___FIX(7))
2512 #else
2513 #define ___BIG_END_FFLIP(x)((x)^___FIX(3))
2514 #endif
2516 #else
2518 #define ___BIG_END_FFLIP(x)(x)
2520 #endif
2522 #define ___BIGFREF(x,j)___U8VECTORREF(x,___BIG_END_FFLIP(j))
2524 #define ___BIGFSET(result,i,carry)___U8VECTORSET(result,___BIG_END_FFLIP(i),carry)
2526 #define ___BIGFLENGTH(x)___U8VECTORLENGTH(x)
2528 /*---------------------------------------------------------------------------*/
2530 /* Inlinable operations (for 'apply' and 'ifjump' GVM instructions) */
2532 /* APPLY-able operations */
2534 #define ___TYPE(x)___FIX(___TYP(x))
2535 #define ___TYPECAST(x,y)(((x)&~___TMASK)+___INT(y))
2536 #define ___SUBTYPE(x)((*___UNTAG(x)&___SMASK)>>(___HTB-___TB))
2537 #define ___SUBTYPESET(x,y)___temp=(x);___HEADER(___temp)=(___HEADER(___temp)&~___SMASK)+((y)<<(___HTB-___TB));
2539 /* IFJUMP-able operations */
2541 #define ___FALSEP(x)((x)==___FAL)
2542 #define ___BOOLEANP(x)(((x)==___FAL)||((x)==___TRU))
2543 #define ___NULLP(x)((x)==___NUL)
2544 #define ___UNBOUNDP(x)(((___temp=(x))==___UNB1)||(___temp==___UNB2))
2545 #define ___EQP(x,y)((x)==(y))
2546 #define ___EOFP(x)((x)==___EOF)
2548 /* IFJUMP-able operations */
2550 #define ___FIXNUMP(x)___TESTTYPE(x,___tFIXNUM)
2551 #define ___FLONUMP(x)___TESTSUBTYPE(x,___sFLONUM)
2552 #define ___SPECIALP(x)___TESTTYPE(x,___tSPECIAL)
2553 #define ___PAIRP(x)___TESTTYPE(x,___tPAIR)
2554 #define ___PAIRMUTABLEP(obj)(___HD_TYP(*___UNTAG_AS(obj,___tPAIR))!=___PERM)
2555 #define ___SUBTYPEDP(x)___TESTTYPE(x,___tSUBTYPED)
2556 #define ___SUBTYPEDMUTABLEP(obj)(___HD_TYP(*___UNTAG_AS(obj,___tSUBTYPED))!=___PERM)
2557 #define ___SUBTYPEDVECTORP(x)___TESTSUBTYPETAG(x,___sVECTOR)
2558 #define ___SUBTYPEDSYMBOLP(x)___TESTSUBTYPETAG(x,___sSYMBOL)
2559 #define ___SUBTYPEDFLONUMP(x)___TESTSUBTYPETAG(x,___sFLONUM)
2560 #define ___SUBTYPEDBIGNUMP(x)___TESTSUBTYPETAG(x,___sBIGNUM)
2561 #define ___VECTORP(x)___TESTSUBTYPE(x,___sVECTOR)
2562 #define ___RATNUMP(x)___TESTSUBTYPE(x,___sRATNUM)
2563 #define ___CPXNUMP(x)___TESTSUBTYPE(x,___sCPXNUM)
2564 #define ___STRUCTUREP(x)___TESTSUBTYPE(x,___sSTRUCTURE)
2565 #define ___BOXP(x)(___TYP((___temp=x))==___tSUBTYPED&&(___HEADER(___temp)&___LSMASK)==___MAKE_HD((___BOX_SIZE<<___LWS),___sBOXVALUES,0))
2566 #define ___VALUESP(x)(___TYP((___temp=x))==___tSUBTYPED&&___TESTSUBTYPETAG(___temp,___sBOXVALUES)&&(___HEADER(___temp)&___LSMASK)!=___MAKE_HD((___BOX_SIZE<<___LWS),___sBOXVALUES,0))
2567 #define ___MEROONP(x)___TESTSUBTYPE(x,___sMEROON)
2568 #define ___JAZZP(x)___TESTSUBTYPE(x,___sJAZZ)
2569 #define ___SYMBOLP(x)___TESTSUBTYPE(x,___sSYMBOL)
2570 #define ___KEYWORDP(x)___TESTSUBTYPE(x,___sKEYWORD)
2571 #define ___SYMKEYP(x)(___SYMBOLP(x)||___KEYWORDP(x))
2572 #define ___FRAMEP(x)___TESTSUBTYPE(x,___sFRAME)
2573 #define ___CONTINUATIONP(x)___TESTSUBTYPE(x,___sCONTINUATION)
2574 #define ___PROMISEP(x)___TESTSUBTYPE(x,___sPROMISE)
2575 #define ___WILLP(x)___TESTLENGTHSUBTYPE(x,(___WILL_SIZE<<___LWS),___sWEAK)
2576 #define ___GCHASHTABLEP(x)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTHEADERTAG((___temp=___HEADER(___temp)),___sWEAK)&&(___temp&___LSMASK)!=___MAKE_HD((___WILL_SIZE<<___LWS),___sWEAK,0))
2577 #define ___MEMALLOCATEDP(x)___MEM_ALLOCATED(x)
2578 #define ___PROCEDUREP(x)___TESTSUBTYPE(x,___sPROCEDURE)
2579 #define ___RETURNP(x)___TESTSUBTYPE(x,___sRETURN)
2580 #define ___FOREIGNP(x)___TESTSUBTYPE(x,___sFOREIGN)
2581 #define ___STRINGP(x)___TESTSUBTYPE(x,___sSTRING)
2582 #define ___S8VECTORP(x)___TESTSUBTYPE(x,___sS8VECTOR)
2583 #define ___U8VECTORP(x)___TESTSUBTYPE(x,___sU8VECTOR)
2584 #define ___S16VECTORP(x)___TESTSUBTYPE(x,___sS16VECTOR)
2585 #define ___U16VECTORP(x)___TESTSUBTYPE(x,___sU16VECTOR)
2586 #define ___S32VECTORP(x)___TESTSUBTYPE(x,___sS32VECTOR)
2587 #define ___U32VECTORP(x)___TESTSUBTYPE(x,___sU32VECTOR)
2588 #define ___S64VECTORP(x)___TESTSUBTYPE(x,___sS64VECTOR)
2589 #define ___U64VECTORP(x)___TESTSUBTYPE(x,___sU64VECTOR)
2590 #define ___F32VECTORP(x)___TESTSUBTYPE(x,___sF32VECTOR)
2591 #define ___F64VECTORP(x)___TESTSUBTYPE(x,___sF64VECTOR)
2592 #define ___BIGNUMP(x)___TESTSUBTYPE(x,___sBIGNUM)
2593 #define ___CHARP(x)(___TYP((___temp=x))==___tSPECIAL&&___temp>=0)
2594 #define ___NUMBERP(x)___COMPLEXP(x)
2595 #define ___COMPLEXP(x)((___TYP((___temp=(x)))==___tFIXNUM)||(___TYP(___temp)==___tSUBTYPED&&((___temp=(___HEADER(___temp)&___SMASK))==(___sFLONUM<<___HTB)||___temp==(___sBIGNUM<<___HTB)||___temp==(___sRATNUM<<___HTB)||___temp==(___sCPXNUM<<___HTB))))
2597 /* APPLY-able operations */
2599 #define ___FIX_0 ___FIX(0)
2600 #define ___FIXPOS(x)((___WORD)(x))
2601 #define ___FIXMAX(x,y)(((x)<(y))?(y):(x))
2602 #define ___FIXMIN(x,y)(((x)<(y))?(x):(y))
2603 #define ___FIXADD(x,y)((___WORD)((x)+(y)))
2604 #ifndef ___FIXADDP
2605 #define ___FIXADDP(x,y)(___temp=___FIXADD(x,y),___EXPECT_FALSE(((___temp^(x))&(___temp^(y)))<0)?___FAL:___temp)
2606 #endif
2607 #define ___FIX_1 ___FIX(1)
2608 #define ___FIXMUL(x,y)((___WORD)((x)*___INT(y)))
2609 #define ___FIXMULP(x,y)(___EXPECT_FALSE(___FIXQUO((___temp=___FIXMUL(x,y)),y)!=(x))?___FAL:___temp)
2610 #define ___FIXNEG(x)((___WORD)(-(x)))
2611 #define ___FIXNEGP(x)(___EXPECT_FALSE((x)==___FIX(___MIN_FIX))?___FAL:___FIXNEG(x))
2612 #define ___FIXSUB(x,y)((___WORD)((x)-(y)))
2613 #ifndef ___FIXSUBP
2614 #define ___FIXSUBP(x,y)(___temp=___FIXSUB(x,y),___EXPECT_FALSE(((___temp^(x))&((y)^(x)))<0)?___FAL:___temp)
2615 #endif
2616 #define ___FIXQUO(x,y)___FIX(((x)/(y)))
2617 #define ___FIXREM(x,y)((___WORD)((x)%(y)))/****is this ok?*******/
2618 #define ___FIXMOD(x,y)((___temp=___FIXREM((___ps->temp1=x),(___ps->temp2=y)))==0?___FIX(0):((___ps->temp1<0)==(___ps->temp2<0)?___temp:___FIXADD(___temp,___ps->temp2)))
2619 #define ___FIXNOT(x)((___WORD)((x)^~___TMASK))
2620 #define ___FIXAND(x,y)((___WORD)((x)&(y)))
2621 #define ___FIX_M1 ___FIX(-1)
2622 #define ___FIXIOR(x,y)((___WORD)((x)|(y)))
2623 #define ___FIXXOR(x,y)((___WORD)((x)^(y)))
2624 #define ___FIXIF(x,y,z)((___WORD)(((x)&(y))|(~(x)&(z))))
2625 #define ___FIXABS(x)((x)<0?___FIXNEG(x):(x))
2626 #define ___FIXABSP(x)((x)<0?((___EXPECT_FALSE((x)==___FIX(___MIN_FIX))?___FAL:___FIXNEG(x))):(x))
2628 #if ___SCMOBJ_WIDTH == 32
2629 #define ___SCMOBJ_MASK(x,y)y
2630 #define ___BITCOUNT_TEMP() \
2631 (___temp=(___temp&___SCMOBJ_MASK(0x55555555,0x55555555))+ \
2632 ((___temp>>1)&___SCMOBJ_MASK(0x55555555,0x55555555)), \
2633 ___temp=(___temp&___SCMOBJ_MASK(0x33333333,0x33333333))+ \
2634 ((___temp>>2)&___SCMOBJ_MASK(0x33333333,0x33333333)), \
2635 ___temp=(___temp&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))+ \
2636 ((___temp>>4)&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f)), \
2637 ___temp=___temp+(___temp>>8), \
2638 ___temp=___temp+(___temp>>16), \
2639 ___FIX(___temp&0xff))
2640 #define ___FIXLENGTH(x) \
2641 (((___temp=___INT(x))<0)&&(___temp=~___temp), \
2642 ___temp|=(___temp>>1), \
2643 ___temp|=(___temp>>2), \
2644 ___temp|=(___temp>>4), \
2645 ___temp|=(___temp>>8), \
2646 ___temp|=(___temp>>16), \
2647 ___BITCOUNT_TEMP())
2648 #define ___FIXFIRSTBITSET(x) \
2649 (((___temp=(x))==0) \
2650 ?___FIX(-1) \
2651 :(___temp=(___temp&-___temp), \
2652 ___FIX((((___temp&~___SCMOBJ_MASK(0x55555555,0x55555555))!=0)| \
2653 (((___temp&~___SCMOBJ_MASK(0x33333333,0x33333333))!=0)<<1)| \
2654 (((___temp&~___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))!=0)<<2)| \
2655 (((___temp&~___SCMOBJ_MASK(0x00ff00ff,0x00ff00ff))!=0)<<3)| \
2656 (((___temp&~___SCMOBJ_MASK(0x0000ffff,0x0000ffff))!=0)<<4))-___TB)))
2657 #else
2658 #define ___SCMOBJ_MASK(x,y)((___CAST(___SCMOBJ,x)<<32)|y)
2659 #define ___BITCOUNT_TEMP() \
2660 (___temp=((___temp)&___SCMOBJ_MASK(0x55555555,0x55555555))+ \
2661 (((___temp)>>1)&___SCMOBJ_MASK(0x55555555,0x55555555)), \
2662 ___temp=(___temp&___SCMOBJ_MASK(0x33333333,0x33333333))+ \
2663 ((___temp>>2)&___SCMOBJ_MASK(0x33333333,0x33333333)), \
2664 ___temp=(___temp&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))+ \
2665 ((___temp>>4)&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f)), \
2666 ___temp=___temp+(___temp>>8), \
2667 ___temp=___temp+(___temp>>16), \
2668 ___temp=___temp+(___temp>>32), \
2669 ___FIX(___temp&0xff))
2670 #define ___FIXLENGTH(x) \
2671 (((___temp=___INT(x))<0)&&(___temp=~___temp), \
2672 ___temp|=(___temp>>1), \
2673 ___temp|=(___temp>>2), \
2674 ___temp|=(___temp>>4), \
2675 ___temp|=(___temp>>8), \
2676 ___temp|=(___temp>>16), \
2677 ___temp|=(___temp>>32), \
2678 ___BITCOUNT_TEMP())
2679 #define ___FIXFIRSTBITSET(x) \
2680 (((___temp=(x))==0) \
2681 ?___FIX(-1) \
2682 :(___temp=(___temp&-___temp), \
2683 ___FIX((((___temp&~___SCMOBJ_MASK(0x55555555,0x55555555))!=0)| \
2684 (((___temp&~___SCMOBJ_MASK(0x33333333,0x33333333))!=0)<<1)| \
2685 (((___temp&~___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))!=0)<<2)| \
2686 (((___temp&~___SCMOBJ_MASK(0x00ff00ff,0x00ff00ff))!=0)<<3)| \
2687 (((___temp&~___SCMOBJ_MASK(0x0000ffff,0x0000ffff))!=0)<<4)| \
2688 (((___temp&~___SCMOBJ_MASK(0x00000000,0xffffffff))!=0)<<5))-___TB)))
2689 #endif
2690 #define ___FIXBITCOUNT(x) \
2691 ((((___temp=___INT(x))<0)&&(___temp=~___temp)),___BITCOUNT_TEMP())
2692 #define ___FIXBITSETP(x,y)((y)&(___CAST(___SCMOBJ,1)<<(___INT(x)+___TB)))
2694 #define ___FIXASH(x,y)((y)<0?___FIXASHR(x,(y)>=___FIX(-___FIX_WIDTH)?-(y):___FIX(___FIX_WIDTH)):___FIXASHL(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)))
2695 #define ___FIXASHP(x,y)((y)<0?___FIXASHR(x,(y)>=___FIX(-___FIX_WIDTH)?-(y):___FIX(___FIX_WIDTH)):___FIXASHLP2(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)))
2696 #define ___FIXASHL(x,y)((x)<<___INT(y))
2697 #define ___FIXASHLP(x,y)((y)>=___FIX(0)?___FIXASHLP2(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2698 #define ___FIXASHLP2(x,y)((x)==((___temp=___FIXASHL(x,y))>>___INT(y))?___temp:___FAL)
2699 #define ___FIXASHR(x,y)(((x)>>___INT(y))&~___TMASK)
2700 #define ___FIXASHRP(x,y)((y)>=___FIX(0)?___FIXASHR(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2701 #define ___FIXLSHR(x,y)((___WORD)(((unsigned ___WORD)(x)>>___INT(y))&~___TMASK))
2702 #define ___FIXLSHRP(x,y)((y)>=___FIX(0)?___FIXLSHR(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2703 #define ___FIXTOCHR(x)(((x)&~___TMASK)+___tSPECIAL)
2704 #define ___FIXFROMCHR(x)((x)&~___TMASK)
2706 /* IFJUMP-able operations */
2708 #define ___FIXZEROP(x)((x)==0)
2709 #define ___FIXPOSITIVEP(x)((x)>0)
2710 #define ___FIXNEGATIVEP(x)((x)<0)
2711 #define ___FIXODDP(x)((x)&___FIX(1))
2712 #define ___FIXEVENP(x)!((x)&___FIX(1))
2713 #define ___FIXEQ(x,y)((x)==(y))
2714 #define ___FIXLT(x,y)((x)<(y))
2715 #define ___FIXGT(x,y)((x)>(y))
2716 #define ___FIXLE(x,y)((x)<=(y))
2717 #define ___FIXGE(x,y)((x)>=(y))
2719 /* APPLY-able operations */
2721 #define ___F64TOFIX(x)___FIX(x)
2722 #define ___F64FROMFIX(x)___INT(x)
2723 #define ___F64_0 0.0
2724 #define ___F64POS(x)x
2725 #define ___F64MAX(x,y)(___F64NANP(x)?x:(((x)>(y))?(x):(y)))
2726 #define ___F64MIN(x,y)(___F64NANP(x)?x:(((x)<(y))?(x):(y)))
2727 #define ___F64ADD(x,y)((x)+(y))
2728 #define ___F64_1 1.0
2729 #define ___F64MUL(x,y)((x)*(y))
2730 #define ___F64NEG(x)(-(x))
2731 #define ___F64SUB(x,y)((x)-(y))
2732 #define ___F64INV(x)(1.0/(x))
2733 #define ___F64DIV(x,y)((x)/(y))
2734 #define ___F64ABS(x)___CLIBEXT(fabs)(x)
2735 #define ___F64FLOOR(x)___CLIBEXT(floor)(x)
2736 #define ___F64CEILING(x)___CLIBEXT(ceil)(x)
2737 #define ___F64TRUNCATE(x)___EXT(___trunc)(x)
2738 #define ___F64ROUND(x)___EXT(___round)(x)
2739 #define ___F64EXP(x)___CLIBEXT(exp)(x)
2740 #define ___F64LOG(x)___CLIBEXT(log)(x)
2741 #define ___F64SIN(x)___CLIBEXT(sin)(x)
2742 #define ___F64COS(x)___CLIBEXT(cos)(x)
2743 #define ___F64TAN(x)___CLIBEXT(tan)(x)
2744 #define ___F64ASIN(x)___CLIBEXT(asin)(x)
2745 #define ___F64ACOS(x)___CLIBEXT(acos)(x)
2746 #define ___F64ATAN(x)___CLIBEXT(atan)(x)
2747 #ifdef ___GOOD_ATAN2
2748 #define ___F64ATAN2(y,x)___CLIBEXT(atan2)(y,x)
2749 #else
2750 #define ___F64ATAN2(y,x)___EXT(___atan2)(y,x)
2751 #endif
2752 #ifdef ___GOOD_POW
2753 #define ___F64EXPT(x,y)___CLIBEXT(pow)(x,y)
2754 #else
2755 #define ___F64EXPT(x,y)___EXT(___pow)(x,y)
2756 #endif
2757 #define ___F64SQRT(x)___CLIBEXT(sqrt)(x)
2758 #define ___F64COPYSIGN(x,y)___EXT(___copysign)(x,y)
2760 /* IFJUMP-able operations */
2762 #define ___F64INTEGERP(x)(!___F64INFINITEP(x) && (x)==___F64FLOOR(x))
2763 #define ___F64ZEROP(x)((x)==0.0)
2764 #define ___F64POSITIVEP(x)((x)>0.0)
2765 #define ___F64NEGATIVEP(x)((x)<0.0)
2766 #define ___F64ODDP(x)(___F64INTEGERP(x) && (x)!=2.0*___CLIBEXT(floor)((x)*0.5))
2767 #define ___F64EVENP(x)(___F64INTEGERP(x) && (x)==2.0*___CLIBEXT(floor)((x)*0.5))
2768 #define ___F64FINITEP(x)___EXT(___isfinite)(x)
2769 #define ___F64INFINITEP(x)((x)!=0.0 && (x)==2.0*(x))
2770 #ifdef ___USE_ISNAN
2771 #define ___F64NANP(x)___EXT(___isnan)(x)
2772 #else
2773 #define ___F64NANP(x)((x)!=(x))
2774 #endif
2775 #if ___SCMOBJ_WIDTH == 32
2776 #define ___F64FROMFIXEXACTP(x)(1)
2777 #else
2778 #define ___F64FROMFIXEXACTP(x)(___INT(x)==(___WORD)(___F64)___INT(x))
2779 #endif
2780 #define ___F64EQ(x,y)((x)==(y))
2781 #define ___F64LT(x,y)((x)<(y))
2782 #define ___F64GT(x,y)((x)>(y))
2783 #define ___F64LE(x,y)((x)<=(y))
2784 #define ___F64GE(x,y)((x)>=(y))
2786 /* IFJUMP-able operations */
2788 #define ___CHAREQP(x,y)((x)==(y))
2789 #define ___CHARLTP(x,y)((x)<(y))
2790 #define ___CHARGTP(x,y)((x)>(y))
2791 #define ___CHARLEP(x,y)((x)<=(y))
2792 #define ___CHARGEP(x,y)((x)>=(y))
2794 #define ___CHARALPHABETICP(x)___EXT(___iswalpha(___INT(x)))
2795 #define ___CHARNUMERICP(x)___EXT(___iswdigit(___INT(x)))
2796 #define ___CHARWHITESPACEP(x)___EXT(___iswspace(___INT(x)))
2797 #define ___CHARUPPERCASEP(x)___EXT(___iswupper(___INT(x)))
2798 #define ___CHARLOWERCASEP(x)___EXT(___iswlower(___INT(x)))
2799 #define ___CHARUPCASE(x)___CHR(___EXT(___towupper(___INT(x))))
2800 #define ___CHARDOWNCASE(x)___CHR(___EXT(___towlower(___INT(x))))
2802 /* APPLY-able operations */
2804 #define ___PAIR_SIZE 2
2805 #define ___PAIR_CDR_OFS 0
2806 #define ___PAIR_CAR_OFS 1
2808 #define ___PAIR_CAR(obj)(*(___BODY_AS(obj,___tPAIR)+___PAIR_CAR_OFS))
2809 #define ___PAIR_CDR(obj)(*(___BODY_AS(obj,___tPAIR)+___PAIR_CDR_OFS))
2811 #define ___ALLOC_PAIR_EXPR(x,y)(___hp[0]=___MAKE_HD_WORDS(___PAIR_SIZE,___sPAIR), \
2812 ___hp[___PAIR_CAR_OFS+1]=x,___hp[___PAIR_CDR_OFS+1]=y,___ALLOC(___PAIR_SIZE+1))
2813 #define ___ALLOC_PAIR(x,y){___hp[0]=___MAKE_HD_WORDS(___PAIR_SIZE,___sPAIR); \
2814 ___hp[___PAIR_CAR_OFS+1]=x;___hp[___PAIR_CDR_OFS+1]=y;___ALLOC(___PAIR_SIZE+1);}
2815 #define ___CONS(x,y)(___ALLOC_PAIR_EXPR(x,y),___TAG((___hp-___PAIR_SIZE-1),___tPAIR))
2817 #define ___SETCAR(obj,car)___PAIR_CAR(obj)=car;
2818 #define ___SETCDR(obj,cdr)___PAIR_CDR(obj)=cdr;
2819 #define ___CAR(obj)___PAIR_CAR(obj)
2820 #define ___CDR(obj)___PAIR_CDR(obj)
2821 #define ___CAAR(obj)___CAR(___CAR(obj))
2822 #define ___CADR(obj)___CAR(___CDR(obj))
2823 #define ___CDAR(obj)___CDR(___CAR(obj))
2824 #define ___CDDR(obj)___CDR(___CDR(obj))
2825 #define ___CAAAR(obj)___CAR(___CAR(___CAR(obj)))
2826 #define ___CAADR(obj)___CAR(___CAR(___CDR(obj)))
2827 #define ___CADAR(obj)___CAR(___CDR(___CAR(obj)))
2828 #define ___CADDR(obj)___CAR(___CDR(___CDR(obj)))
2829 #define ___CDAAR(obj)___CDR(___CAR(___CAR(obj)))
2830 #define ___CDADR(obj)___CDR(___CAR(___CDR(obj)))
2831 #define ___CDDAR(obj)___CDR(___CDR(___CAR(obj)))
2832 #define ___CDDDR(obj)___CDR(___CDR(___CDR(obj)))
2833 #define ___CAAAAR(obj)___CAR(___CAR(___CAR(___CAR(obj))))
2834 #define ___CAAADR(obj)___CAR(___CAR(___CAR(___CDR(obj))))
2835 #define ___CAADAR(obj)___CAR(___CAR(___CDR(___CAR(obj))))
2836 #define ___CAADDR(obj)___CAR(___CAR(___CDR(___CDR(obj))))
2837 #define ___CADAAR(obj)___CAR(___CDR(___CAR(___CAR(obj))))
2838 #define ___CADADR(obj)___CAR(___CDR(___CAR(___CDR(obj))))
2839 #define ___CADDAR(obj)___CAR(___CDR(___CDR(___CAR(obj))))
2840 #define ___CADDDR(obj)___CAR(___CDR(___CDR(___CDR(obj))))
2841 #define ___CDAAAR(obj)___CDR(___CAR(___CAR(___CAR(obj))))
2842 #define ___CDAADR(obj)___CDR(___CAR(___CAR(___CDR(obj))))
2843 #define ___CDADAR(obj)___CDR(___CAR(___CDR(___CAR(obj))))
2844 #define ___CDADDR(obj)___CDR(___CAR(___CDR(___CDR(obj))))
2845 #define ___CDDAAR(obj)___CDR(___CDR(___CAR(___CAR(obj))))
2846 #define ___CDDADR(obj)___CDR(___CDR(___CAR(___CDR(obj))))
2847 #define ___CDDDAR(obj)___CDR(___CDR(___CDR(___CAR(obj))))
2848 #define ___CDDDDR(obj)___CDR(___CDR(___CDR(___CDR(obj))))
2850 /* APPLY-able operations */
2852 #define ___BOX(x)(___ALLOC(2),___hp[-2]=___MAKE_HD_WORDS(1,___sBOXVALUES), \
2853 ___hp[-1]=x,___TAG((___hp-2),___tSUBTYPED))
2854 #define ___UNBOX(x)___BODY_AS(x,___tSUBTYPED)[0]
2855 #define ___SETBOX(x,y)___BODY_AS(x,___tSUBTYPED)[0]=y;
2857 #define ___VECTORLENGTH(x)___FIX(___HD_FIELDS(___HEADER(x)))
2858 #define ___VECTORREF(x,y)*(___WORD*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(___LWS-___TB)))
2859 #define ___VECTORSET(x,y,z)*(___WORD*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(___LWS-___TB)))=z;
2860 #define ___VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+___LWS));
2862 #define ___STRINGLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>___LCS))
2863 #define ___STRINGREF(x,y)___CHR(___CS_SELECT( \
2864 ___FETCH_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB), \
2865 ___FETCH_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB), \
2866 ___FETCH_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB)))
2867 #define ___STRINGSET(x,y,z)___CS_SELECT( \
2868 ___STORE_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)), \
2869 ___STORE_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)), \
2870 ___STORE_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)));
2871 #define ___STRINGSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+___LCS));
2873 #define ___S8VECTORLENGTH(x)___FIX(___HD_BYTES(___HEADER(x)))
2874 #define ___S8VECTORREF(x,y) \
2875 ___FIX(___FETCH_S8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2876 #define ___S8VECTORSET(x,y,z) \
2877 ___STORE_S8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2878 #define ___S8VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB));
2880 #define ___U8VECTORLENGTH(x)___FIX(___HD_BYTES(___HEADER(x)))
2881 #define ___U8VECTORREF(x,y) \
2882 ___FIX(___FETCH_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2883 #define ___U8VECTORSET(x,y,z) \
2884 ___STORE_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2885 #define ___U8VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB));
2887 #define ___S16VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>1))
2888 #define ___S16VECTORREF(x,y) \
2889 ___FIX(___FETCH_S16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2890 #define ___S16VECTORSET(x,y,z) \
2891 ___STORE_S16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2892 #define ___S16VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+1));
2894 #define ___U16VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>1))
2895 #define ___U16VECTORREF(x,y) \
2896 ___FIX(___FETCH_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2897 #define ___U16VECTORSET(x,y,z) \
2898 ___STORE_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2899 #define ___U16VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+1));
2901 #define ___S32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2902 #define ___S32VECTORREF(x,y) \
2903 ___S32BOX(___FETCH_S32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2904 #define ___S32VECTORSET(x,y,z) \
2905 ___STORE_S32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___S32UNBOX(z));
2906 #define ___S32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2908 #define ___U32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2909 #define ___U32VECTORREF(x,y) \
2910 ___U32BOX(___FETCH_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2911 #define ___U32VECTORSET(x,y,z) \
2912 ___STORE_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___U32UNBOX(z));
2913 #define ___U32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2915 #define ___S64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2916 #define ___S64VECTORREF(x,y) \
2917 ___S64BOX(___FETCH_S64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2918 #define ___S64VECTORSET(x,y,z) \
2919 ___STORE_S64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___S64UNBOX(z));
2920 #define ___S64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2922 #define ___U64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2923 #define ___U64VECTORREF(x,y) \
2924 ___U64BOX(___FETCH_U64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2925 #define ___U64VECTORSET(x,y,z) \
2926 ___STORE_U64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___U64UNBOX(z));
2927 #define ___U64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2929 #define ___F32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2930 #ifdef ___F32
2931 #define ___F32VECTORREF(x,y)*(___F32*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(2-___TB)))
2932 #define ___F32VECTORSET(x,y,z)*(___F32*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(2-___TB)))=z;
2933 #else
2934 #define ___F32VECTORREF(x,y)0.0
2935 #define ___F32VECTORSET(x,y,z);
2936 #endif
2937 #define ___F32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2939 #define ___F64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2940 #define ___F64VECTORREF(x,y)*(___F64*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(3-___TB)))
2941 #define ___F64VECTORSET(x,y,z)*(___F64*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(3-___TB)))=z;
2942 #define ___F64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2944 #define ___TYPEID(x)___VECTORREF(x,___FIX(1))
2945 #define ___TYPENAME(x)___VECTORREF(x,___FIX(2))
2946 #define ___TYPEFLAGS(x)___VECTORREF(x,___FIX(3))
2947 #define ___TYPESUPER(x)___VECTORREF(x,___FIX(4))
2948 #define ___TYPEFIELDS(x)___VECTORREF(x,___FIX(5))
2950 #define ___STRUCTURETYPE(x)___VECTORREF(x,___FIX(0))
2951 #define ___STRUCTURETYPESET(x,y)___VECTORSET(x,___FIX(0),y)
2952 #define ___STRUCTUREDIOP(x,typeid)(___TESTSUBTYPE(x,___sSTRUCTURE)&&___TYPEID(___STRUCTURETYPE(___temp))==(typeid))
2953 #define ___UNCHECKEDSTRUCTUREREF(x,y,type,proc)___VECTORREF(x,y)
2954 #define ___UNCHECKEDSTRUCTURESET(x,y,z,type,proc)___VECTORSET(x,z,y)
2956 #define ___CLOSURELENGTH(x)___FIX(___HD_FIELDS(___HEADER(x)))
2957 #define ___CLOSURECODE(x)___CLO(x,0)
2958 #define ___CLOSUREREF(x,y)___CLO(x,___INT(y))
2959 #define ___CLOSURESET(x,y,z)___SET_CLO(x,___INT(y),z)
2961 #define ___GLOBALVARREF(gv)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->val
2962 #define ___GLOBALVARPRIMREF(gv)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->prm
2963 #define ___GLOBALVARSET(gv,x)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->val = x;
2964 #define ___GLOBALVARPRIMSET(gv,x)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->prm = x;
2966 #define ___MAKEPROMISE(x) \
2967 (___ALLOC(___PROMISE_SIZE+1), \
2968 ___hp[-3]=___MAKE_HD_WORDS(___PROMISE_SIZE,___sPROMISE), \
2969 ___hp[-2]=x, ___hp[-1]=___TAG((___hp-___PROMISE_SIZE-1),___tSUBTYPED))
2971 #define ___MAKEWILL(testator,action) \
2972 (___hp[0]=___MAKE_HD_WORDS(___WILL_SIZE,___sWEAK), \
2973 ___hp[1]=___ps->nonexecutable_wills, \
2974 ___hp[2]=testator, \
2975 ___hp[3]=action, \
2976 ___ps->nonexecutable_wills=___TAG(___hp,0), \
2977 ___ALLOC(___WILL_SIZE+1), \
2978 ___TAG((___hp-___WILL_SIZE-1),___tSUBTYPED))
2979 #define ___WILLTESTATOR(x)___BODY_AS(x,___tSUBTYPED)[1]
2981 #define ___EXECUTABLE_WILL 1
2982 #define ___UNMARKED_TESTATOR_WILL 2
2984 #define ___GCHASHTABLEREF(x,y)___EXT(___gc_hash_table_ref)(x,y)
2985 #define ___GCHASHTABLESET(x,y,z)___EXT(___gc_hash_table_set)(x,y,z)
2986 #define ___GCHASHTABLEREHASH(x,y)___EXT(___gc_hash_table_rehash)(x,y)
2988 #define ___GCHASHTABLE_HASH1(obj,mod) ((((obj)>>___TB)&___MAX_FIX)%(mod))
2989 #define ___GCHASHTABLE_HASH2(obj,mod) (((((obj)>>___TB)&___MAX_FIX)%((mod)-1))+1)
2991 #define ___GCHASHTABLE_FLAG_WEAK_KEYS 1
2992 #define ___GCHASHTABLE_FLAG_WEAK_VALS 2
2993 #define ___GCHASHTABLE_FLAG_KEY_MOVED 4
2994 #define ___GCHASHTABLE_FLAG_ENTRY_DELETED 8
2995 #define ___GCHASHTABLE_FLAG_MEM_ALLOC_KEYS 16
2996 #define ___GCHASHTABLE_FLAG_NEED_REHASH 32
2998 #define ___GCHASHTABLE_NEXT 0
2999 #define ___GCHASHTABLE_FLAGS 1
3000 #define ___GCHASHTABLE_COUNT 2
3001 #define ___GCHASHTABLE_MIN_COUNT 3
3002 #define ___GCHASHTABLE_FREE 4
3003 #define ___GCHASHTABLE_KEY0 5
3004 #define ___GCHASHTABLE_VAL0 6
3006 #define ___CURRENTTHREAD ___ps->current_thread
3007 #define ___RUNQUEUE ___ps->run_queue
3009 #define ___THREAD_SAVE \
3010 if (___R0 == ___GSTATE->handler_break) \
3011 frame = ___STK(-___BREAK_FRAME_NEXT); \
3012 else \
3014 ___SET_STK(-___FRAME_STACK_RA,___R0) \
3015 ___R0 = ___GSTATE->handler_break; \
3016 frame = ___CAST(___SCMOBJ,___fp); \
3017 ___ADJFP(___BREAK_FRAME_SPACE) \
3018 ___SET_STK(-___BREAK_FRAME_NEXT,frame) \
3019 ___ps->stack_break = ___fp; \
3021 thread = ___ps->current_thread; \
3022 ___FIELD(___FIELD(thread,___THREAD_CONT),___CONTINUATION_FRAME) = frame;
3024 #define ___JUMP_THREAD_SAVE1(jump) \
3025 { ___SCMOBJ proc; \
3026 ___SCMOBJ thread; \
3027 ___SCMOBJ frame; \
3028 ___POP_ARGS1(proc) \
3029 ___THREAD_SAVE \
3030 ___PUSH_ARGS1(thread) \
3031 jump(___SET_NARGS(1),proc) \
3034 #define ___JUMP_THREAD_SAVE2(jump) \
3035 { ___SCMOBJ proc; \
3036 ___SCMOBJ arg1; \
3037 ___SCMOBJ thread; \
3038 ___SCMOBJ frame; \
3039 ___POP_ARGS2(proc,arg1) \
3040 ___THREAD_SAVE \
3041 ___PUSH_ARGS2(thread,arg1) \
3042 jump(___SET_NARGS(2),proc) \
3045 #define ___JUMP_THREAD_SAVE3(jump) \
3046 { ___SCMOBJ proc; \
3047 ___SCMOBJ arg1; \
3048 ___SCMOBJ arg2; \
3049 ___SCMOBJ thread; \
3050 ___SCMOBJ frame; \
3051 ___POP_ARGS3(proc,arg1,arg2) \
3052 ___THREAD_SAVE \
3053 ___PUSH_ARGS3(thread,arg1,arg2) \
3054 jump(___SET_NARGS(3),proc) \
3057 #define ___JUMP_THREAD_SAVE4(jump) \
3058 { ___SCMOBJ proc; \
3059 ___SCMOBJ arg1; \
3060 ___SCMOBJ arg2; \
3061 ___SCMOBJ arg3; \
3062 ___SCMOBJ thread; \
3063 ___SCMOBJ frame; \
3064 ___POP_ARGS4(proc,arg1,arg2,arg3) \
3065 ___THREAD_SAVE \
3066 ___PUSH_ARGS4(thread,arg1,arg2,arg3) \
3067 jump(___SET_NARGS(4),proc) \
3070 #define ___THREAD_RESTORE \
3071 { ___SCMOBJ cont = ___FIELD(thread,___THREAD_CONT); \
3072 ___fp = ___ps->stack_break; \
3073 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3074 ___FIELD(cont,___CONTINUATION_FRAME) = ___FIX(0); \
3075 ___ps->current_thread = thread; \
3076 ___SET_R0(___GSTATE->handler_break) \
3079 #define ___JUMP_THREAD_RESTORE2(jump) \
3080 { ___SCMOBJ thread; \
3081 ___SCMOBJ proc; \
3082 ___POP_ARGS2(thread,proc) \
3083 ___THREAD_RESTORE \
3084 jump(___SET_NARGS(0),proc) \
3087 #define ___JUMP_THREAD_RESTORE3(jump) \
3088 { ___SCMOBJ thread; \
3089 ___SCMOBJ proc; \
3090 ___SCMOBJ arg1; \
3091 ___POP_ARGS3(thread,proc,arg1) \
3092 ___THREAD_RESTORE \
3093 ___PUSH_ARGS1(arg1) \
3094 jump(___SET_NARGS(1),proc) \
3097 #define ___JUMP_THREAD_RESTORE4(jump) \
3098 { ___SCMOBJ thread; \
3099 ___SCMOBJ proc; \
3100 ___SCMOBJ arg1; \
3101 ___SCMOBJ arg2; \
3102 ___POP_ARGS4(thread,proc,arg1,arg2) \
3103 ___THREAD_RESTORE \
3104 ___PUSH_ARGS2(arg1,arg2) \
3105 jump(___SET_NARGS(2),proc) \
3108 #define ___JUMP_THREAD_RESTORE5(jump) \
3109 { ___SCMOBJ thread; \
3110 ___SCMOBJ proc; \
3111 ___SCMOBJ arg1; \
3112 ___SCMOBJ arg2; \
3113 ___SCMOBJ arg3; \
3114 ___POP_ARGS5(thread,proc,arg1,arg2,arg3) \
3115 ___THREAD_RESTORE \
3116 ___PUSH_ARGS3(arg1,arg2,arg3) \
3117 jump(___SET_NARGS(3),proc) \
3120 #define ___FRAME_OVERHEAD(n) (___FRAME_SPACE(n)-(n))
3121 #define ___RETI_RA (-___FRAME_OVERHEAD(___NB_GVM_REGS+1))
3122 #define ___FRAME_RETI_RA (1-___FRAME_RESERVE-___RETI_RA)
3124 #define ___SYMKEY_NAME 0
3125 #define ___SYMKEY_HASH 1
3126 #define ___SYMKEY_NEXT 2
3127 #define ___SYMBOL_GLOBAL 3
3128 #define ___PROMISE_THUNK 0
3129 #define ___PROMISE_RESULT 1
3130 #define ___CONTINUATION_FRAME 0
3131 #define ___CONTINUATION_DENV 1
3132 #define ___THREAD_CONT 19
3133 #define ___THREAD_DENV 20
3134 #define ___THREAD_DENV_CACHE1 21
3135 #define ___THREAD_DENV_CACHE2 22
3136 #define ___THREAD_DENV_CACHE3 23
3137 #define ___ENV_NAME_VAL 0
3138 #define ___ENV_LEFT 1
3139 #define ___ENV_RIGHT 2
3140 #define ___DENV_LOCAL 0
3141 #define ___DENV_DYNWIND 1
3142 #define ___DENV_INTERRUPT_MASK 2
3143 #define ___DENV_DEBUGGING_SETTINGS 3
3144 #define ___DENV_EXCEPTION_HANDLER 4
3145 #define ___DENV_INPUT_PORT 5
3146 #define ___DENV_OUTPUT_PORT 6
3148 #define ___FRAME_EXTRA_SLOTS 1
3149 #define ___FRAME_STACK_RA 0
3150 #define ___FRAME_RA 0
3152 #define ___FRAME_STORE_RA(ra) \
3153 if (___fp != ___ps->stack_break) \
3154 ___SET_STK(-___FRAME_STACK_RA,ra)
3156 #define ___FRAME_FETCH_RA \
3157 ((___fp != ___ps->stack_break) \
3158 ? ___STK(-___FRAME_STACK_RA) \
3159 : ___GSTATE->handler_break)
3161 #define ___CONTINUATION_CAPTURE \
3162 if (___R0 == ___GSTATE->handler_break) \
3163 frame = ___STK(-___BREAK_FRAME_NEXT); \
3164 else \
3166 ___SET_STK(-___FRAME_STACK_RA,___R0) \
3167 ___R0 = ___GSTATE->handler_break; \
3168 frame = ___CAST(___SCMOBJ,___fp); \
3170 ___ADJFP(___ROUND_TO_MULT(___SUBTYPED_OVERHEAD+___CONTINUATION_SIZE,___FRAME_ALIGN)) \
3171 ___SET_STK(0,___MAKE_HD_WORDS(___CONTINUATION_SIZE,___sCONTINUATION)) \
3172 ___SET_STK(-1,frame) \
3173 ___SET_STK(-2,___FIELD(___ps->current_thread,___THREAD_DENV)) \
3174 cont = ___TAG(&___STK(0),___tSUBTYPED); \
3175 ___ADJFP(___BREAK_FRAME_SPACE) \
3176 ___SET_STK(-___BREAK_FRAME_NEXT,frame) \
3177 ___ps->stack_break = ___fp;
3179 #define ___JUMP_CONTINUATION_CAPTURE1(jump) \
3180 { ___SCMOBJ proc; \
3181 ___SCMOBJ frame; \
3182 ___SCMOBJ cont; \
3183 ___POP_ARGS1(proc) \
3184 ___CONTINUATION_CAPTURE \
3185 ___PUSH_ARGS1(cont); \
3186 jump(___SET_NARGS(1),proc) \
3189 #define ___JUMP_CONTINUATION_CAPTURE2(jump) \
3190 { ___SCMOBJ proc; \
3191 ___SCMOBJ arg1; \
3192 ___SCMOBJ frame; \
3193 ___SCMOBJ cont; \
3194 ___POP_ARGS2(proc,arg1) \
3195 ___CONTINUATION_CAPTURE \
3196 ___PUSH_ARGS2(cont,arg1); \
3197 jump(___SET_NARGS(2),proc) \
3200 #define ___JUMP_CONTINUATION_CAPTURE3(jump) \
3201 { ___SCMOBJ proc; \
3202 ___SCMOBJ arg1; \
3203 ___SCMOBJ arg2; \
3204 ___SCMOBJ frame; \
3205 ___SCMOBJ cont; \
3206 ___POP_ARGS3(proc,arg1,arg2) \
3207 ___CONTINUATION_CAPTURE \
3208 ___PUSH_ARGS3(cont,arg1,arg2); \
3209 jump(___SET_NARGS(3),proc) \
3212 #define ___JUMP_CONTINUATION_CAPTURE4(jump) \
3213 { ___SCMOBJ proc; \
3214 ___SCMOBJ arg1; \
3215 ___SCMOBJ arg2; \
3216 ___SCMOBJ arg3; \
3217 ___SCMOBJ frame; \
3218 ___SCMOBJ cont; \
3219 ___POP_ARGS4(proc,arg1,arg2,arg3) \
3220 ___CONTINUATION_CAPTURE \
3221 ___PUSH_ARGS4(cont,arg1,arg2,arg3); \
3222 jump(___SET_NARGS(4),proc) \
3225 #define ___CONTINUATION_GRAFT_NO_WINDING \
3226 ___fp = ___ps->stack_break; \
3227 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3228 temp = ___FIELD(cont,___CONTINUATION_DENV); \
3229 thread = ___ps->current_thread; \
3230 ___FIELD(thread,___THREAD_DENV) = temp; \
3231 temp = ___FIELD(___FIELD(temp,___DENV_LOCAL),___ENV_NAME_VAL); \
3232 ___FIELD(thread,___THREAD_DENV_CACHE1) = temp; \
3233 ___FIELD(thread,___THREAD_DENV_CACHE2) = temp; \
3234 ___FIELD(thread,___THREAD_DENV_CACHE3) = temp; \
3235 ___SET_R0(___GSTATE->handler_break)
3237 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING2(jump) \
3238 { ___SCMOBJ cont; \
3239 ___SCMOBJ proc; \
3240 ___SCMOBJ temp; \
3241 ___SCMOBJ thread; \
3242 ___POP_ARGS2(cont,proc) \
3243 ___CONTINUATION_GRAFT_NO_WINDING \
3244 jump(___SET_NARGS(0),proc) \
3247 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING3(jump) \
3248 { ___SCMOBJ cont; \
3249 ___SCMOBJ proc; \
3250 ___SCMOBJ arg1; \
3251 ___SCMOBJ temp; \
3252 ___SCMOBJ thread; \
3253 ___POP_ARGS3(cont,proc,arg1) \
3254 ___CONTINUATION_GRAFT_NO_WINDING \
3255 ___PUSH_ARGS1(arg1) \
3256 jump(___SET_NARGS(1),proc) \
3259 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING4(jump) \
3260 { ___SCMOBJ cont; \
3261 ___SCMOBJ proc; \
3262 ___SCMOBJ arg1; \
3263 ___SCMOBJ arg2; \
3264 ___SCMOBJ temp; \
3265 ___SCMOBJ thread; \
3266 ___POP_ARGS4(cont,proc,arg1,arg2) \
3267 ___CONTINUATION_GRAFT_NO_WINDING \
3268 ___PUSH_ARGS2(arg1,arg2) \
3269 jump(___SET_NARGS(2),proc) \
3272 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING5(jump) \
3273 { ___SCMOBJ cont; \
3274 ___SCMOBJ proc; \
3275 ___SCMOBJ arg1; \
3276 ___SCMOBJ arg2; \
3277 ___SCMOBJ arg3; \
3278 ___SCMOBJ temp; \
3279 ___SCMOBJ thread; \
3280 ___POP_ARGS5(cont,proc,arg1,arg2,arg3) \
3281 ___CONTINUATION_GRAFT_NO_WINDING \
3282 ___PUSH_ARGS3(arg1,arg2,arg3) \
3283 jump(___SET_NARGS(3),proc) \
3286 #define ___JUMP_CONTINUATION_RETURN_NO_WINDING2(jump) \
3287 { ___SCMOBJ cont; \
3288 ___SCMOBJ result; \
3289 ___SCMOBJ temp; \
3290 ___SCMOBJ thread; \
3291 ___POP_ARGS2(cont,result) \
3292 ___SET_R1(result) \
3293 ___fp = ___ps->stack_break; \
3294 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3295 temp = ___FIELD(cont,___CONTINUATION_DENV); \
3296 thread = ___ps->current_thread; \
3297 ___FIELD(thread,___THREAD_DENV) = temp; \
3298 temp = ___FIELD(___FIELD(temp,___DENV_LOCAL),___ENV_NAME_VAL); \
3299 ___FIELD(thread,___THREAD_DENV_CACHE1) = temp; \
3300 ___FIELD(thread,___THREAD_DENV_CACHE2) = temp; \
3301 ___FIELD(thread,___THREAD_DENV_CACHE3) = temp; \
3302 ___JUMPPRM(___NOTHING,___GSTATE->handler_break) \
3305 /*---------------------------------------------------------------------------*/
3307 /* Stack manipulation */
3309 #define ___FP_AFTER(fp1,fp2)((fp1) < (fp2))
3310 #define ___FP_PUSH(fp,val)*--fp=(val);
3311 #define ___FP_POP(fp)*fp++
3312 #define ___FP_STK(fp,fpo)fp[-(fpo)]
3313 #define ___FP_SET_STK(fp,fpo,val)fp[-(fpo)]=(val);
3314 #define ___FP_ADJFP(fp,fpa)fp-=(fpa);
3316 #define ___PUSH(val)___FP_PUSH(___fp,val)
3317 #define ___POP ___FP_POP(___fp)
3318 #define ___STK(fpo)___FP_STK(___fp,fpo)
3319 #define ___SET_STK(fpo,val)___FP_SET_STK(___fp,fpo,val)
3320 #define ___ADJFP(fpa)___FP_ADJFP(___fp,fpa)
3321 #define ___PSSTK(fpo)___FP_STK(___PSFP,fpo)
3322 #define ___PSADJFP(fpa)___FP_ADJFP(___PSFP,fpa)
3324 #define ___PRM(i,glo)___GLOSTRUCT(i,glo).prm
3325 #define ___GLO(i,glo)___GLOSTRUCT(i,glo).val
3326 #define ___SET_GLO(i,glo,x)___GLOSTRUCT(i,glo).val=x;
3327 #ifdef ___BIND_LATE
3328 #define ___GLOSTRUCT(i,glo)(*(___glo_struct*)___glo_tbl[i])
3329 #else
3330 #define ___GLOSTRUCT(i,glo)glo
3331 #endif
3333 #define ___HOST_PROC ___SM(___MH_PROC,___PH_PROC)
3334 #define ___HOST_LBL0 ___SM(1,___PH_LBL0)
3336 #define ___BEGIN_M_COD ___SM(___BEGIN_COD,___NOTHING)
3337 #define ___END_M_COD ___SM(___END_COD,___NOTHING)
3339 #define ___BEGIN_M_HLBL ___SM(___BEGIN_HLBL,___NOTHING)
3340 #define ___DEF_M_HLBL_INTRO ___SM(___DEF_HLBL_INTRO,___NOTHING)
3341 #define ___DEF_M_HLBL(id)___SM(___DEF_HLBL(id),___NOTHING)
3342 #define ___END_M_HLBL ___SM(___END_HLBL,___NOTHING)
3344 #define ___BEGIN_M_SW ___SM(___BEGIN_SW,___NOTHING)
3345 #define ___END_M_SW ___SM(___END_SW,___NOTHING)
3347 #define ___BEGIN_P_COD ___SM(___NOTHING,___BEGIN_COD)
3348 #define ___END_P_COD ___SM(___NOTHING,___END_COD)
3350 #define ___BEGIN_P_HLBL ___SM(___NOTHING,___BEGIN_HLBL)
3351 #define ___DEF_P_HLBL_INTRO ___SM(___NOTHING,___DEF_HLBL_INTRO)
3352 #define ___DEF_P_HLBL(id)___SM(___NOTHING,___DEF_HLBL(id))
3353 #define ___END_P_HLBL ___SM(___NOTHING,___END_HLBL)
3355 #define ___BEGIN_P_SW ___SM(___NOTHING,___BEGIN_SW)
3356 #define ___END_P_SW ___SM(___NOTHING,___END_SW)
3358 #define ___D_ALL ___SM(___MD_ALL,___PD_ALL)
3359 #define ___R_ALL ___SM(___MR_ALL,___PR_ALL)
3360 #define ___W_ALL ___SM(___MW_ALL,___PW_ALL)
3362 #define ___BEGIN_COD \
3363 ___HIDDEN ___WORD ___HOST_PROC ___P((___processor_state ___ps),(___ps) \
3364 ___processor_state ___ps;){ \
3365 register ___WORD ___pc, ___start, ___temp; \
3366 register ___S32 ___s32_temp; /*******************/ \
3367 register ___U32 ___u32_temp; /*******************/ \
3368 register ___S64 ___s64_temp; /*******************/ \
3369 register ___U64 ___u64_temp; /*******************/ \
3370 ___D_ALL
3372 #define ___END_COD \
3373 ___ps->pc=___pc; ___W_ALL return ___pc; }
3375 #ifdef ___DEBUG_HOST_CHANGES
3376 #define ___REGISTER_HOST_ENTRY \
3377 ___EXT(___register_host_entry) (___start, ___MODULE_NAME);
3378 #else
3379 #define ___REGISTER_HOST_ENTRY
3380 #endif
3382 #ifdef ___USE_LABEL_VALUES
3384 #define ___SETUP_HOST_LABEL 1
3386 #define ___BEGIN_HLBL static void *___hlbl_tbl[]={
3387 #define ___DEF_HLBL_INTRO 0,
3388 #define ___DEF_HLBL(id)&&id,
3389 #define ___END_HLBL \
3390 0}; if (___EXPECT_FALSE(___ps == 0)) return ___CAST(___WORD,___hlbl_tbl);
3392 #define ___BEGIN_SW \
3393 ___R_ALL ___start=___MLBL(___HOST_LBL0); ___pc=___ps->pc; \
3394 ___REGISTER_HOST_ENTRY \
3395 goto *___LABEL_HOST_LABEL(___pc);
3397 #define ___DEF_SW(n)
3399 #ifdef ___USE_INLINE_JUMPS
3401 #define ___END_SW \
3402 ___jumpext:
3404 #define ___JUMP(dest) \
3405 {___pc=dest; \
3406 if (___EXPECT_TRUE(___LABEL_HOST(___pc) == ___HOST_PROC)) \
3407 goto *___LABEL_HOST_LABEL(___pc); \
3408 goto ___jumpext;}
3410 #else
3412 #define ___END_SW \
3413 ___jump: \
3414 if (___EXPECT_TRUE(___LABEL_HOST(___pc) == ___HOST_PROC)) \
3415 goto *___LABEL_HOST_LABEL(___pc); \
3416 ___jumpext:
3418 #define ___JUMP(dest){___pc=dest;goto ___jump;}
3420 #endif
3422 #define ___JUMPEXT(dest){___pc=dest;goto ___jumpext;}
3424 #else
3426 #define ___SETUP_HOST_LABEL 0
3428 #define ___BEGIN_HLBL
3429 #define ___DEF_HLBL_INTRO
3430 #define ___DEF_HLBL(id)
3431 #define ___END_HLBL
3433 #define ___BEGIN_SW \
3434 ___R_ALL ___start=___MLBL(___HOST_LBL0); ___pc=___ps->pc; \
3435 ___REGISTER_HOST_ENTRY \
3436 ___jump: \
3437 switch((___pc-=___start)/(___LS*___WS)) \
3440 #define ___DEF_SW(n)case ___PH_LBL0-___HOST_LBL0+n:
3442 #define ___END_SW \
3443 }___pc+=___start;___jumpext:
3445 #define ___JUMP(dest){___pc=dest;goto ___jump;}
3446 #define ___JUMPEXT(dest){___pc=dest;goto ___jumpext;}
3448 #endif
3450 #define ___BEGIN_P_SLBL ___SM(___NOTHING,___BEGIN_SLBL)
3451 #define ___DEF_P_SLBL(id)
3452 #define ___END_P_SLBL ___SM(___NOTHING,___END_SLBL)
3454 #define ___LS 4
3456 #define ___PSHEAP ___ps->hp
3457 #define ___D_HEAP register ___WORD *___hp;
3458 #define ___R_HEAP ___hp=___PSHEAP;
3459 #define ___W_HEAP ___PSHEAP=___hp;
3461 #define ___PSFP ___ps->fp
3462 #define ___D_FP register ___WORD *___fp;
3463 #define ___R_FP ___fp=___PSFP;
3464 #define ___W_FP ___PSFP=___fp;
3466 /*---------------------------------------------------------------------------*/
3468 /* GVM registers */
3470 #ifndef ___MAX_LOCAL_GVM_REGS
3471 #define ___MAX_LOCAL_GVM_REGS 25
3472 #endif
3474 #if ___NB_ARG_REGS == 0
3475 #define ___PUSH_ARGS1(a)___PUSH(a)
3476 #define ___POP_ARGS1(a)a = ___POP;
3477 #define ___PUSH_ARGS2(a,b)___PUSH(a)___PUSH(b)
3478 #define ___POP_ARGS2(a,b)b = ___POP; a = ___POP;
3479 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___PUSH(b)___PUSH(c)
3480 #define ___POP_ARGS3(a,b,c)c = ___POP; b = ___POP; a = ___POP;
3481 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)
3482 #define ___POP_ARGS4(a,b,c,d)d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3483 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)___PUSH(e)
3484 #define ___POP_ARGS5(a,b,c,d,e)e = ___POP; d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3485 #else
3486 #define ___PUSH_ARGS1(a)___SET_R1(a)
3487 #define ___POP_ARGS1(a)a = ___R1;
3488 #if ___NB_ARG_REGS == 1
3489 #define ___PUSH_ARGS2(a,b)___PUSH(a)___SET_R1(b)
3490 #define ___POP_ARGS2(a,b)b = ___R1; a = ___POP;
3491 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___PUSH(b)___SET_R1(c)
3492 #define ___POP_ARGS3(a,b,c)c = ___R1; b = ___POP; a = ___POP;
3493 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___PUSH(c)___SET_R1(d)
3494 #define ___POP_ARGS4(a,b,c,d)d = ___R1; c = ___POP; b = ___POP; a = ___POP;
3495 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)___SET_R1(e)
3496 #define ___POP_ARGS5(a,b,c,d,e)e = ___R1; d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3497 #else
3498 #define ___PUSH_ARGS2(a,b)___SET_R1(a)___SET_R2(b)
3499 #define ___POP_ARGS2(a,b)b = ___R2; a = ___R1;
3500 #if ___NB_ARG_REGS == 2
3501 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___SET_R1(b)___SET_R2(c)
3502 #define ___POP_ARGS3(a,b,c)c = ___R2; b = ___R1; a = ___POP;
3503 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___SET_R1(c)___SET_R2(d)
3504 #define ___POP_ARGS4(a,b,c,d)d = ___R2; c = ___R1; b = ___POP; a = ___POP;
3505 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___SET_R1(d)___SET_R2(e)
3506 #define ___POP_ARGS5(a,b,c,d,e)e = ___R2; d = ___R1; c = ___POP; b = ___POP; a = ___POP;
3507 #else
3508 #define ___PUSH_ARGS3(a,b,c)___SET_R1(a)___SET_R2(b)___SET_R3(c)
3509 #define ___POP_ARGS3(a,b,c)c = ___R3; b = ___R2; a = ___R1;
3510 #if ___NB_ARG_REGS == 3
3511 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___SET_R1(b)___SET_R2(c)___SET_R3(d)
3512 #define ___POP_ARGS4(a,b,c,d)d = ___R3; c = ___R2; b = ___R1; a = ___POP;
3513 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___SET_R1(c)___SET_R2(d)___SET_R3(e)
3514 #define ___POP_ARGS5(a,b,c,d,e)e = ___R3; d = ___R2; c = ___R1; b = ___POP; a = ___POP;
3515 #else
3516 #define ___PUSH_ARGS4(a,b,c,d)___SET_R1(a)___SET_R2(b)___SET_R3(c)___SET_R4(d)
3517 #define ___POP_ARGS4(a,b,c,d)d = ___R4; c = ___R3; b = ___R2; a = ___R1;
3518 #if ___NB_ARG_REGS == 4
3519 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___SET_R1(b)___SET_R2(c)___SET_R3(d)___SET_R4(e)
3520 #define ___POP_ARGS5(a,b,c,d,e)e = ___R4; d = ___R3; c = ___R2; b = ___R1; a = ___POP;
3521 #else
3522 #define ___PUSH_ARGS5(a,b,c,d,e)___SET_R1(a)___SET_R2(b)___SET_R3(c)___SET_R4(d)___SET_R5(e)
3523 #define ___POP_ARGS5(a,b,c,d,e)e = ___R5; d = ___R4; c = ___R3; b = ___R2; a = ___R1;
3524 #endif
3525 #endif
3526 #endif
3527 #endif
3528 #endif
3530 #define ___PSR0 ___ps->r[0]
3531 #if ___MAX_LOCAL_GVM_REGS > 0
3532 #define ___D_R0 register ___WORD ___r0;
3533 #define ___R_R0 ___r0=___PSR0;
3534 #define ___W_R0 ___PSR0=___r0;
3535 #define ___R0 ___r0
3536 #else
3537 #define ___D_R0
3538 #define ___R_R0
3539 #define ___W_R0
3540 #define ___R0 ___PSR0
3541 #endif
3542 #define ___SET_R0(val)___R0=val;
3543 #define ___PUSH_R0 ___PUSH(___R0)
3544 #define ___POP_R0 ___SET_R0(___POP)
3546 #if ___NB_ARG_REGS == 0
3547 #define ___PUSH_ARGS_IN_REGS(na)
3548 #define ___POP_ARGS_IN_REGS(na)
3549 #define ___PSSELF ___PSR1
3550 #define ___SELF ___R1
3551 #define ___LD_ARG_REGS
3552 #define ___ST_ARG_REGS
3553 #endif
3555 #define ___PSR1 ___ps->r[1]
3556 #if ___MAX_LOCAL_GVM_REGS > 1
3557 #define ___D_R1 register ___WORD ___r1;
3558 #define ___R_R1 ___r1=___PSR1;
3559 #define ___W_R1 ___PSR1=___r1;
3560 #define ___R1 ___r1
3561 #else
3562 #define ___D_R1
3563 #define ___R_R1
3564 #define ___W_R1
3565 #define ___R1 ___PSR1
3566 #endif
3567 #define ___SET_R1(val)___R1=(val);
3568 #define ___PUSH_R1_TO_R1 ___PUSH(___R1)
3569 #define ___POP_R1_TO_R1 ___SET_R1(___POP)
3570 #define ___LD_R1_TO_R1 ___D_R1 ___R_R1
3571 #define ___ST_R1_TO_R1 ___W_R1
3573 #if ___NB_ARG_REGS == 1
3574 #define ___PUSH_ARGS_IN_REGS(na) \
3575 if ((na)>0) ___PUSH_R1_TO_R1
3576 #define ___POP_ARGS_IN_REGS(na) \
3577 if ((na)>0) ___POP_R1_TO_R1
3578 #define ___PSSELF ___PSR2
3579 #define ___SELF ___R2
3580 #define ___LD_ARG_REGS ___LD_R1_TO_R1
3581 #define ___ST_ARG_REGS ___ST_R1_TO_R1
3582 #endif
3584 #if ___NB_GVM_REGS == 2
3586 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R1
3587 #define ___POP_REGS ___POP_R1_TO_R1 ___POP_R0
3589 #else
3591 #define ___PSR2 ___ps->r[2]
3592 #if ___MAX_LOCAL_GVM_REGS > 2
3593 #define ___D_R2 register ___WORD ___r2;
3594 #define ___R_R2 ___r2=___PSR2;
3595 #define ___W_R2 ___PSR2=___r2;
3596 #define ___R2 ___r2
3597 #else
3598 #define ___D_R2
3599 #define ___R_R2
3600 #define ___W_R2
3601 #define ___R2 ___PSR2
3602 #endif
3603 #define ___SET_R2(val)___R2=(val);
3604 #define ___PUSH_R1_TO_R2 ___PUSH_R1_TO_R1 ___PUSH(___R2)
3605 #define ___POP_R2_TO_R1 ___SET_R2(___POP)___POP_R1_TO_R1
3606 #define ___LD_R1_TO_R2 ___D_R2 ___LD_R1_TO_R1 ___R_R2
3607 #define ___ST_R1_TO_R2 ___ST_R1_TO_R1 ___W_R2
3609 #if ___NB_ARG_REGS == 2
3610 #define ___PUSH_ARGS_IN_REGS(na) \
3611 switch (na) \
3613 case 0: break; \
3614 case 1: ___PUSH_R1_TO_R1 break; \
3615 default: ___PUSH_R1_TO_R2 \
3617 #define ___POP_ARGS_IN_REGS(na) \
3618 switch (na) \
3620 case 0: break; \
3621 case 1: ___POP_R1_TO_R1 break; \
3622 default: ___POP_R2_TO_R1 \
3624 #define ___PSSELF ___PSR3
3625 #define ___SELF ___R3
3626 #define ___LD_ARG_REGS ___LD_R1_TO_R2
3627 #define ___ST_ARG_REGS ___ST_R1_TO_R2
3628 #endif
3630 #if ___NB_GVM_REGS == 3
3632 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R2
3633 #define ___POP_REGS ___POP_R2_TO_R1 ___POP_R0
3635 #else
3637 #define ___PSR3 ___ps->r[3]
3638 #if ___MAX_LOCAL_GVM_REGS > 3
3639 #define ___D_R3 register ___WORD ___r3;
3640 #define ___R_R3 ___r3=___PSR3;
3641 #define ___W_R3 ___PSR3=___r3;
3642 #define ___R3 ___r3
3643 #else
3644 #define ___D_R3
3645 #define ___R_R3
3646 #define ___W_R3
3647 #define ___R3 ___PSR3
3648 #endif
3649 #define ___SET_R3(val)___R3=(val);
3650 #define ___PUSH_R1_TO_R3 ___PUSH_R1_TO_R2 ___PUSH(___R3)
3651 #define ___POP_R3_TO_R1 ___SET_R3(___POP)___POP_R2_TO_R1
3652 #define ___LD_R1_TO_R3 ___D_R3 ___LD_R1_TO_R2 ___R_R3
3653 #define ___ST_R1_TO_R3 ___ST_R1_TO_R2 ___W_R3
3655 #if ___NB_ARG_REGS == 3
3656 #define ___PUSH_ARGS_IN_REGS(na) \
3657 switch (na) \
3659 case 0: break; \
3660 case 1: ___PUSH_R1_TO_R1 break; \
3661 case 2: ___PUSH_R1_TO_R2 break; \
3662 default: ___PUSH_R1_TO_R3 \
3664 #define ___POP_ARGS_IN_REGS(na) \
3665 switch (na) \
3667 case 0: break; \
3668 case 1: ___POP_R1_TO_R1 break; \
3669 case 2: ___POP_R2_TO_R1 break; \
3670 default: ___POP_R3_TO_R1 \
3672 #define ___PSSELF ___PSR4
3673 #define ___SELF ___R4
3674 #define ___LD_ARG_REGS ___LD_R1_TO_R3
3675 #define ___ST_ARG_REGS ___ST_R1_TO_R3
3676 #endif
3678 #if ___NB_GVM_REGS == 4
3680 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R3
3681 #define ___POP_REGS ___POP_R3_TO_R1 ___POP_R0
3683 #else
3685 #define ___PSR4 ___ps->r[4]
3686 #if ___MAX_LOCAL_GVM_REGS > 4
3687 #define ___D_R4 register ___WORD ___r4;
3688 #define ___R_R4 ___r4=___PSR4;
3689 #define ___W_R4 ___PSR4=___r4;
3690 #define ___R4 ___r4
3691 #else
3692 #define ___D_R4
3693 #define ___R_R4
3694 #define ___W_R4
3695 #define ___R4 ___PSR4
3696 #endif
3697 #define ___SET_R4(val)___R4=(val);
3698 #define ___PUSH_R1_TO_R4 ___PUSH_R1_TO_R3 ___PUSH(___R4)
3699 #define ___POP_R4_TO_R1 ___SET_R4(___POP)___POP_R3_TO_R1
3700 #define ___LD_R1_TO_R4 ___D_R4 ___LD_R1_TO_R3 ___R_R4
3701 #define ___ST_R1_TO_R4 ___ST_R1_TO_R3 ___W_R4
3703 #if ___NB_ARG_REGS == 4
3704 #define ___PUSH_ARGS_IN_REGS(na) \
3705 switch (na) \
3707 case 0: break; \
3708 case 1: ___PUSH_R1_TO_R1 break; \
3709 case 2: ___PUSH_R1_TO_R2 break; \
3710 case 3: ___PUSH_R1_TO_R3 break; \
3711 default: ___PUSH_R1_TO_R4 \
3713 #define ___POP_ARGS_IN_REGS(na) \
3714 switch (na) \
3716 case 0: break; \
3717 case 1: ___POP_R1_TO_R1 break; \
3718 case 2: ___POP_R2_TO_R1 break; \
3719 case 3: ___POP_R3_TO_R1 break; \
3720 default: ___POP_R4_TO_R1 \
3722 #define ___PSSELF ___PSR5
3723 #define ___SELF ___R5
3724 #define ___LD_ARG_REGS ___LD_R1_TO_R4
3725 #define ___ST_ARG_REGS ___ST_R1_TO_R4
3726 #endif
3728 #if ___NB_GVM_REGS == 5
3730 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R4
3731 #define ___POP_REGS ___POP_R4_TO_R1 ___POP_R0
3733 #else
3735 #define ___PSR5 ___ps->r[5]
3736 #if ___MAX_LOCAL_GVM_REGS > 5
3737 #define ___D_R5 register ___WORD ___r5;
3738 #define ___R_R5 ___r5=___PSR5;
3739 #define ___W_R5 ___PSR5=___r5;
3740 #define ___R5 ___r5
3741 #else
3742 #define ___D_R5
3743 #define ___R_R5
3744 #define ___W_R5
3745 #define ___R5 ___PSR5
3746 #endif
3747 #define ___SET_R5(val)___R5=(val);
3748 #define ___PUSH_R1_TO_R5 ___PUSH_R1_TO_R4 ___PUSH(___R5)
3749 #define ___POP_R5_TO_R1 ___SET_R5(___POP)___POP_R4_TO_R1
3750 #define ___LD_R1_TO_R5 ___D_R5 ___LD_R1_TO_R4 ___R_R5
3751 #define ___ST_R1_TO_R5 ___ST_R1_TO_R4 ___W_R5
3753 #if ___NB_ARG_REGS == 5
3754 #define ___PUSH_ARGS_IN_REGS(na) \
3755 switch (na) \
3757 case 0: break; \
3758 case 1: ___PUSH_R1_TO_R1 break; \
3759 case 2: ___PUSH_R1_TO_R2 break; \
3760 case 3: ___PUSH_R1_TO_R3 break; \
3761 case 4: ___PUSH_R1_TO_R4 break; \
3762 default: ___PUSH_R1_TO_R5 \
3764 #define ___POP_ARGS_IN_REGS(na) \
3765 switch (na) \
3767 case 0: break; \
3768 case 1: ___POP_R1_TO_R1 break; \
3769 case 2: ___POP_R2_TO_R1 break; \
3770 case 3: ___POP_R3_TO_R1 break; \
3771 case 4: ___POP_R4_TO_R1 break; \
3772 default: ___POP_R5_TO_R1 \
3774 #define ___PSSELF ___PSR6
3775 #define ___SELF ___R6
3776 #define ___LD_ARG_REGS ___LD_R1_TO_R5
3777 #define ___ST_ARG_REGS ___ST_R1_TO_R5
3778 #endif
3780 #if ___NB_GVM_REGS == 6
3782 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R5
3783 #define ___POP_REGS ___POP_R5_TO_R1 ___POP_R0
3785 #else
3787 #define ___PSR6 ___ps->r[6]
3788 #if ___MAX_LOCAL_GVM_REGS > 6
3789 #define ___D_R6 register ___WORD ___r6;
3790 #define ___R_R6 ___r6=___PSR6;
3791 #define ___W_R6 ___PSR6=___r6;
3792 #define ___R6 ___r6
3793 #else
3794 #define ___D_R6
3795 #define ___R_R6
3796 #define ___W_R6
3797 #define ___R6 ___PSR6
3798 #endif
3799 #define ___SET_R6(val)___R6=(val);
3800 #define ___PUSH_R1_TO_R6 ___PUSH_R1_TO_R5 ___PUSH(___R6)
3801 #define ___POP_R6_TO_R1 ___SET_R6(___POP)___POP_R5_TO_R1
3802 #define ___LD_R1_TO_R6 ___D_R6 ___LD_R1_TO_R5 ___R_R6
3803 #define ___ST_R1_TO_R6 ___ST_R1_TO_R5 ___W_R6
3805 #if ___NB_ARG_REGS == 6
3806 #define ___PUSH_ARGS_IN_REGS(na) \
3807 switch (na) \
3809 case 0: break; \
3810 case 1: ___PUSH_R1_TO_R1 break; \
3811 case 2: ___PUSH_R1_TO_R2 break; \
3812 case 3: ___PUSH_R1_TO_R3 break; \
3813 case 4: ___PUSH_R1_TO_R4 break; \
3814 case 5: ___PUSH_R1_TO_R5 break; \
3815 default: ___PUSH_R1_TO_R6 \
3817 #define ___POP_ARGS_IN_REGS(na) \
3818 switch (na) \
3820 case 0: break; \
3821 case 1: ___POP_R1_TO_R1 break; \
3822 case 2: ___POP_R2_TO_R1 break; \
3823 case 3: ___POP_R3_TO_R1 break; \
3824 case 4: ___POP_R4_TO_R1 break; \
3825 case 5: ___POP_R5_TO_R1 break; \
3826 default: ___POP_R6_TO_R1 \
3828 #define ___PSSELF ___PSR7
3829 #define ___SELF ___R7
3830 #define ___LD_ARG_REGS ___LD_R1_TO_R6
3831 #define ___ST_ARG_REGS ___ST_R1_TO_R6
3832 #endif
3834 #if ___NB_GVM_REGS == 7
3836 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R6
3837 #define ___POP_REGS ___POP_R6_TO_R1 ___POP_R0
3839 #else
3841 #define ___PSR7 ___ps->r[7]
3842 #if ___MAX_LOCAL_GVM_REGS > 7
3843 #define ___D_R7 register ___WORD ___r7;
3844 #define ___R_R7 ___r7=___PSR7;
3845 #define ___W_R7 ___PSR7=___r7;
3846 #define ___R7 ___r7
3847 #else
3848 #define ___D_R7
3849 #define ___R_R7
3850 #define ___W_R7
3851 #define ___R7 ___PSR7
3852 #endif
3853 #define ___SET_R7(val)___R7=(val);
3854 #define ___PUSH_R1_TO_R7 ___PUSH_R1_TO_R6 ___PUSH(___R7)
3855 #define ___POP_R7_TO_R1 ___SET_R7(___POP)___POP_R6_TO_R1
3856 #define ___LD_R1_TO_R7 ___D_R7 ___LD_R1_TO_R6 ___R_R7
3857 #define ___ST_R1_TO_R7 ___ST_R1_TO_R6 ___W_R7
3859 #if ___NB_ARG_REGS == 7
3860 #define ___PUSH_ARGS_IN_REGS(na) \
3861 switch (na) \
3863 case 0: break; \
3864 case 1: ___PUSH_R1_TO_R1 break; \
3865 case 2: ___PUSH_R1_TO_R2 break; \
3866 case 3: ___PUSH_R1_TO_R3 break; \
3867 case 4: ___PUSH_R1_TO_R4 break; \
3868 case 5: ___PUSH_R1_TO_R5 break; \
3869 case 6: ___PUSH_R1_TO_R6 break; \
3870 default: ___PUSH_R1_TO_R7 \
3872 #define ___POP_ARGS_IN_REGS(na) \
3873 switch (na) \
3875 case 0: break; \
3876 case 1: ___POP_R1_TO_R1 break; \
3877 case 2: ___POP_R2_TO_R1 break; \
3878 case 3: ___POP_R3_TO_R1 break; \
3879 case 4: ___POP_R4_TO_R1 break; \
3880 case 5: ___POP_R5_TO_R1 break; \
3881 case 6: ___POP_R6_TO_R1 break; \
3882 default: ___POP_R7_TO_R1 \
3884 #define ___PSSELF ___PSR8
3885 #define ___SELF ___R8
3886 #define ___LD_ARG_REGS ___LD_R1_TO_R7
3887 #define ___ST_ARG_REGS ___ST_R1_TO_R7
3888 #endif
3890 #if ___NB_GVM_REGS == 8
3892 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R7
3893 #define ___POP_REGS ___POP_R7_TO_R1 ___POP_R0
3895 #else
3897 #define ___PSR8 ___ps->r[8]
3898 #if ___MAX_LOCAL_GVM_REGS > 8
3899 #define ___D_R8 register ___WORD ___r8;
3900 #define ___R_R8 ___r8=___PSR8;
3901 #define ___W_R8 ___PSR8=___r8;
3902 #define ___R8 ___r8
3903 #else
3904 #define ___D_R8
3905 #define ___R_R8
3906 #define ___W_R8
3907 #define ___R8 ___PSR8
3908 #endif
3909 #define ___SET_R8(val)___R8=(val);
3910 #define ___PUSH_R1_TO_R8 ___PUSH_R1_TO_R7 ___PUSH(___R8)
3911 #define ___POP_R8_TO_R1 ___SET_R8(___POP)___POP_R7_TO_R1
3912 #define ___LD_R1_TO_R8 ___D_R8 ___LD_R1_TO_R7 ___R_R8
3913 #define ___ST_R1_TO_R8 ___ST_R1_TO_R7 ___W_R8
3915 #if ___NB_ARG_REGS == 8
3916 #define ___PUSH_ARGS_IN_REGS(na) \
3917 switch (na) \
3919 case 0: break; \
3920 case 1: ___PUSH_R1_TO_R1 break; \
3921 case 2: ___PUSH_R1_TO_R2 break; \
3922 case 3: ___PUSH_R1_TO_R3 break; \
3923 case 4: ___PUSH_R1_TO_R4 break; \
3924 case 5: ___PUSH_R1_TO_R5 break; \
3925 case 6: ___PUSH_R1_TO_R6 break; \
3926 case 7: ___PUSH_R1_TO_R7 break; \
3927 default: ___PUSH_R1_TO_R8 \
3929 #define ___POP_ARGS_IN_REGS(na) \
3930 switch (na) \
3932 case 0: break; \
3933 case 1: ___POP_R1_TO_R1 break; \
3934 case 2: ___POP_R2_TO_R1 break; \
3935 case 3: ___POP_R3_TO_R1 break; \
3936 case 4: ___POP_R4_TO_R1 break; \
3937 case 5: ___POP_R5_TO_R1 break; \
3938 case 6: ___POP_R6_TO_R1 break; \
3939 case 7: ___POP_R7_TO_R1 break; \
3940 default: ___POP_R8_TO_R1 \
3942 #define ___PSSELF ___PSR9
3943 #define ___SELF ___R9
3944 #define ___LD_ARG_REGS ___LD_R1_TO_R8
3945 #define ___ST_ARG_REGS ___ST_R1_TO_R8
3946 #endif
3948 #if ___NB_GVM_REGS == 9
3950 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R8
3951 #define ___POP_REGS ___POP_R8_TO_R1 ___POP_R0
3953 #else
3955 #define ___PSR9 ___ps->r[9]
3956 #if ___MAX_LOCAL_GVM_REGS > 9
3957 #define ___D_R9 register ___WORD ___r9;
3958 #define ___R_R9 ___r9=___PSR9;
3959 #define ___W_R9 ___PSR9=___r9;
3960 #define ___R9 ___r9
3961 #else
3962 #define ___D_R9
3963 #define ___R_R9
3964 #define ___W_R9
3965 #define ___R9 ___PSR9
3966 #endif
3967 #define ___SET_R9(val)___R9=(val);
3968 #define ___PUSH_R1_TO_R9 ___PUSH_R1_TO_R8 ___PUSH(___R9)
3969 #define ___POP_R9_TO_R1 ___SET_R9(___POP)___POP_R8_TO_R1
3970 #define ___LD_R1_TO_R9 ___D_R9 ___LD_R1_TO_R8 ___R_R9
3971 #define ___ST_R1_TO_R9 ___ST_R1_TO_R8 ___W_R9
3973 #if ___NB_ARG_REGS == 9
3974 #define ___PUSH_ARGS_IN_REGS(na) \
3975 switch (na) \
3977 case 0: break; \
3978 case 1: ___PUSH_R1_TO_R1 break; \
3979 case 2: ___PUSH_R1_TO_R2 break; \
3980 case 3: ___PUSH_R1_TO_R3 break; \
3981 case 4: ___PUSH_R1_TO_R4 break; \
3982 case 5: ___PUSH_R1_TO_R5 break; \
3983 case 6: ___PUSH_R1_TO_R6 break; \
3984 case 7: ___PUSH_R1_TO_R7 break; \
3985 case 8: ___PUSH_R1_TO_R8 break; \
3986 default: ___PUSH_R1_TO_R9 \
3988 #define ___POP_ARGS_IN_REGS(na) \
3989 switch (na) \
3991 case 0: break; \
3992 case 1: ___POP_R1_TO_R1 break; \
3993 case 2: ___POP_R2_TO_R1 break; \
3994 case 3: ___POP_R3_TO_R1 break; \
3995 case 4: ___POP_R4_TO_R1 break; \
3996 case 5: ___POP_R5_TO_R1 break; \
3997 case 6: ___POP_R6_TO_R1 break; \
3998 case 7: ___POP_R7_TO_R1 break; \
3999 case 8: ___POP_R8_TO_R1 break; \
4000 default: ___POP_R9_TO_R1 \
4002 #define ___PSSELF ___PSR10
4003 #define ___SELF ___R10
4004 #define ___LD_ARG_REGS ___LD_R1_TO_R9
4005 #define ___ST_ARG_REGS ___ST_R1_TO_R9
4006 #endif
4008 #if ___NB_GVM_REGS == 10
4010 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R9
4011 #define ___POP_REGS ___POP_R9_TO_R1 ___POP_R0
4013 #else
4015 #define ___PSR10 ___ps->r[10]
4016 #if ___MAX_LOCAL_GVM_REGS > 10
4017 #define ___D_R10 register ___WORD ___r10;
4018 #define ___R_R10 ___r10=___PSR10;
4019 #define ___W_R10 ___PSR10=___r10;
4020 #define ___R10 ___r10
4021 #else
4022 #define ___D_R10
4023 #define ___R_R10
4024 #define ___W_R10
4025 #define ___R10 ___PSR10
4026 #endif
4027 #define ___SET_R10(val)___R10=(val);
4028 #define ___PUSH_R1_TO_R10 ___PUSH_R1_TO_R9 ___PUSH(___R10)
4029 #define ___POP_R10_TO_R1 ___SET_R10(___POP)___POP_R9_TO_R1
4030 #define ___LD_R1_TO_R10 ___D_R10 ___LD_R1_TO_R9 ___R_R10
4031 #define ___ST_R1_TO_R10 ___ST_R1_TO_R9 ___W_R10
4033 #if ___NB_ARG_REGS == 10
4034 #define ___PUSH_ARGS_IN_REGS(na) \
4035 switch (na) \
4037 case 0: break; \
4038 case 1: ___PUSH_R1_TO_R1 break; \
4039 case 2: ___PUSH_R1_TO_R2 break; \
4040 case 3: ___PUSH_R1_TO_R3 break; \
4041 case 4: ___PUSH_R1_TO_R4 break; \
4042 case 5: ___PUSH_R1_TO_R5 break; \
4043 case 6: ___PUSH_R1_TO_R6 break; \
4044 case 7: ___PUSH_R1_TO_R7 break; \
4045 case 8: ___PUSH_R1_TO_R8 break; \
4046 case 9: ___PUSH_R1_TO_R9 break; \
4047 default: ___PUSH_R1_TO_R10 \
4049 #define ___POP_ARGS_IN_REGS(na) \
4050 switch (na) \
4052 case 0: break; \
4053 case 1: ___POP_R1_TO_R1 break; \
4054 case 2: ___POP_R2_TO_R1 break; \
4055 case 3: ___POP_R3_TO_R1 break; \
4056 case 4: ___POP_R4_TO_R1 break; \
4057 case 5: ___POP_R5_TO_R1 break; \
4058 case 6: ___POP_R6_TO_R1 break; \
4059 case 7: ___POP_R7_TO_R1 break; \
4060 case 8: ___POP_R8_TO_R1 break; \
4061 case 9: ___POP_R9_TO_R1 break; \
4062 default: ___POP_R10_TO_R1 \
4064 #define ___PSSELF ___PSR11
4065 #define ___SELF ___R11
4066 #define ___LD_ARG_REGS ___LD_R1_TO_R10
4067 #define ___ST_ARG_REGS ___ST_R1_TO_R10
4068 #endif
4070 #if ___NB_GVM_REGS == 11
4072 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R10
4073 #define ___POP_REGS ___POP_R10_TO_R1 ___POP_R0
4075 #else
4077 #define ___PSR11 ___ps->r[11]
4078 #if ___MAX_LOCAL_GVM_REGS > 11
4079 #define ___D_R11 register ___WORD ___r11;
4080 #define ___R_R11 ___r11=___PSR11;
4081 #define ___W_R11 ___PSR11=___r11;
4082 #define ___R11 ___r11
4083 #else
4084 #define ___D_R11
4085 #define ___R_R11
4086 #define ___W_R11
4087 #define ___R11 ___PSR11
4088 #endif
4089 #define ___SET_R11(val)___R11=(val);
4090 #define ___PUSH_R1_TO_R11 ___PUSH_R1_TO_R10 ___PUSH(___R11)
4091 #define ___POP_R11_TO_R1 ___SET_R11(___POP)___POP_R10_TO_R1
4092 #define ___LD_R1_TO_R11 ___D_R11 ___LD_R1_TO_R10 ___R_R11
4093 #define ___ST_R1_TO_R11 ___ST_R1_TO_R10 ___W_R11
4095 #if ___NB_ARG_REGS == 11
4096 #define ___PUSH_ARGS_IN_REGS(na) \
4097 switch (na) \
4099 case 0: break; \
4100 case 1: ___PUSH_R1_TO_R1 break; \
4101 case 2: ___PUSH_R1_TO_R2 break; \
4102 case 3: ___PUSH_R1_TO_R3 break; \
4103 case 4: ___PUSH_R1_TO_R4 break; \
4104 case 5: ___PUSH_R1_TO_R5 break; \
4105 case 6: ___PUSH_R1_TO_R6 break; \
4106 case 7: ___PUSH_R1_TO_R7 break; \
4107 case 8: ___PUSH_R1_TO_R8 break; \
4108 case 9: ___PUSH_R1_TO_R9 break; \
4109 case 10: ___PUSH_R1_TO_R10 break; \
4110 default: ___PUSH_R1_TO_R11 \
4112 #define ___POP_ARGS_IN_REGS(na) \
4113 switch (na) \
4115 case 0: break; \
4116 case 1: ___POP_R1_TO_R1 break; \
4117 case 2: ___POP_R2_TO_R1 break; \
4118 case 3: ___POP_R3_TO_R1 break; \
4119 case 4: ___POP_R4_TO_R1 break; \
4120 case 5: ___POP_R5_TO_R1 break; \
4121 case 6: ___POP_R6_TO_R1 break; \
4122 case 7: ___POP_R7_TO_R1 break; \
4123 case 8: ___POP_R8_TO_R1 break; \
4124 case 9: ___POP_R9_TO_R1 break; \
4125 case 10: ___POP_R10_TO_R1 break; \
4126 default: ___POP_R11_TO_R1 \
4128 #define ___PSSELF ___PSR12
4129 #define ___SELF ___R12
4130 #define ___LD_ARG_REGS ___LD_R1_TO_R11
4131 #define ___ST_ARG_REGS ___ST_R1_TO_R11
4132 #endif
4134 #if ___NB_GVM_REGS == 12
4136 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R11
4137 #define ___POP_REGS ___POP_R11_TO_R1 ___POP_R0
4139 #else
4141 #define ___PSR12 ___ps->r[12]
4142 #if ___MAX_LOCAL_GVM_REGS > 12
4143 #define ___D_R12 register ___WORD ___r12;
4144 #define ___R_R12 ___r12=___PSR12;
4145 #define ___W_R12 ___PSR12=___r12;
4146 #define ___R12 ___r12
4147 #else
4148 #define ___D_R12
4149 #define ___R_R12
4150 #define ___W_R12
4151 #define ___R12 ___PSR12
4152 #endif
4153 #define ___SET_R12(val)___R12=(val);
4154 #define ___PUSH_R1_TO_R12 ___PUSH_R1_TO_R11 ___PUSH(___R12)
4155 #define ___POP_R12_TO_R1 ___SET_R12(___POP)___POP_R11_TO_R1
4156 #define ___LD_R1_TO_R12 ___D_R12 ___LD_R1_TO_R11 ___R_R12
4157 #define ___ST_R1_TO_R12 ___ST_R1_TO_R11 ___W_R12
4159 #if ___NB_ARG_REGS == 12
4160 #define ___PUSH_ARGS_IN_REGS(na) \
4161 switch (na) \
4163 case 0: break; \
4164 case 1: ___PUSH_R1_TO_R1 break; \
4165 case 2: ___PUSH_R1_TO_R2 break; \
4166 case 3: ___PUSH_R1_TO_R3 break; \
4167 case 4: ___PUSH_R1_TO_R4 break; \
4168 case 5: ___PUSH_R1_TO_R5 break; \
4169 case 6: ___PUSH_R1_TO_R6 break; \
4170 case 7: ___PUSH_R1_TO_R7 break; \
4171 case 8: ___PUSH_R1_TO_R8 break; \
4172 case 9: ___PUSH_R1_TO_R9 break; \
4173 case 10: ___PUSH_R1_TO_R10 break; \
4174 case 11: ___PUSH_R1_TO_R11 break; \
4175 default: ___PUSH_R1_TO_R12 \
4177 #define ___POP_ARGS_IN_REGS(na) \
4178 switch (na) \
4180 case 0: break; \
4181 case 1: ___POP_R1_TO_R1 break; \
4182 case 2: ___POP_R2_TO_R1 break; \
4183 case 3: ___POP_R3_TO_R1 break; \
4184 case 4: ___POP_R4_TO_R1 break; \
4185 case 5: ___POP_R5_TO_R1 break; \
4186 case 6: ___POP_R6_TO_R1 break; \
4187 case 7: ___POP_R7_TO_R1 break; \
4188 case 8: ___POP_R8_TO_R1 break; \
4189 case 9: ___POP_R9_TO_R1 break; \
4190 case 10: ___POP_R10_TO_R1 break; \
4191 case 11: ___POP_R11_TO_R1 break; \
4192 default: ___POP_R12_TO_R1 \
4194 #define ___PSSELF ___PSR13
4195 #define ___SELF ___R13
4196 #define ___LD_ARG_REGS ___LD_R1_TO_R12
4197 #define ___ST_ARG_REGS ___ST_R1_TO_R12
4198 #endif
4200 #if ___NB_GVM_REGS == 13
4202 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R12
4203 #define ___POP_REGS ___POP_R12_TO_R1 ___POP_R0
4205 #else
4207 #define ___PSR13 ___ps->r[13]
4208 #if ___MAX_LOCAL_GVM_REGS > 13
4209 #define ___D_R13 register ___WORD ___r13;
4210 #define ___R_R13 ___r13=___PSR13;
4211 #define ___W_R13 ___PSR13=___r13;
4212 #define ___R13 ___r13
4213 #else
4214 #define ___D_R13
4215 #define ___R_R13
4216 #define ___W_R13
4217 #define ___R13 ___PSR13
4218 #endif
4219 #define ___SET_R13(val)___R13=(val);
4220 #define ___PUSH_R1_TO_R13 ___PUSH_R1_TO_R12 ___PUSH(___R13)
4221 #define ___POP_R13_TO_R1 ___SET_R13(___POP)___POP_R12_TO_R1
4222 #define ___LD_R1_TO_R13 ___D_R13 ___LD_R1_TO_R12 ___R_R13
4223 #define ___ST_R1_TO_R13 ___ST_R1_TO_R12 ___W_R13
4225 #if ___NB_GVM_REGS == 14
4227 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R13
4228 #define ___POP_REGS ___POP_R13_TO_R1 ___POP_R0
4230 #else
4232 #define ___PSR14 ___ps->r[14]
4233 #if ___MAX_LOCAL_GVM_REGS > 14
4234 #define ___D_R14 register ___WORD ___r14;
4235 #define ___R_R14 ___r14=___PSR14;
4236 #define ___W_R14 ___PSR14=___r14;
4237 #define ___R14 ___r14
4238 #else
4239 #define ___D_R14
4240 #define ___R_R14
4241 #define ___W_R14
4242 #define ___R14 ___PSR14
4243 #endif
4244 #define ___SET_R14(val)___R14=(val);
4245 #define ___PUSH_R1_TO_R14 ___PUSH_R1_TO_R13 ___PUSH(___R14)
4246 #define ___POP_R14_TO_R1 ___SET_R14(___POP)___POP_R13_TO_R1
4247 #define ___LD_R1_TO_R14 ___D_R14 ___LD_R1_TO_R13 ___R_R14
4248 #define ___ST_R1_TO_R14 ___ST_R1_TO_R13 ___W_R14
4250 #if ___NB_GVM_REGS == 15
4252 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R14
4253 #define ___POP_REGS ___POP_R14_TO_R1 ___POP_R0
4255 #else
4257 #define ___PSR15 ___ps->r[15]
4258 #if ___MAX_LOCAL_GVM_REGS > 15
4259 #define ___D_R15 register ___WORD ___r15;
4260 #define ___R_R15 ___r15=___PSR15;
4261 #define ___W_R15 ___PSR15=___r15;
4262 #define ___R15 ___r15
4263 #else
4264 #define ___D_R15
4265 #define ___R_R15
4266 #define ___W_R15
4267 #define ___R15 ___PSR15
4268 #endif
4269 #define ___SET_R15(val)___R15=(val);
4270 #define ___PUSH_R1_TO_R15 ___PUSH_R1_TO_R14 ___PUSH(___R15)
4271 #define ___POP_R15_TO_R1 ___SET_R15(___POP)___POP_R14_TO_R1
4272 #define ___LD_R1_TO_R15 ___D_R15 ___LD_R1_TO_R14 ___R_R15
4273 #define ___ST_R1_TO_R15 ___ST_R1_TO_R14 ___W_R15
4275 #if ___NB_GVM_REGS == 16
4277 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R15
4278 #define ___POP_REGS ___POP_R15_TO_R1 ___POP_R0
4280 #else
4282 #define ___PSR16 ___ps->r[16]
4283 #if ___MAX_LOCAL_GVM_REGS > 16
4284 #define ___D_R16 register ___WORD ___r16;
4285 #define ___R_R16 ___r16=___PSR16;
4286 #define ___W_R16 ___PSR16=___r16;
4287 #define ___R16 ___r16
4288 #else
4289 #define ___D_R16
4290 #define ___R_R16
4291 #define ___W_R16
4292 #define ___R16 ___PSR16
4293 #endif
4294 #define ___SET_R16(val)___R16=(val);
4295 #define ___PUSH_R1_TO_R16 ___PUSH_R1_TO_R15 ___PUSH(___R16)
4296 #define ___POP_R16_TO_R1 ___SET_R16(___POP)___POP_R15_TO_R1
4297 #define ___LD_R1_TO_R16 ___D_R16 ___LD_R1_TO_R15 ___R_R16
4298 #define ___ST_R1_TO_R16 ___ST_R1_TO_R15 ___W_R16
4300 #if ___NB_GVM_REGS == 17
4302 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R16
4303 #define ___POP_REGS ___POP_R16_TO_R1 ___POP_R0
4305 #else
4307 #define ___PSR17 ___ps->r[17]
4308 #if ___MAX_LOCAL_GVM_REGS > 17
4309 #define ___D_R17 register ___WORD ___r17;
4310 #define ___R_R17 ___r17=___PSR17;
4311 #define ___W_R17 ___PSR17=___r17;
4312 #define ___R17 ___r17
4313 #else
4314 #define ___D_R17
4315 #define ___R_R17
4316 #define ___W_R17
4317 #define ___R17 ___PSR17
4318 #endif
4319 #define ___SET_R17(val)___R17=(val);
4320 #define ___PUSH_R1_TO_R17 ___PUSH_R1_TO_R16 ___PUSH(___R17)
4321 #define ___POP_R17_TO_R1 ___SET_R17(___POP)___POP_R16_TO_R1
4322 #define ___LD_R1_TO_R17 ___D_R17 ___LD_R1_TO_R16 ___R_R17
4323 #define ___ST_R1_TO_R17 ___ST_R1_TO_R16 ___W_R17
4325 #if ___NB_GVM_REGS == 18
4327 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R17
4328 #define ___POP_REGS ___POP_R17_TO_R1 ___POP_R0
4330 #else
4332 #define ___PSR18 ___ps->r[18]
4333 #if ___MAX_LOCAL_GVM_REGS > 18
4334 #define ___D_R18 register ___WORD ___r18;
4335 #define ___R_R18 ___r18=___PSR18;
4336 #define ___W_R18 ___PSR18=___r18;
4337 #define ___R18 ___r18
4338 #else
4339 #define ___D_R18
4340 #define ___R_R18
4341 #define ___W_R18
4342 #define ___R18 ___PSR18
4343 #endif
4344 #define ___SET_R18(val)___R18=(val);
4345 #define ___PUSH_R1_TO_R18 ___PUSH_R1_TO_R17 ___PUSH(___R18)
4346 #define ___POP_R18_TO_R1 ___SET_R18(___POP)___POP_R17_TO_R1
4347 #define ___LD_R1_TO_R18 ___D_R18 ___LD_R1_TO_R17 ___R_R18
4348 #define ___ST_R1_TO_R18 ___ST_R1_TO_R17 ___W_R18
4350 #if ___NB_GVM_REGS == 19
4352 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R18
4353 #define ___POP_REGS ___POP_R18_TO_R1 ___POP_R0
4355 #else
4357 #define ___PSR19 ___ps->r[19]
4358 #if ___MAX_LOCAL_GVM_REGS > 19
4359 #define ___D_R19 register ___WORD ___r19;
4360 #define ___R_R19 ___r19=___PSR19;
4361 #define ___W_R19 ___PSR19=___r19;
4362 #define ___R19 ___r19
4363 #else
4364 #define ___D_R19
4365 #define ___R_R19
4366 #define ___W_R19
4367 #define ___R19 ___PSR19
4368 #endif
4369 #define ___SET_R19(val)___R19=(val);
4370 #define ___PUSH_R1_TO_R19 ___PUSH_R1_TO_R18 ___PUSH(___R19)
4371 #define ___POP_R19_TO_R1 ___SET_R19(___POP)___POP_R18_TO_R1
4372 #define ___LD_R1_TO_R19 ___D_R19 ___LD_R1_TO_R18 ___R_R19
4373 #define ___ST_R1_TO_R19 ___ST_R1_TO_R18 ___W_R19
4375 #if ___NB_GVM_REGS == 20
4377 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R19
4378 #define ___POP_REGS ___POP_R19_TO_R1 ___POP_R0
4380 #else
4382 #define ___PSR20 ___ps->r[20]
4383 #if ___MAX_LOCAL_GVM_REGS > 20
4384 #define ___D_R20 register ___WORD ___r20;
4385 #define ___R_R20 ___r20=___PSR20;
4386 #define ___W_R20 ___PSR20=___r20;
4387 #define ___R20 ___r20
4388 #else
4389 #define ___D_R20
4390 #define ___R_R20
4391 #define ___W_R20
4392 #define ___R20 ___PSR20
4393 #endif
4394 #define ___SET_R20(val)___R20=(val);
4395 #define ___PUSH_R1_TO_R20 ___PUSH_R1_TO_R19 ___PUSH(___R20)
4396 #define ___POP_R20_TO_R1 ___SET_R20(___POP)___POP_R19_TO_R1
4397 #define ___LD_R1_TO_R20 ___D_R20 ___LD_R1_TO_R19 ___R_R20
4398 #define ___ST_R1_TO_R20 ___ST_R1_TO_R19 ___W_R20
4400 #if ___NB_GVM_REGS == 21
4402 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R20
4403 #define ___POP_REGS ___POP_R20_TO_R1 ___POP_R0
4405 #else
4407 #define ___PSR21 ___ps->r[21]
4408 #if ___MAX_LOCAL_GVM_REGS > 21
4409 #define ___D_R21 register ___WORD ___r21;
4410 #define ___R_R21 ___r21=___PSR21;
4411 #define ___W_R21 ___PSR21=___r21;
4412 #define ___R21 ___r21
4413 #else
4414 #define ___D_R21
4415 #define ___R_R21
4416 #define ___W_R21
4417 #define ___R21 ___PSR21
4418 #endif
4419 #define ___SET_R21(val)___R21=(val);
4420 #define ___PUSH_R1_TO_R21 ___PUSH_R1_TO_R20 ___PUSH(___R21)
4421 #define ___POP_R21_TO_R1 ___SET_R21(___POP)___POP_R20_TO_R1
4422 #define ___LD_R1_TO_R21 ___D_R21 ___LD_R1_TO_R20 ___R_R21
4423 #define ___ST_R1_TO_R21 ___ST_R1_TO_R20 ___W_R21
4425 #if ___NB_GVM_REGS == 22
4427 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R21
4428 #define ___POP_REGS ___POP_R21_TO_R1 ___POP_R0
4430 #else
4432 #define ___PSR22 ___ps->r[22]
4433 #if ___MAX_LOCAL_GVM_REGS > 22
4434 #define ___D_R22 register ___WORD ___r22;
4435 #define ___R_R22 ___r22=___PSR22;
4436 #define ___W_R22 ___PSR22=___r22;
4437 #define ___R22 ___r22
4438 #else
4439 #define ___D_R22
4440 #define ___R_R22
4441 #define ___W_R22
4442 #define ___R22 ___PSR22
4443 #endif
4444 #define ___SET_R22(val)___R22=(val);
4445 #define ___PUSH_R1_TO_R22 ___PUSH_R1_TO_R21 ___PUSH(___R22)
4446 #define ___POP_R22_TO_R1 ___SET_R22(___POP)___POP_R21_TO_R1
4447 #define ___LD_R1_TO_R22 ___D_R22 ___LD_R1_TO_R21 ___R_R22
4448 #define ___ST_R1_TO_R22 ___ST_R1_TO_R21 ___W_R22
4450 #if ___NB_GVM_REGS == 23
4452 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R22
4453 #define ___POP_REGS ___POP_R22_TO_R1 ___POP_R0
4455 #else
4457 #define ___PSR23 ___ps->r[23]
4458 #if ___MAX_LOCAL_GVM_REGS > 23
4459 #define ___D_R23 register ___WORD ___r23;
4460 #define ___R_R23 ___r23=___PSR23;
4461 #define ___W_R23 ___PSR23=___r23;
4462 #define ___R23 ___r23
4463 #else
4464 #define ___D_R23
4465 #define ___R_R23
4466 #define ___W_R23
4467 #define ___R23 ___PSR23
4468 #endif
4469 #define ___SET_R23(val)___R23=(val);
4470 #define ___PUSH_R1_TO_R23 ___PUSH_R1_TO_R22 ___PUSH(___R23)
4471 #define ___POP_R23_TO_R1 ___SET_R23(___POP)___POP_R22_TO_R1
4472 #define ___LD_R1_TO_R23 ___D_R23 ___LD_R1_TO_R22 ___R_R23
4473 #define ___ST_R1_TO_R23 ___ST_R1_TO_R22 ___W_R23
4475 #if ___NB_GVM_REGS == 24
4477 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R23
4478 #define ___POP_REGS ___POP_R23_TO_R1 ___POP_R0
4480 #else
4482 #define ___PSR24 ___ps->r[24]
4483 #if ___MAX_LOCAL_GVM_REGS > 24
4484 #define ___D_R24 register ___WORD ___r24;
4485 #define ___R_R24 ___r24=___PSR24;
4486 #define ___W_R24 ___PSR24=___r24;
4487 #define ___R24 ___r24
4488 #else
4489 #define ___D_R24
4490 #define ___R_R24
4491 #define ___W_R24
4492 #define ___R24 ___PSR24
4493 #endif
4494 #define ___SET_R24(val)___R24=(val);
4495 #define ___PUSH_R1_TO_R24 ___PUSH_R1_TO_R23 ___PUSH(___R24)
4496 #define ___POP_R24_TO_R1 ___SET_R24(___POP)___POP_R23_TO_R1
4497 #define ___LD_R1_TO_R24 ___D_R24 ___LD_R1_TO_R23 ___R_R24
4498 #define ___ST_R1_TO_R24 ___ST_R1_TO_R23 ___W_R24
4500 #if ___NB_GVM_REGS == 25
4502 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R24
4503 #define ___POP_REGS ___POP_R24_TO_R1 ___POP_R0
4505 #endif
4506 #endif
4507 #endif
4508 #endif
4509 #endif
4510 #endif
4511 #endif
4512 #endif
4513 #endif
4514 #endif
4515 #endif
4516 #endif
4517 #endif
4518 #endif
4519 #endif
4520 #endif
4521 #endif
4522 #endif
4523 #endif
4524 #endif
4525 #endif
4526 #endif
4527 #endif
4528 #endif
4530 /*---------------------------------------------------------------------------*/
4532 /* Labels and switches */
4534 #define ___NOT(x)!x
4535 #define ___AND(x,y)(x&&y)
4537 #define ___MLBL(n)___lp+((n)*___LS*___WS)
4538 #define ___LBL(n)___start+((___PH_LBL0-___HOST_LBL0+n)*___LS*___WS)
4539 #define ___DEF_SLBL(n,lbl)___DEF_SW(n)___DEF_GLBL(lbl)
4540 #define ___DEF_GLBL(lbl)lbl:
4541 #define ___GOTO(lbl)goto lbl;
4542 #define ___IF_GOTO(test,lbl)if (test) ___GOTO(lbl)
4543 #define ___JUMPINT(nargs,prc,lbl)___SM(___GOTO(lbl),{nargs ___JUMP(prc)})
4544 #define ___JUMPEXTPRM(nargs,val){nargs ___JUMPEXT(val)}
4545 #define ___JUMPEXTNOTSAFE(nargs,val) \
4546 {nargs ___SELF=val; \
4547 ___JUMPEXT(___LABEL_ENTRY_OR_DESCR(___SELF))}
4548 #define ___JUMPPRM(nargs,val){nargs ___JUMP(val)}
4550 #define ___JUMPNOTSAFE(nargs,val) \
4551 {nargs ___SELF=val; \
4552 ___JUMP(___LABEL_ENTRY_OR_DESCR(___SELF))}
4554 #define ___JUMPSAFE(nargs,val) ___JUMPNOTSAFE(nargs,val) /***************/
4556 #define ___JUMPGENNOTSAFE(nargs,val)___JUMPNOTSAFE(nargs,val)
4557 #define ___JUMPGLONOTSAFE(nargs,i,glo)___JUMPNOTSAFE(nargs,___GLO(i,glo))
4558 #define ___JUMPGENSAFE(nargs,val) \
4559 {nargs ___SELF=val; \
4560 if (___EXPECT_TRUE(___PROCEDUREP(___SELF))) \
4561 ___JUMP(___LABEL_ENTRY_OR_DESCR(___SELF)) \
4562 ___ps->temp1=___SELF;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_not_proc)}
4563 #define ___JUMPGLOSAFE(nargs,i,glo) \
4564 {nargs ___SELF=___GLO(i,glo); \
4565 if (___EXPECT_TRUE(___PROCEDUREP(___SELF))) \
4566 ___JUMP(___LABEL_ENTRY_OR_DESCR(___SELF)) \
4567 ___ps->temp4=(___WORD)&___GLOSTRUCT(i,glo);___JUMPEXTPRM(___NOTHING,___GSTATE->handler_not_proc_glo)}
4569 #ifdef ___NOT_SAFE_CALLS
4570 #undef ___JUMPGENSAFE
4571 #undef ___JUMPGLOSAFE
4572 #define ___JUMPGENSAFE(nargs,val)___JUMPGENNOTSAFE(nargs,val)
4573 #define ___JUMPGLOSAFE(nargs,i,glo)___JUMPGLONOTSAFE(nargs,i,glo)
4574 #endif
4576 #ifdef ___SAFE_CALLS
4577 #undef ___JUMPGENNOTSAFE
4578 #undef ___JUMPGLONOTSAFE
4579 #define ___JUMPGENNOTSAFE(nargs,val)___JUMPGENSAFE(nargs,val)
4580 #define ___JUMPGLONOTSAFE(nargs,i,glo)___JUMPGLOSAFE(nargs,i,glo)
4581 #endif
4583 #define ___BEGIN_SWITCH(x) switch (x) {
4584 #define ___SWITCH_CASE_GOTO(obj,lbl) case (obj): ___GOTO(lbl)
4585 #define ___END_SWITCH }
4587 #define ___BEGIN_SWITCH_FIXNUM(x) { ___SCMOBJ ___sw = (x); \
4588 if (___EXPECT_TRUE(___FIXNUMP(___sw))) switch(___INT(___sw)) {
4589 #define ___SWITCH_FIXNUM_CASE_GOTO(obj,lbl) case (___INT(obj)): ___GOTO(lbl)
4590 #define ___END_SWITCH_FIXNUM }}
4592 #define ___BEGIN_SWITCH_CHAR(x) { ___SCMOBJ ___sw = (x); \
4593 if (___EXPECT_TRUE(___CHARP(___sw))) switch(___INT(___sw)) {
4594 #define ___SWITCH_CHAR_CASE_GOTO(obj,lbl) case (___INT(obj)): ___GOTO(lbl)
4595 #define ___END_SWITCH_CHAR }}
4597 #define ___BEGIN_SWITCH_SYMKEY(x,mod,guard) { ___SCMOBJ ___sw = (x); \
4598 if (___EXPECT_TRUE(guard(___sw))) switch(___INT(___FIELD(___sw,___SYMKEY_HASH)) & ((mod)-1)) {
4599 #define ___SWITCH_SYMKEY_CASE(hash) case (hash):
4600 #define ___SWITCH_SYMKEY_CASE_GOTO(obj,lbl) ___IF_GOTO(___EQP(___sw,obj),lbl)
4601 #define ___END_SWITCH_SYMKEY }}
4603 /*---------------------------------------------------------------------------*/
4605 #define ___PRC(i)___start+((i-___HOST_LBL0)*___LS*___WS)
4607 #define ___SET_NARGS(n)___ps->na=n;
4609 #define ___IF_NARGS_EQ(n,code)if (___EXPECT_TRUE(___ps->na==n)) {code} else
4611 #define ___WRONG_NARGS(lbl,nb_req,nb_opt,nb_key) \
4612 {___ps->temp1=___LBL(lbl); \
4613 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_wrong_nargs)}
4615 #define ___GET_REST(lbl,nb_req,nb_opt,nb_key) \
4616 if (___ps->na>=0){___ps->temp1=___LBL(lbl); \
4617 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_rest)}
4619 #define ___GET_KEY(lbl,nb_req,nb_opt,nb_key,key_descr) \
4620 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4621 ___ps->temp3=key_descr;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key)}
4623 #define ___GET_REST_KEY(lbl,nb_req,nb_opt,nb_key,key_descr) \
4624 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4625 ___ps->temp3=key_descr;___ps->temp4=1; \
4626 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key_rest)}
4628 #define ___GET_KEY_REST(lbl,nb_req,nb_opt,nb_key,key_descr) \
4629 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4630 ___ps->temp3=key_descr;___ps->temp4=0; \
4631 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key_rest)}
4633 #define ___BOOLEAN(x)(x)?___TRU:___FAL
4634 #define ___EXPR(x)x;
4636 #define ___ALLOC_CLO(n)(___ALLOC(n+2),___TAG((___hp-n-2),___tSUBTYPED))
4637 #define ___BEGIN_SETUP_CLO(n,clo,lbl) \
4638 {___WORD *___ptr=___UNTAG_AS(clo,___tSUBTYPED); \
4639 ___ptr[0]=___MAKE_HD_WORDS((n+1),___sPROCEDURE); ___ptr[1]=___LBL(lbl);
4640 #define ___ADD_CLO_ELEM(i,val)___ptr[i+2]=(val);
4641 #define ___END_SETUP_CLO(n) }
4642 #define ___CLO(x,y)___BODY_AS(x,___tSUBTYPED)[y]
4643 #define ___SET_CLO(x,y,z)___BODY_AS(x,___tSUBTYPED)[y]=z;
4645 #define ___BEGIN_ALLOC_LIST(n,last)___ALLOC_PAIR(last,___NUL)
4646 #define ___ADD_LIST_ELEM(i,val)___ALLOC_PAIR(val,___TAG((___hp-___PAIR_SIZE-1),___tPAIR))
4647 #define ___END_ALLOC_LIST(n)
4648 #define ___GET_LIST(n) ___TAG((___hp-___PAIR_SIZE-1),___tPAIR)
4650 #define ___BEGIN_ALLOC_STRING(n) \
4651 ___hp[0]=___MAKE_HD_BYTES(n<<___LCS,___sSTRING);
4652 #define ___ADD_STRING_ELEM(i,val)___CS_SELECT( \
4653 ___STORE_U8(___hp+1,i,___INT(val)), \
4654 ___STORE_U16(___hp+1,i,___INT(val)), \
4655 ___STORE_U32(___hp+1,i,___INT(val)));
4656 #define ___END_ALLOC_STRING(n)___ALLOC(___WORDS(n<<___LCS)+1);
4657 #define ___GET_STRING(n)___TAG((___hp-___WORDS(n<<___LCS)-1),___tSUBTYPED)
4659 #define ___BEGIN_ALLOC_S8VECTOR(n) \
4660 ___hp[0]=___MAKE_HD_BYTES(n,___sS8VECTOR);
4661 #define ___ADD_S8VECTOR_ELEM(i,val)___STORE_S8(___hp+1,i,___INT(val));
4662 #define ___END_ALLOC_S8VECTOR(n)___ALLOC(___WORDS(n)+1);
4663 #define ___GET_S8VECTOR(n)___TAG((___hp-___WORDS(n)-1),___tSUBTYPED)
4665 #define ___BEGIN_ALLOC_U8VECTOR(n) \
4666 ___hp[0]=___MAKE_HD_BYTES(n,___sU8VECTOR);
4667 #define ___ADD_U8VECTOR_ELEM(i,val)___STORE_U8(___hp+1,i,___INT(val));
4668 #define ___END_ALLOC_U8VECTOR(n)___ALLOC(___WORDS(n)+1);
4669 #define ___GET_U8VECTOR(n)___TAG((___hp-___WORDS(n)-1),___tSUBTYPED)
4671 #define ___BEGIN_ALLOC_S16VECTOR(n) \
4672 ___hp[0]=___MAKE_HD_BYTES(n<<1,___sS16VECTOR);
4673 #define ___ADD_S16VECTOR_ELEM(i,val)___STORE_S16(___hp+1,i,___INT(val));
4674 #define ___END_ALLOC_S16VECTOR(n)___ALLOC(___WORDS(n<<1)+1);
4675 #define ___GET_S16VECTOR(n)___TAG((___hp-___WORDS(n<<1)-1),___tSUBTYPED)
4677 #define ___BEGIN_ALLOC_U16VECTOR(n) \
4678 ___hp[0]=___MAKE_HD_BYTES(n<<1,___sU16VECTOR);
4679 #define ___ADD_U16VECTOR_ELEM(i,val)___STORE_U16(___hp+1,i,___INT(val));
4680 #define ___END_ALLOC_U16VECTOR(n)___ALLOC(___WORDS(n<<1)+1);
4681 #define ___GET_U16VECTOR(n)___TAG((___hp-___WORDS(n<<1)-1),___tSUBTYPED)
4683 #define ___BEGIN_ALLOC_S32VECTOR(n) \
4684 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sS32VECTOR);
4685 #define ___ADD_S32VECTOR_ELEM(i,val)___STORE_S32(___hp+1,i,___S32UNBOX(val));
4686 #define ___END_ALLOC_S32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4687 #define ___GET_S32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4689 #define ___BEGIN_ALLOC_U32VECTOR(n) \
4690 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sU32VECTOR);
4691 #define ___ADD_U32VECTOR_ELEM(i,val)___STORE_U32(___hp+1,i,___U32UNBOX(val));
4692 #define ___END_ALLOC_U32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4693 #define ___GET_U32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4695 #if ___SCMOBJ_WIDTH == 32
4697 #define ___BEGIN_ALLOC_S64VECTOR(n) \
4698 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4699 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sS64VECTOR);
4700 #define ___ADD_S64VECTOR_ELEM(i,val)___STORE_S64(___ptr,i,___S64UNBOX(val));
4701 #define ___END_ALLOC_S64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4702 #define ___GET_S64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4704 #define ___BEGIN_ALLOC_U64VECTOR(n) \
4705 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4706 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sU64VECTOR);
4707 #define ___ADD_U64VECTOR_ELEM(i,val)___STORE_U64(___ptr,i,___U64UNBOX(val));
4708 #define ___END_ALLOC_U64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4709 #define ___GET_U64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4711 #else
4713 #define ___BEGIN_ALLOC_S64VECTOR(n) \
4714 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sS64VECTOR);
4715 #define ___ADD_S64VECTOR_ELEM(i,val)___STORE_S64(___hp+1,i,___S64UNBOX(val));
4716 #define ___END_ALLOC_S64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4717 #define ___GET_S64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4719 #define ___BEGIN_ALLOC_U64VECTOR(n) \
4720 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sU64VECTOR);
4721 #define ___ADD_U64VECTOR_ELEM(i,val)___STORE_U64(___hp+1,i,___U64UNBOX(val));
4722 #define ___END_ALLOC_U64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4723 #define ___GET_U64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4725 #endif
4727 #define ___BEGIN_ALLOC_F32VECTOR(n) \
4728 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sF32VECTOR);
4729 #ifdef ___F32
4730 #define ___ADD_F32VECTOR_ELEM(i,val)((___F32*)(___hp+1))[i]=(val);
4731 #else
4732 #define ___ADD_F32VECTOR_ELEM(i,val);
4733 #endif
4734 #define ___END_ALLOC_F32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4735 #define ___GET_F32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4737 #if ___SCMOBJ_WIDTH == 32
4739 #define ___BEGIN_ALLOC_F64VECTOR(n) \
4740 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4741 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sF64VECTOR);
4742 #define ___ADD_F64VECTOR_ELEM(i,val)((___F64*)___ptr)[i]=(val);
4743 #define ___END_ALLOC_F64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4744 #define ___GET_F64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4746 #else
4748 #define ___BEGIN_ALLOC_F64VECTOR(n) \
4749 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sF64VECTOR);
4750 #define ___ADD_F64VECTOR_ELEM(i,val)((___F64*)(___hp+1))[i]=(val);
4751 #define ___END_ALLOC_F64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4752 #define ___GET_F64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4754 #endif
4756 #define ___BEGIN_ALLOC_VECTOR(n)___hp[0]=___MAKE_HD_WORDS(n,___sVECTOR);
4757 #define ___ADD_VECTOR_ELEM(i,val)___hp[i+1]=(val);
4758 #define ___END_ALLOC_VECTOR(n)___ALLOC(n+1);
4759 #define ___GET_VECTOR(n)___TAG((___hp-n-1),___tSUBTYPED)
4761 #define ___BEGIN_ALLOC_STRUCTURE(n)___hp[0]=___MAKE_HD_WORDS(n,___sSTRUCTURE);
4762 #define ___ADD_STRUCTURE_ELEM(i,val)___hp[i+1]=(val);
4763 #define ___END_ALLOC_STRUCTURE(n)___ALLOC(n+1);
4764 #define ___GET_STRUCTURE(n)___TAG((___hp-n-1),___tSUBTYPED)
4766 #define ___BEGIN_ALLOC_VALUES(n)___hp[0]=___MAKE_HD_WORDS(n,___sBOXVALUES);
4767 #define ___ADD_VALUES_ELEM(i,val)___hp[i+1]=(val);
4768 #define ___END_ALLOC_VALUES(n)___ALLOC(n+1);
4769 #define ___GET_VALUES(n)___TAG((___hp-n-1),___tSUBTYPED)
4771 #ifdef ___DEBUG_STACK_LIMIT
4772 #define ___POLL(n) \
4773 if (___EXPECT_FALSE(___fp<___ps->stack_trip)) \
4774 {___ps->temp1=___LBL(n); \
4775 ___ps->poll_file=__FILE__; \
4776 ___ps->poll_line=__LINE__; \
4777 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_stack_limit) \
4779 #else
4780 #define ___POLL(n) \
4781 if (___EXPECT_FALSE(___fp<___ps->stack_trip)) \
4782 {___ps->temp1=___LBL(n); \
4783 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_stack_limit) \
4785 #endif
4787 #define ___TASK_PUSH(i)
4788 #define ___TASK_POP(n)
4790 #ifdef ___DEBUG_HEAP_LIMIT
4791 #define ___CHECK_HEAP(n,m) \
4792 if (___EXPECT_FALSE(___hp>___ps->heap_limit)) \
4793 {___ps->temp1=___LBL(n); \
4794 ___ps->check_heap_file=__FILE__; \
4795 ___ps->check_heap_line=__LINE__; \
4796 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_heap_limit) \
4798 #else
4799 #define ___CHECK_HEAP(n,m) \
4800 if (___EXPECT_FALSE(___hp>___ps->heap_limit)) \
4801 {___ps->temp1=___LBL(n); \
4802 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_heap_limit) \
4804 #endif
4806 #define ___FORCE1(n,src) \
4807 if (___TYP((___temp=(src)))==___tSUBTYPED&&___SUBTYPE(___temp)==___sPROMISE<<___TB){___ps->temp1=___LBL(n);___ps->temp2=___temp;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_force);
4808 #define ___FORCE2 ___temp=___ps->temp2;}
4809 #define ___FORCE3 ___temp
4811 #define ___NB_INTRS 8
4812 #define ___INTR_USER 0
4813 #define ___INTR_HEARTBEAT 1
4814 #define ___INTR_GC 2
4815 #define ___INTR_TERMINATE 3
4816 #define ___INTR_4 4
4817 #define ___INTR_5 5
4818 #define ___INTR_6 6
4819 #define ___INTR_7 7
4821 #define ___MODULE_KIND 0
4822 #define ___LINKFILE_KIND 1
4824 #define ___CLIBEXT(f)f
4825 #define ___SETJMP(jmpbuf)setjmp (jmpbuf)
4826 #define ___LONGJMP(jmpbuf,val)longjmp (jmpbuf,val)
4827 #define ___EXT(f)f
4829 #ifdef ___BIND_LATE
4831 #ifndef ___CAN_IMPORT_CLIB_DYNAMICALLY
4832 #undef ___CLIBEXT
4833 #define ___CLIBEXT(f)(___GSTATE->f)
4834 #undef ___LOCAL_GSTATE
4835 #define ___LOCAL_GSTATE
4836 #endif
4838 #ifndef ___CAN_IMPORT_SETJMP_DYNAMICALLY
4839 #undef ___SETJMP
4840 #define ___SETJMP(x)(___GSTATE->setjmp) (x)
4841 #endif
4843 #ifndef ___CAN_IMPORT_DYNAMICALLY
4844 #undef ___EXT
4845 #define ___EXT(f)(___GSTATE->f)
4846 #undef ___LOCAL_GSTATE
4847 #define ___LOCAL_GSTATE
4848 #endif
4850 #endif
4852 #ifdef ___LOCAL_GSTATE
4854 #define ___GSTATE ___local_gstate
4855 #define ___GSTATE_DECL ___LOCAL ___global_state_struct *___local_gstate;
4856 #define ___SET_LOCAL_GSTATE(gs) ___local_gstate = gs;
4858 #else
4860 #define ___GSTATE (&___gstate)
4861 #define ___GSTATE_DECL ___IMP_DATA(___global_state_struct,___gstate);
4862 #define ___SET_LOCAL_GSTATE(gs)
4864 #endif
4866 #define ___PSTATE (&___GSTATE->pstate)
4868 #ifdef ___BIND_LATE
4870 #define ___NEED_SYM(sym)
4871 #define ___NEED_KEY(key)
4872 #define ___NEED_GLO(glo)
4874 #define ___BEGIN_SYM1 ___LOCAL ___UTF_8STRING ___sym_names[]={
4875 #define ___DEF_SYM1(i,sym,str)str,
4876 #define ___END_SYM1 0};
4878 #define ___DEF_SYM2(i,sym,str)
4880 #define ___BEGIN_KEY1 ___LOCAL ___UTF_8STRING ___key_names[]={
4881 #define ___DEF_KEY1(i,key,str)str,
4882 #define ___END_KEY1 0};
4884 #define ___DEF_KEY2(i,key,str)
4886 #define ___BEGIN_GLO ___LOCAL ___UTF_8STRING ___glo_names[]={
4887 #define ___DEF_GLO(i,str)str,
4888 #define ___END_GLO 0};
4890 #define ___BEGIN_OLD_KEY
4891 #define ___DEF_OLD_KEY(key)
4892 #define ___END_OLD_KEY
4894 #define ___BEGIN_OLD_SYM_GLO
4895 #define ___DEF_OLD_SYM_GLO(sym,glo)
4896 #define ___END_OLD_SYM_GLO
4898 #define ___BEGIN_NEW_KEY
4899 #define ___DEF_NEW_KEY(prevkey,key,str,hash)
4900 #define ___END_NEW_KEY
4902 #define ___BEGIN_NEW_SYM_GLO
4903 #define ___DEF_NEW_SYM_GLO_SUP(prevsym,sym,str,hash,glo)
4904 #define ___DEF_NEW_SYM_GLO(prevsym,sym,str,hash,glo)
4905 #define ___END_NEW_SYM_GLO(prevsym,prevkey)___LINKFILE_DESCR(0,0)
4907 #define ___DEF_SUB_NSTR(id,n)
4908 #define ___NSTR0
4909 #define ___NSTR1(a)
4910 #define ___NSTR2(a,b)
4911 #define ___NSTR3(a,b,c)
4912 #define ___NSTR4(a,b,c,d)
4913 #define ___NSTR5(a,b,c,d,e)
4914 #define ___NSTR6(a,b,c,d,e,f)
4915 #define ___NSTR7(a,b,c,d,e,f,g)
4916 #define ___NSTR8(a,b,c,d,e,f,g,h)
4918 #else
4920 #define ___NEED_SYM(sym)___IMP_DATA(___symkey_struct,sym);
4921 #define ___NEED_KEY(key)___IMP_DATA(___symkey_struct,key);
4922 #define ___NEED_GLO(glo)___IMP_DATA(___glo_struct,glo);
4924 #ifndef ___IMPORTED_ADR_IS_CONST
4926 #define ___BEGIN_SYM1 ___LOCAL ___FAKEWORD ___sym_tbl[___SYM_COUNT];
4927 #define ___DEF_SYM1(i,sym,str)
4928 #define ___END_SYM1
4930 #define ___DEF_SYM2(i,sym,str)___sym_tbl[i]=(___FAKEWORD)(sym);
4932 #define ___BEGIN_KEY1 ___LOCAL ___FAKEWORD ___key_tbl[___KEY_COUNT];
4933 #define ___DEF_KEY1(i,key,str)
4934 #define ___END_KEY1
4936 #define ___DEF_KEY2(i,key,str)___key_tbl[i]=(___FAKEWORD)(key);
4938 #else
4940 #define ___BEGIN_SYM1 ___LOCAL ___FAKEWORD ___sym_tbl[]={
4941 #define ___DEF_SYM1(i,sym,str)(___FAKEWORD)(sym),
4942 #define ___END_SYM1 0};
4944 #define ___DEF_SYM2(i,sym,str)
4946 #define ___BEGIN_KEY1 ___LOCAL ___FAKEWORD ___key_tbl[]={
4947 #define ___DEF_KEY1(i,key,str)(___FAKEWORD)(key),
4948 #define ___END_KEY1 0};
4950 #define ___DEF_KEY2(i,key,str)
4952 #endif
4954 #define ___BEGIN_GLO
4955 #define ___DEF_GLO(i,str)
4956 #define ___END_GLO
4958 #define ___BEGIN_OLD_KEY
4959 #define ___DEF_OLD_KEY(key)
4960 #define ___END_OLD_KEY
4962 #define ___BEGIN_OLD_SYM_GLO
4963 #define ___DEF_OLD_SYM_GLO(sym,glo)
4964 #define ___END_OLD_SYM_GLO
4966 #define ___BEGIN_NEW_KEY
4967 #define ___DEF_NEW_KEY(prevkey,key,str,hash) \
4968 ___EXP_DATA(___symkey_struct,key)={(___FAKEWORD)prevkey,(___FAKEWORD)str,0,0,0 ___PADDING};
4969 #define ___END_NEW_KEY
4971 #define ___BEGIN_NEW_SYM_GLO
4972 #define ___DEF_NEW_SYM_GLO_SUP(prevsym,sym,str,hash,glo) \
4973 ___EXP_DATA(___glo_struct,glo) = {___UNB2, ___FIX(hash), 0}; \
4974 ___EXP_DATA(___symkey_struct,sym)={(___FAKEWORD)prevsym,(___FAKEWORD)str,0,0,(___FAKEWORD)&glo ___PADDING};
4975 #define ___DEF_NEW_SYM_GLO(prevsym,sym,str,hash,glo) \
4976 ___EXP_DATA(___glo_struct,glo) = {___UNB1, ___FIX(hash), 0}; \
4977 ___EXP_DATA(___symkey_struct,sym)={(___FAKEWORD)prevsym,(___FAKEWORD)str,0,0,(___FAKEWORD)&glo ___PADDING};
4978 #define ___END_NEW_SYM_GLO(prevsym,prevkey)___LINKFILE_DESCR(prevsym,prevkey)
4980 #define ___DEF_SUB_NSTR(id,n) ___DEF_SUB_STR(id,n)
4981 #define ___NSTR0 ___STR0
4982 #define ___NSTR1(a) ___STR1(a)
4983 #define ___NSTR2(a,b) ___STR2(a,b)
4984 #define ___NSTR3(a,b,c) ___STR3(a,b,c)
4985 #define ___NSTR4(a,b,c,d) ___STR4(a,b,c,d)
4986 #define ___NSTR5(a,b,c,d,e) ___STR5(a,b,c,d,e)
4987 #define ___NSTR6(a,b,c,d,e,f) ___STR6(a,b,c,d,e,f)
4988 #define ___NSTR7(a,b,c,d,e,f,g) ___STR7(a,b,c,d,e,f,g)
4989 #define ___NSTR8(a,b,c,d,e,f,g,h) ___STR8(a,b,c,d,e,f,g,h)
4991 #endif
4993 #define ___BEGIN_CNS \
4994 ___LOCAL ___WORD ___cns_tbl[]={
4995 #define ___DEF_CNS(car,cdr)___MAKE_HD((___PAIR_SIZE<<___LWS),___sPAIR,___PERM),cdr,car
4996 #define ___END_CNS ___PADDING};
4998 #define ___BEGIN_SUB \
4999 ___LOCAL ___FAKEWORD ___sub_tbl[]={
5000 #define ___DEF_SUB(id)___CAST_WORDSTAR_TO_FAKEWORD(id)
5001 #define ___END_SUB };
5003 #define ___DEF_SUB_VEC(id,n) \
5004 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sVECTOR,___PERM)
5006 #define ___DEF_SUB_STRUCT(id,n) \
5007 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sSTRUCTURE,___PERM)/*****************/
5009 #define ___DEF_SUB_STRUCTURE(id,n) \
5010 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sSTRUCTURE,___PERM)
5012 #define ___DEF_SUB_BOX(id,n) \
5013 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sBOXVALUES,___PERM)
5015 #define ___DEF_SUB_STR(id,n) \
5016 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LCS),___sSTRING,___PERM)
5018 #define ___DEF_SUB_RAT(id,num,den) \
5019 ___LOCAL ___WORD id[]={___MAKE_HD((___RATNUM_SIZE<<___LWS),___sRATNUM,___PERM),num,den ___PADDING};
5021 #define ___DEF_SUB_FLO(id,hi,lo) \
5022 ___LOCAL ___WORD id[]={___MAKE_HD((___FLONUM_SIZE<<___LWS),___sFLONUM,___PERM) \
5023 ___F64VEC1(hi,lo)___F64VEC0
5025 #define ___DEF_SUB_CPX(id,real,imag) \
5026 ___LOCAL ___WORD id[]={___MAKE_HD((___CPXNUM_SIZE<<___LWS),___sCPXNUM,___PERM),real,imag ___PADDING};
5028 #define ___DEF_SUB_S8VEC(id,n) \
5029 ___LOCAL ___WORD id[]={___MAKE_HD(n,___sS8VECTOR,___PERM)
5031 #define ___DEF_SUB_U8VEC(id,n) \
5032 ___LOCAL ___WORD id[]={___MAKE_HD(n,___sU8VECTOR,___PERM)
5034 #define ___DEF_SUB_S16VEC(id,n) \
5035 ___LOCAL ___WORD id[]={___MAKE_HD((n<<1),___sS16VECTOR,___PERM)
5037 #define ___DEF_SUB_U16VEC(id,n) \
5038 ___LOCAL ___WORD id[]={___MAKE_HD((n<<1),___sU16VECTOR,___PERM)
5040 #define ___DEF_SUB_S32VEC(id,n) \
5041 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sS32VECTOR,___PERM)
5043 #define ___DEF_SUB_U32VEC(id,n) \
5044 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sU32VECTOR,___PERM)
5046 #define ___DEF_SUB_S64VEC(id,n) \
5047 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sS64VECTOR,___PERM)
5049 #define ___DEF_SUB_U64VEC(id,n) \
5050 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sU64VECTOR,___PERM)
5052 #define ___DEF_SUB_F32VEC(id,n) \
5053 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sF32VECTOR,___PERM)
5055 #define ___DEF_SUB_F64VEC(id,n) \
5056 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sF64VECTOR,___PERM)
5058 #if ___SCMOBJ_WIDTH == 32
5060 #ifdef ___BIG_ENDIAN
5062 #define ___P4U8(a,b,c,d)((((((___WORD)___CAST_U8(a)<<8)+(___WORD)___CAST_U8(b))<<8)+(___WORD)___CAST_U8(c))<<8)+(___WORD)___CAST_U8(d)
5064 #define ___P2U16(a,b)((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b)
5066 #define ___P1U32(a)a
5068 #define ___P1U64(hi,lo)hi,lo
5070 #else
5072 #define ___P4U8(d,c,b,a)((((((___WORD)___CAST_U8(a)<<8)+(___WORD)___CAST_U8(b))<<8)+(___WORD)___CAST_U8(c))<<8)+(___WORD)___CAST_U8(d)
5074 #define ___P2U16(b,a)((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b)
5076 #define ___P1U32(a)a
5078 #define ___P1U64(hi,lo)lo,hi
5080 #endif
5082 #define ___S8VEC0 ___PADDING};
5083 #define ___S8VEC1(a),___P4U8(a,0,0,0) ___PADDING};
5084 #define ___S8VEC2(a,b),___P4U8(a,b,0,0) ___PADDING};
5085 #define ___S8VEC3(a,b,c),___P4U8(a,b,c,0) ___PADDING};
5086 #define ___S8VEC4(a,b,c,d),___P4U8(a,b,c,d) ___PADDING};
5087 #define ___S8VEC5(a,b,c,d,e),___P4U8(a,b,c,d),___P4U8(e,0,0,0) ___PADDING};
5088 #define ___S8VEC6(a,b,c,d,e,f),___P4U8(a,b,c,d),___P4U8(e,f,0,0) ___PADDING};
5089 #define ___S8VEC7(a,b,c,d,e,f,g),___P4U8(a,b,c,d),___P4U8(e,f,g,0) ___PADDING};
5090 #define ___S8VEC8(a,b,c,d,e,f,g,h),___P4U8(a,b,c,d),___P4U8(e,f,g,h)
5092 #define ___U8VEC0 ___PADDING};
5093 #define ___U8VEC1(a),___P4U8(a,0,0,0) ___PADDING};
5094 #define ___U8VEC2(a,b),___P4U8(a,b,0,0) ___PADDING};
5095 #define ___U8VEC3(a,b,c),___P4U8(a,b,c,0) ___PADDING};
5096 #define ___U8VEC4(a,b,c,d),___P4U8(a,b,c,d) ___PADDING};
5097 #define ___U8VEC5(a,b,c,d,e),___P4U8(a,b,c,d),___P4U8(e,0,0,0) ___PADDING};
5098 #define ___U8VEC6(a,b,c,d,e,f),___P4U8(a,b,c,d),___P4U8(e,f,0,0) ___PADDING};
5099 #define ___U8VEC7(a,b,c,d,e,f,g),___P4U8(a,b,c,d),___P4U8(e,f,g,0) ___PADDING};
5100 #define ___U8VEC8(a,b,c,d,e,f,g,h),___P4U8(a,b,c,d),___P4U8(e,f,g,h)
5102 #define ___S16VEC0 ___PADDING};
5103 #define ___S16VEC1(a),___P2U16(a,0) ___PADDING};
5104 #define ___S16VEC2(a,b),___P2U16(a,b) ___PADDING};
5105 #define ___S16VEC3(a,b,c),___P2U16(a,b),___P2U16(c,0) ___PADDING};
5106 #define ___S16VEC4(a,b,c,d),___P2U16(a,b),___P2U16(c,d)
5108 #define ___U16VEC0 ___PADDING};
5109 #define ___U16VEC1(a),___P2U16(a,0) ___PADDING};
5110 #define ___U16VEC2(a,b),___P2U16(a,b) ___PADDING};
5111 #define ___U16VEC3(a,b,c),___P2U16(a,b),___P2U16(c,0) ___PADDING};
5112 #define ___U16VEC4(a,b,c,d),___P2U16(a,b),___P2U16(c,d)
5114 #define ___S32VEC0 ___PADDING};
5115 #define ___S32VEC1(a),___P1U32(a) ___PADDING};
5116 #define ___S32VEC2(a,b),___P1U32(a),___P1U32(b)
5118 #define ___U32VEC0 ___PADDING};
5119 #define ___U32VEC1(a),___P1U32(a) ___PADDING};
5120 #define ___U32VEC2(a,b),___P1U32(a),___P1U32(b)
5122 #else
5124 #ifdef ___BIG_ENDIAN
5126 #define ___P8U8(a,b,c,d,e,f,g,h)((((((((((((((___WORD)___CAST_U8(a)<<8)+(___WORD)___CAST_U8(b))<<8)+(___WORD)___CAST_U8(c))<<8)+(___WORD)___CAST_U8(d))<<8)+(___WORD)___CAST_U8(e))<<8)+(___WORD)___CAST_U8(f))<<8)+(___WORD)___CAST_U8(g))<<8)+(___WORD)___CAST_U8(h)
5128 #define ___P4U16(a,b,c,d)((((((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b))<<16)+(___WORD)___CAST_U16(c))<<16)+(___WORD)___CAST_U16(d)
5130 #define ___P2U32(a,b)((___WORD)___CAST_U32(a)<<32)+(___WORD)___CAST_U32(b)
5132 #else
5134 #define ___P8U8(h,g,f,e,d,c,b,a)((((((((((((((___WORD)___CAST_U8(a)<<8)+(___WORD)___CAST_U8(b))<<8)+(___WORD)___CAST_U8(c))<<8)+(___WORD)___CAST_U8(d))<<8)+(___WORD)___CAST_U8(e))<<8)+(___WORD)___CAST_U8(f))<<8)+(___WORD)___CAST_U8(g))<<8)+(___WORD)___CAST_U8(h)
5136 #define ___P4U16(d,c,b,a)((((((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b))<<16)+(___WORD)___CAST_U16(c))<<16)+(___WORD)___CAST_U16(d)
5138 #define ___P2U32(b,a)((___WORD)___CAST_U32(a)<<32)+(___WORD)___CAST_U32(b)
5140 #endif
5142 #define ___P1U64(hi,lo)((___WORD)(hi)<<32)+___CAST_U32(lo)
5144 #define ___S8VEC0 ___PADDING};
5145 #define ___S8VEC1(a),___P8U8(a,0,0,0,0,0,0,0) ___PADDING};
5146 #define ___S8VEC2(a,b),___P8U8(a,b,0,0,0,0,0,0) ___PADDING};
5147 #define ___S8VEC3(a,b,c),___P8U8(a,b,c,0,0,0,0,0) ___PADDING};
5148 #define ___S8VEC4(a,b,c,d),___P8U8(a,b,c,d,0,0,0,0) ___PADDING};
5149 #define ___S8VEC5(a,b,c,d,e),___P8U8(a,b,c,d,e,0,0,0) ___PADDING};
5150 #define ___S8VEC6(a,b,c,d,e,f),___P8U8(a,b,c,d,e,f,0,0) ___PADDING};
5151 #define ___S8VEC7(a,b,c,d,e,f,g),___P8U8(a,b,c,d,e,f,g,0) ___PADDING};
5152 #define ___S8VEC8(a,b,c,d,e,f,g,h),___P8U8(a,b,c,d,e,f,g,h)
5154 #define ___U8VEC0 ___PADDING};
5155 #define ___U8VEC1(a),___P8U8(a,0,0,0,0,0,0,0) ___PADDING};
5156 #define ___U8VEC2(a,b),___P8U8(a,b,0,0,0,0,0,0) ___PADDING};
5157 #define ___U8VEC3(a,b,c),___P8U8(a,b,c,0,0,0,0,0) ___PADDING};
5158 #define ___U8VEC4(a,b,c,d),___P8U8(a,b,c,d,0,0,0,0) ___PADDING};
5159 #define ___U8VEC5(a,b,c,d,e),___P8U8(a,b,c,d,e,0,0,0) ___PADDING};
5160 #define ___U8VEC6(a,b,c,d,e,f),___P8U8(a,b,c,d,e,f,0,0) ___PADDING};
5161 #define ___U8VEC7(a,b,c,d,e,f,g),___P8U8(a,b,c,d,e,f,g,0) ___PADDING};
5162 #define ___U8VEC8(a,b,c,d,e,f,g,h),___P8U8(a,b,c,d,e,f,g,h)
5164 #define ___S16VEC0 ___PADDING};
5165 #define ___S16VEC1(a),___P4U16(a,0,0,0) ___PADDING};
5166 #define ___S16VEC2(a,b),___P4U16(a,b,0,0) ___PADDING};
5167 #define ___S16VEC3(a,b,c),___P4U16(a,b,c,0) ___PADDING};
5168 #define ___S16VEC4(a,b,c,d),___P4U16(a,b,c,d)
5170 #define ___U16VEC0 ___PADDING};
5171 #define ___U16VEC1(a),___P4U16(a,0,0,0) ___PADDING};
5172 #define ___U16VEC2(a,b),___P4U16(a,b,0,0) ___PADDING};
5173 #define ___U16VEC3(a,b,c),___P4U16(a,b,c,0) ___PADDING};
5174 #define ___U16VEC4(a,b,c,d),___P4U16(a,b,c,d)
5176 #define ___S32VEC0 ___PADDING};
5177 #define ___S32VEC1(a),___P2U32(a,0) ___PADDING};
5178 #define ___S32VEC2(a,b),___P2U32(a,b)
5180 #define ___U32VEC0 ___PADDING};
5181 #define ___U32VEC1(a),___P2U32(a,0) ___PADDING};
5182 #define ___U32VEC2(a,b),___P2U32(a,b)
5184 #endif
5186 #define ___S64VEC0 ___PADDING_64};
5187 #define ___S64VEC1(hi,lo),___P1U64(hi,lo)
5189 #define ___U64VEC0 ___PADDING_64};
5190 #define ___U64VEC1(hi,lo),___P1U64(hi,lo)
5192 #define ___STR0 ___CS_SELECT( \
5193 ___U8VEC0, \
5194 ___U16VEC0, \
5195 ___U32VEC0)
5197 #define ___STR1(a)___CS_SELECT( \
5198 ___U8VEC1(a), \
5199 ___U16VEC1(a), \
5200 ___U32VEC1(a))
5202 #define ___STR2(a,b)___CS_SELECT( \
5203 ___U8VEC2(a,b), \
5204 ___U16VEC2(a,b), \
5205 ___U32VEC2(a,b)___U32VEC0)
5207 #define ___STR3(a,b,c)___CS_SELECT( \
5208 ___U8VEC3(a,b,c), \
5209 ___U16VEC3(a,b,c), \
5210 ___U32VEC2(a,b)___U32VEC1(c))
5212 #define ___STR4(a,b,c,d)___CS_SELECT( \
5213 ___U8VEC4(a,b,c,d), \
5214 ___U16VEC4(a,b,c,d)___U16VEC0, \
5215 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC0)
5217 #define ___STR5(a,b,c,d,e)___CS_SELECT( \
5218 ___U8VEC5(a,b,c,d,e), \
5219 ___U16VEC4(a,b,c,d)___U16VEC1(e), \
5220 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC1(e))
5222 #define ___STR6(a,b,c,d,e,f)___CS_SELECT( \
5223 ___U8VEC6(a,b,c,d,e,f), \
5224 ___U16VEC4(a,b,c,d)___U16VEC2(e,f), \
5225 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC0)
5227 #define ___STR7(a,b,c,d,e,f,g)___CS_SELECT( \
5228 ___U8VEC7(a,b,c,d,e,f,g), \
5229 ___U16VEC4(a,b,c,d)___U16VEC3(e,f,g), \
5230 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC1(g))
5232 #define ___STR8(a,b,c,d,e,f,g,h)___CS_SELECT( \
5233 ___U8VEC8(a,b,c,d,e,f,g,h), \
5234 ___U16VEC4(a,b,c,d)___U16VEC4(e,f,g,h), \
5235 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC2(g,h))
5237 #if ___BIG_ABASE_WIDTH == 32
5239 #define ___DEF_SUB_BIG(id,n) \
5240 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sBIGNUM,___PERM)
5242 #define ___BIG0 ___U32VEC0
5243 #define ___BIG1(a)___U32VEC1(a)
5244 #define ___BIG2(a,b)___U32VEC2(a,b)
5246 #else
5248 #define ___DEF_SUB_BIG(id,n) \
5249 ___LOCAL ___WORD id[]={___MAKE_HD((((n+1)>>1)<<3),___sBIGNUM,___PERM)
5251 #define ___BIG0 ___U64VEC0
5252 #define ___BIG1(a)___BIG2(a,(___WORD)((a) & -0x80000000)?-1:0)___U64VEC0
5253 #define ___BIG2(a,b)___U64VEC1(b,a)
5255 #endif
5257 #define ___DEF_SUB_BIGFIX(id,n)___DEF_SUB_BIG(id,n)
5259 #define ___BIGFIX0 ___BIG0
5260 #define ___BIGFIX1(a)___BIG1(a)
5261 #define ___BIGFIX2(a,b)___BIG2(a,b)
5263 #define ___F32VEC0 ___U32VEC0
5264 #define ___F32VEC1(a)___U32VEC1(a)
5265 #define ___F32VEC2(a,b)___U32VEC2(a,b)
5267 #define ___F64VEC0 ___U64VEC0
5268 #ifdef ___CRAY_FP_FORMAT
5269 #define ___F64VEC1(hi,lo)___U64VEC1( \
5270 ((hi&0x7ff00000==0)?hi: \
5271 ((hi&0x80000000)+((hi>>4)&0x7ff0000)+0x3c028000+((hi>>5)&0x7fff))), \
5272 ((hi&0x7ff00000==0)?0: \
5273 (((hi<<27)&0xf8000000)|((lo>>5)&0x7ffffff))))
5274 #else
5275 #define ___F64VEC1(hi,lo)___U64VEC1(hi,lo)
5276 #endif
5278 #define ___VEC0 ___PADDING};
5279 #define ___VEC1(a),a
5281 #define ___CEILING_DIV(n,m)(((n)+(m)-1)/(m))
5282 #define ___ROUND_TO_MULT(n,m)(___CEILING_DIV(n,m)*(m))
5283 #define ___BREAK_FRAME_NEXT 1/********************should be 0*/
5284 #define ___BREAK_FRAME_SPACE ___ROUND_TO_MULT(1,___FRAME_ALIGN)
5286 #define ___FRAME_SPACE(n)___ROUND_TO_MULT((n)+___FRAME_RESERVE,___FRAME_ALIGN)
5287 #define ___FRAME_RESERVE 3
5288 #define ___FRAME_ALIGN 4
5290 #define ___BEGIN_LBL \
5291 ___LOCAL ___label_struct ___lbl_tbl[]={
5292 #define ___DEF_LBL_INTRO(id,name,info,nlbls,cproc){___MAKE_HD((nlbls<<___LWS),___sVECTOR,___PERM),info,___CAST_VOIDSTAR_TO_FAKEVOIDSTAR(name),___CAST_HOST_TO_FAKEHOST(___CAST(___host,cproc))}
5293 #define ___DEF_LBL_PROC(id,nbp,nbc){___PRD(nbp,nbc),0,0,___CAST_HOST_TO_FAKEHOST(___SM(___MH_PROC,id))}
5294 #define ___DEF_LBL_RET(id,frm){___MAKE_HD((3<<___LWS),___sRETURN,___PERM),frm,0,___CAST_HOST_TO_FAKEHOST(___SM(___MH_PROC,id))}
5296 #define ___END_LBL ___PADDING_LBL};
5298 #ifdef ___OFD_COUNT
5299 #define ___OFD_TBL ___ofd_tbl,sizeof(___ofd_tbl)/sizeof(___WORD)
5300 #else
5301 #define ___OFD_TBL 0,0
5302 #endif
5304 #define ___BEGIN_OFD \
5305 ___LOCAL ___WORD ___ofd_tbl[]={
5306 #define ___END_OFD ___PADDING};
5308 #define ___DEF_OFD(kind,fs,link)(link<<16)+(fs<<2)+kind
5309 #define ___OFD_KIND(x)((x)&((1<<2)-1))
5310 #define ___OFD_FS(x)(((x)>>2)&((1<<14)-1))
5311 #define ___OFD_LINK(x)(((x)>>16)&((1<<14)-1))
5313 #define ___GCMAP0
5314 #define ___GCMAP1(a),a
5315 #if ___SCMOBJ_WIDTH == 32
5316 #define ___GCMAP2(a,b),a,b
5317 #else
5318 #define ___GCMAP2(a,b),((___WORD)b<<32)+___CAST_U32(a)
5319 #endif
5321 #define ___U64VEC0 ___PADDING_64};
5322 #define ___U64VEC1(hi,lo),___P1U64(hi,lo)
5324 #define ___PRD(nbparms,nbclosed) \
5325 ___MAKE_HD((nbclosed<<12)+nbparms,___sPROCEDURE,___PERM)
5326 #define ___PRD_NBPARMS(x)(((x)>>(___SB+___HTB))&((1<<12)-1))
5327 #define ___PRD_NBCLOSED(x)(((x)>>(___SB+___HTB+12))&((1<<12)-1))
5329 #define ___IFD(kind,fs,link,gcmap)(gcmap<<12)+(link<<7)+(fs<<2)+kind
5330 #define ___OFD(kind,fs,link,gcmap)___IFD(kind,0,0,0)
5331 #define ___IS_IFD(x)((x)&3)
5333 #define ___IFD_KIND(x)((x)&((1<<2)-1))
5334 #define ___IFD_FS(x)(((x)>>2)&((1<<5)-1))
5335 #define ___IFD_LINK(x)(((x)>>7)&((1<<5)-1))
5336 #define ___IFD_GCMAP(x)(((x)>>12)&((1<<20)-1))
5339 #define ___RETI_CFS_TO_FS(fs) \
5340 ___ROUND_TO_MULT(fs,___FRAME_ALIGN)+___FRAME_SPACE(___NB_GVM_REGS+1)-___FRAME_RESERVE
5342 #define ___RETI_GET_CFS(ra,fs) \
5343 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5344 if (___IS_IFD(descr)) \
5345 fs = ___IFD_FS(descr); \
5346 else \
5347 fs = ___OFD_FS(*(___WORD*)descr); }
5349 #define ___RETI_GET_FS(ra,fs) \
5350 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5351 if (___IS_IFD(descr)) \
5352 fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); \
5353 else \
5354 fs = ___RETI_CFS_TO_FS(___OFD_FS(*(___WORD*)descr)); }
5356 #define ___RETN_GET_FS(ra,fs) \
5357 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5358 if (___IS_IFD(descr)) \
5359 fs = ___IFD_FS(descr); \
5360 else \
5361 fs = ___OFD_FS(*(___WORD*)descr); }
5363 #define ___RETI_GET_FS_LINK(ra,fs,link) \
5364 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5365 if (___IS_IFD(descr)) \
5366 { fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); link = ___IFD_LINK(descr); } \
5367 else \
5368 { descr = *(___WORD*)descr; \
5369 fs = ___RETI_CFS_TO_FS(___OFD_FS(descr)); link = ___OFD_LINK(descr); } }
5371 #define ___RETN_GET_FS_LINK(ra,fs,link) \
5372 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5373 if (___IS_IFD(descr)) \
5374 { fs = ___IFD_FS(descr); link = ___IFD_LINK(descr); } \
5375 else \
5376 { descr = *(___WORD*)descr; \
5377 fs = ___OFD_FS(descr); link = ___OFD_LINK(descr); } }
5379 #define ___RETI_GET_FS_LINK_GCMAP(ra,fs,link,firstgcmap,nextgcmap) \
5380 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5381 if (___IS_IFD(descr)) \
5382 { fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); link = ___IFD_LINK(descr); \
5383 firstgcmap = ___IFD_GCMAP(descr); } \
5384 else \
5385 { nextgcmap = (___WORD*)descr; descr = *nextgcmap++; firstgcmap = *nextgcmap++; \
5386 fs = ___RETI_CFS_TO_FS(___OFD_FS(descr)); link = ___OFD_LINK(descr); } }
5388 #define ___RETN_GET_FS_LINK_GCMAP(ra,fs,link,firstgcmap,nextgcmap) \
5389 { ___WORD descr = ___LABEL_ENTRY_OR_DESCR(ra); \
5390 if (___IS_IFD(descr)) \
5391 { firstgcmap = ___IFD_GCMAP(descr); \
5392 fs = ___IFD_FS(descr); link = ___IFD_LINK(descr); } \
5393 else \
5394 { nextgcmap = (___WORD*)descr; descr = *nextgcmap++; firstgcmap = *nextgcmap++; \
5395 fs = ___OFD_FS(descr); link = ___OFD_LINK(descr); } }
5400 #define ___RETN 1
5401 #define ___RETI 2
5402 #define ___RETT 3
5404 #ifdef ___GLO_COUNT
5405 #ifdef ___BIND_LATE
5406 #define ___GLO_DECL ___LOCAL ___FAKEWORD ___glo_tbl[___GLO_COUNT];
5407 #define ___GLO_TBL ___glo_tbl,___GLO_COUNT,___SUP_COUNT,___glo_names
5408 #else
5409 #define ___GLO_DECL
5410 #define ___GLO_TBL 0,0,0,0
5411 #endif
5412 #else
5413 #define ___GLO_DECL
5414 #define ___GLO_TBL 0,0,0,0
5415 #endif
5417 #ifdef ___SYM_COUNT
5418 #ifdef ___BIND_LATE
5419 #define ___SYM_DECL ___LOCAL ___FAKEWORD ___sym_tbl[___SYM_COUNT];
5420 #define ___SYM_TBL ___sym_tbl,___SYM_COUNT,___sym_names
5421 #else
5422 #define ___SYM_DECL
5423 #define ___SYM_TBL ___sym_tbl,___SYM_COUNT,0
5424 #endif
5425 #else
5426 #define ___SYM_DECL
5427 #define ___SYM_TBL 0,0,0
5428 #endif
5430 #ifdef ___KEY_COUNT
5431 #ifdef ___BIND_LATE
5432 #define ___KEY_DECL ___LOCAL ___FAKEWORD ___key_tbl[___KEY_COUNT];
5433 #define ___KEY_TBL ___key_tbl,___KEY_COUNT,___key_names
5434 #else
5435 #define ___KEY_DECL
5436 #define ___KEY_TBL ___key_tbl,___KEY_COUNT,0
5437 #endif
5438 #else
5439 #define ___KEY_DECL
5440 #define ___KEY_TBL 0,0,0
5441 #endif
5443 #ifdef ___LBL_COUNT
5444 #define ___LBL_TBL &___lp,___lbl_tbl,___LBL_COUNT
5445 #else
5446 #define ___LBL_TBL 0,0,0
5447 #endif
5449 #ifdef ___CNS_COUNT
5450 #define ___CNS_TBL ___cns_tbl,___CNS_COUNT
5451 #else
5452 #define ___CNS_TBL 0,0
5453 #endif
5455 #ifdef ___SUB_COUNT
5456 #define ___SUB_TBL ___sub_tbl,___SUB_COUNT
5457 #else
5458 #define ___SUB_TBL 0,0
5459 #endif
5461 #define ___BEGIN_MOD1 ___LOCAL ___WORD ___init_proc ___PVOID{
5462 #define ___DEF_PRM(i,glo,n)___PRM(i,glo)=___GLO(i,glo)=___MLBL(n);
5463 #define ___END_MOD1 return ___FIX(___NO_ERR); }
5465 #define ___BEGIN_MOD2 ___LOCAL ___module_struct ___module_descr = { \
5466 ___VERSION, \
5467 ___MODULE_KIND, \
5468 ___MODULE_NAME, \
5469 ___SETUP_HOST_LABEL, \
5470 ___GLO_TBL, \
5471 ___SYM_TBL, \
5472 ___KEY_TBL, \
5473 ___LBL_TBL, \
5474 ___OFD_TBL, \
5475 ___CNS_TBL, \
5476 ___SUB_TBL, \
5477 ___init_proc, \
5478 ___SCRIPT_LINE, \
5480 0,0,0,0,0,0,0,0 \
5481 }; \
5482 ___BEGIN_C_LINKAGE \
5483 ___EXP_FUNC(___mod_or_lnk,___LINKER_ID) \
5484 ___P((___global_state_struct *___gs), \
5485 (___gs) \
5486 ___global_state_struct *___gs;) \
5488 ___SET_LOCAL_GSTATE(___gs)
5489 #define ___END_MOD2 \
5490 return (___mod_or_lnk)&___module_descr; \
5492 ___END_C_LINKAGE
5494 #ifdef ___LIBRARY
5496 #define ___MAIN_PROC
5498 #else
5500 #ifdef ___OS_WIN32
5501 #ifdef _WINDOWS
5503 #define ___MAIN_PROC \
5504 ___IMP_FUNC(int,___winmain) \
5505 ___P((HINSTANCE hInstance, \
5506 HINSTANCE hPrevInstance, \
5507 LPSTR lpCmdLine, \
5508 int nCmdShow, \
5509 ___mod_or_lnk (*linker)(___global_state_struct*), \
5510 char *script_line), \
5511 ()); \
5512 int WINAPI WinMain ___P((HINSTANCE hInstance, \
5513 HINSTANCE hPrevInstance, \
5514 LPSTR lpCmdLine, \
5515 int nCmdShow), \
5516 (hInstance, \
5517 hPrevInstance, \
5518 lpCmdLine, \
5519 nCmdShow) \
5520 HINSTANCE hInstance; \
5521 HINSTANCE hPrevInstance; \
5522 LPSTR lpCmdLine; \
5523 int nCmdShow;) \
5525 return ___winmain \
5526 (hInstance, \
5527 hPrevInstance, \
5528 lpCmdLine, \
5529 nCmdShow, \
5530 ___LINKER_ID, \
5531 ___SCRIPT_LINE); \
5534 #endif
5535 #endif
5537 #ifndef ___MAIN_PROC
5538 #ifdef _UNICODE
5540 #define ___MAIN_PROC \
5541 ___IMP_FUNC(int,___main_UCS_2) \
5542 ___P((int argc, \
5543 ___UCS_2STRING argv[], \
5544 ___mod_or_lnk (*linker)(___global_state_struct*), \
5545 char *script_line), \
5546 ()); \
5547 int wmain ___P((int argc, \
5548 wchar_t *argv[]), \
5549 (argc, \
5550 argv) \
5551 int argc; \
5552 wchar_t *argv[];) \
5554 return ___main_UCS_2 \
5555 (argc, \
5556 argv, \
5557 ___LINKER_ID, \
5558 ___SCRIPT_LINE); \
5561 #else
5563 #define ___MAIN_PROC \
5564 ___IMP_FUNC(int,___main_char) \
5565 ___P((int argc, \
5566 char *argv[], \
5567 ___mod_or_lnk (*linker)(___global_state_struct*), \
5568 char *script_line), \
5569 ()); \
5570 int main ___P((int argc, \
5571 char *argv[]), \
5572 (argc, \
5573 argv) \
5574 int argc; \
5575 char *argv[];) \
5577 return ___main_char \
5578 (argc, \
5579 argv, \
5580 ___LINKER_ID, \
5581 ___SCRIPT_LINE); \
5584 #endif
5585 #endif
5587 #endif
5589 #define ___LINKFILE_DESCR(sym_list,key_list) \
5590 ___LOCAL ___linkfile_struct ___linkfile_descr = { \
5591 ___VERSION, \
5592 ___LINKFILE_KIND, \
5593 ___LINKFILE_NAME, \
5594 sym_list, \
5595 key_list, \
5596 ___linker_tbl, \
5597 0,0,0,0,0,0,0,0 \
5598 }; \
5599 ___BEGIN_C_LINKAGE \
5600 ___EXP_FUNC(___mod_or_lnk,___LINKER_ID) \
5601 ___P((___global_state_struct *___gs), \
5602 (___gs) \
5603 ___global_state_struct *___gs;) \
5605 ___SET_LOCAL_GSTATE(___gs) \
5606 return (___mod_or_lnk)&___linkfile_descr; \
5608 ___END_C_LINKAGE \
5609 ___MAIN_PROC
5611 #define ___BEGIN_OLD_LNK
5612 #define ___DEF_OLD_LNK(id)___BEGIN_C_LINKAGE ___IMP_FUNC(___mod_or_lnk,id) \
5613 ___P((___global_state_struct *___gs),()); ___END_C_LINKAGE
5614 #define ___END_OLD_LNK
5616 #define ___BEGIN_NEW_LNK
5617 #define ___DEF_NEW_LNK(id)___BEGIN_C_LINKAGE ___mod_or_lnk id \
5618 ___P((___global_state_struct *___gs),()); ___END_C_LINKAGE
5619 #define ___END_NEW_LNK
5621 #define ___BEGIN_LNK ___LOCAL void *___linker_tbl[]={
5622 #define ___DEF_LNK(id)(void*)id
5623 #define ___END_LNK ,0};
5625 /*---------------------------------------------------------------------------*/
5628 * ___ERR_CODE is a type which represents the union of error codes
5629 * from various subsystems. Currently 6 types of error codes are
5630 * supported: Windows HRESULT, MACOS errors, ANSI-C errno, netdb
5631 * h_errno, getaddrinfo error codes, and system specific error codes.
5632 * A Windows HRESULT error code is a 32 bit signed integer value
5633 * composed of (starting with the low bits) a 16 bit status code, a 11
5634 * bit facility code, a 4 bit reserved facility code and a 1 bit
5635 * severity code (negative means error). It seems that only the 4
5636 * lower bits of the facility code are really used, the remaining 7
5637 * bits are zero. This allows us to compact this 32 bit integer value
5638 * to a 30 bit integer value (which fits in a fixnum) by dropping the
5639 * top 2 bits of the facility code. Of the 512 possible facility
5640 * codes, the codes 448 to 511 are assigned to Gambit specific error
5641 * codes, the codes 384 to 447 are assigned to MACOS errors, the codes
5642 * 320 to 382 are assigned to ANSI-C errno error codes, the code 319
5643 * is assigned to netdb h_errno error codes, and the code 318 is
5644 * assigned to getaddrinfo error codes. The ``no error'' error code
5645 * of each subsystem is always mapped to ___NO_ERR which is equal to
5646 * 0, all other error codes are thus negative values.
5649 #define ___ERR_CODE int
5651 #define ___ERR_CODE_FACILITY_SYSTEM 448
5652 #define ___ERR_CODE_FACILITY_MACOS 384
5653 #define ___ERR_CODE_FACILITY_ERRNO 320
5654 #define ___ERR_CODE_FACILITY_H_ERRNO 319
5655 #define ___ERR_CODE_FACILITY_GAI_CODE 318
5657 #define ___ERR_CODE_BUILD(facility,code) \
5658 ((___CAST(___ERR_CODE,-1)<<29)+(___CAST(___ERR_CODE,facility)<<16)+(code))
5660 #define ___ERR_CODE_FACILITY(err)(((err)>>16)&~(~___CAST(___ERR_CODE,0)<<9))
5662 #define ___HRESULT_ERR(hresult) \
5663 (((hresult)&~(~___CAST(___ERR_CODE,0)<<25)) | \
5664 (((hresult)&~___CAST(___ERR_CODE,0)<<27)>>2))
5666 #define ___HRESULT_FROM_ERR_CODE(err) \
5667 (((err)&~(~___CAST(___ERR_CODE,0)<<25)) | \
5668 (((err)&~___CAST(___ERR_CODE,0)<<25)<<2))
5670 #define ___WIN32_ERR(win32err) \
5671 ___HRESULT_ERR(HRESULT_FROM_WIN32(win32err))
5673 #define ___WIN32_FROM_ERR_CODE(err) \
5674 HRESULT_CODE(___HRESULT_FROM_ERR_CODE(err))
5676 #define ___MACOS_ERR(oserr) \
5677 ((oserr)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_MACOS,oserr))
5679 #define ___MACOS_FROM_ERR_CODE(err) \
5680 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_MACOS,0)))
5682 #define ___ERRNO_ERR(errno) \
5683 ((errno)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_ERRNO,errno))
5685 #define ___ERRNO_FROM_ERR_CODE(err) \
5686 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_ERRNO,0)))
5688 #define ___H_ERRNO_ERR(h_errno) \
5689 ((h_errno)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_H_ERRNO,(h_errno)))
5691 #define ___H_ERRNO_FROM_ERR_CODE(err) \
5692 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_H_ERRNO,0)))
5694 #define ___GAI_CODE_ERR(gai_code) \
5695 ((gai_code)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_GAI_CODE,(gai_code)))
5697 #define ___GAI_CODE_FROM_ERR_CODE(err) \
5698 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_GAI_CODE,0)))
5700 #define ___ERR_BASE ___ERR_CODE_BUILD(___ERR_CODE_FACILITY_SYSTEM,0)
5702 #define ___NO_ERR 0
5703 #define ___UNWIND_C_STACK (___ERR_BASE+0)
5704 #define ___SFUN_HEAP_OVERFLOW_ERR (___ERR_BASE+1)
5705 #define ___IMPL_LIMIT_ERR (___ERR_BASE+2)
5706 #define ___UNKNOWN_ERR (___ERR_BASE+3)
5707 #define ___UNIMPL_ERR (___ERR_BASE+4)
5708 #define ___HEAP_OVERFLOW_ERR (___ERR_BASE+5)
5709 #define ___CLOSED_DEVICE_ERR (___ERR_BASE+6)
5710 #define ___INVALID_OP_ERR (___ERR_BASE+7)
5711 #define ___MODULE_VERSION_TOO_OLD_ERR (___ERR_BASE+8)
5712 #define ___MODULE_VERSION_TOO_NEW_ERR (___ERR_BASE+9)
5713 #define ___MODULE_ALREADY_LOADED_ERR (___ERR_BASE+10)
5714 #define ___DYNAMIC_LOADING_NOT_AVAILABLE_ERR (___ERR_BASE+11)
5715 #define ___DYNAMIC_LOADING_LOOKUP_ERR (___ERR_BASE+12)
5716 #define ___KILL_PUMP (___ERR_BASE+13)
5717 #define ___SELECT_SETUP_DONE (___ERR_BASE+14)
5718 #define ___STOC_BASE ___STOC_S8_ERR
5719 #define ___STOC_S8_ERR (___ERR_BASE+(1<<7))
5720 #define ___STOC_U8_ERR (___ERR_BASE+(2<<7))
5721 #define ___STOC_S16_ERR (___ERR_BASE+(3<<7))
5722 #define ___STOC_U16_ERR (___ERR_BASE+(4<<7))
5723 #define ___STOC_S32_ERR (___ERR_BASE+(5<<7))
5724 #define ___STOC_U32_ERR (___ERR_BASE+(6<<7))
5725 #define ___STOC_S64_ERR (___ERR_BASE+(7<<7))
5726 #define ___STOC_U64_ERR (___ERR_BASE+(8<<7))
5727 #define ___STOC_F32_ERR (___ERR_BASE+(9<<7))
5728 #define ___STOC_F64_ERR (___ERR_BASE+(10<<7))
5729 #define ___STOC_CHAR_ERR (___ERR_BASE+(11<<7))
5730 #define ___STOC_SCHAR_ERR (___ERR_BASE+(12<<7))
5731 #define ___STOC_UCHAR_ERR (___ERR_BASE+(13<<7))
5732 #define ___STOC_ISO_8859_1_ERR (___ERR_BASE+(14<<7))
5733 #define ___STOC_UCS_2_ERR (___ERR_BASE+(15<<7))
5734 #define ___STOC_UCS_4_ERR (___ERR_BASE+(16<<7))
5735 #define ___STOC_WCHAR_ERR (___ERR_BASE+(17<<7))
5736 #define ___STOC_SHORT_ERR (___ERR_BASE+(18<<7))
5737 #define ___STOC_USHORT_ERR (___ERR_BASE+(19<<7))
5738 #define ___STOC_INT_ERR (___ERR_BASE+(20<<7))
5739 #define ___STOC_UINT_ERR (___ERR_BASE+(21<<7))
5740 #define ___STOC_LONG_ERR (___ERR_BASE+(22<<7))
5741 #define ___STOC_ULONG_ERR (___ERR_BASE+(23<<7))
5742 #define ___STOC_LONGLONG_ERR (___ERR_BASE+(24<<7))
5743 #define ___STOC_ULONGLONG_ERR (___ERR_BASE+(25<<7))
5744 #define ___STOC_FLOAT_ERR (___ERR_BASE+(26<<7))
5745 #define ___STOC_DOUBLE_ERR (___ERR_BASE+(27<<7))
5746 #define ___STOC_STRUCT_ERR (___ERR_BASE+(28<<7))
5747 #define ___STOC_UNION_ERR (___ERR_BASE+(29<<7))
5748 #define ___STOC_TYPE_ERR (___ERR_BASE+(30<<7))
5749 #define ___STOC_POINTER_ERR (___ERR_BASE+(31<<7))
5750 #define ___STOC_NONNULLPOINTER_ERR (___ERR_BASE+(32<<7))
5751 #define ___STOC_FUNCTION_ERR (___ERR_BASE+(33<<7))
5752 #define ___STOC_NONNULLFUNCTION_ERR (___ERR_BASE+(34<<7))
5753 #define ___STOC_BOOL_ERR (___ERR_BASE+(35<<7))
5754 #define ___STOC_CHARSTRING_ERR (___ERR_BASE+(36<<7))
5755 #define ___STOC_NONNULLCHARSTRING_ERR (___ERR_BASE+(37<<7))
5756 #define ___STOC_NONNULLCHARSTRINGLIST_ERR (___ERR_BASE+(38<<7))
5757 #define ___STOC_ISO_8859_1STRING_ERR (___ERR_BASE+(39<<7))
5758 #define ___STOC_NONNULLISO_8859_1STRING_ERR (___ERR_BASE+(40<<7))
5759 #define ___STOC_NONNULLISO_8859_1STRINGLIST_ERR (___ERR_BASE+(41<<7))
5760 #define ___STOC_UTF_8STRING_ERR (___ERR_BASE+(42<<7))
5761 #define ___STOC_NONNULLUTF_8STRING_ERR (___ERR_BASE+(43<<7))
5762 #define ___STOC_NONNULLUTF_8STRINGLIST_ERR (___ERR_BASE+(44<<7))
5763 #define ___STOC_UTF_16STRING_ERR (___ERR_BASE+(45<<7))
5764 #define ___STOC_NONNULLUTF_16STRING_ERR (___ERR_BASE+(46<<7))
5765 #define ___STOC_NONNULLUTF_16STRINGLIST_ERR (___ERR_BASE+(47<<7))
5766 #define ___STOC_UCS_2STRING_ERR (___ERR_BASE+(48<<7))
5767 #define ___STOC_NONNULLUCS_2STRING_ERR (___ERR_BASE+(49<<7))
5768 #define ___STOC_NONNULLUCS_2STRINGLIST_ERR (___ERR_BASE+(50<<7))
5769 #define ___STOC_UCS_4STRING_ERR (___ERR_BASE+(51<<7))
5770 #define ___STOC_NONNULLUCS_4STRING_ERR (___ERR_BASE+(52<<7))
5771 #define ___STOC_NONNULLUCS_4STRINGLIST_ERR (___ERR_BASE+(53<<7))
5772 #define ___STOC_WCHARSTRING_ERR (___ERR_BASE+(54<<7))
5773 #define ___STOC_NONNULLWCHARSTRING_ERR (___ERR_BASE+(55<<7))
5774 #define ___STOC_NONNULLWCHARSTRINGLIST_ERR (___ERR_BASE+(56<<7))
5775 #define ___STOC_VARIANT_ERR (___ERR_BASE+(57<<7))
5776 #define ___STOC_HEAP_OVERFLOW_ERR (___ERR_BASE+(58<<7))
5777 #define ___STOC_MAX (___ERR_BASE+(59<<7)-1)
5778 #define ___CTOS_BASE ___CTOS_S8_ERR
5779 #define ___CTOS_S8_ERR (___ERR_BASE+(65<<7))
5780 #define ___CTOS_U8_ERR (___ERR_BASE+(66<<7))
5781 #define ___CTOS_S16_ERR (___ERR_BASE+(67<<7))
5782 #define ___CTOS_U16_ERR (___ERR_BASE+(68<<7))
5783 #define ___CTOS_S32_ERR (___ERR_BASE+(69<<7))
5784 #define ___CTOS_U32_ERR (___ERR_BASE+(70<<7))
5785 #define ___CTOS_S64_ERR (___ERR_BASE+(71<<7))
5786 #define ___CTOS_U64_ERR (___ERR_BASE+(72<<7))
5787 #define ___CTOS_F32_ERR (___ERR_BASE+(73<<7))
5788 #define ___CTOS_F64_ERR (___ERR_BASE+(74<<7))
5789 #define ___CTOS_CHAR_ERR (___ERR_BASE+(75<<7))
5790 #define ___CTOS_SCHAR_ERR (___ERR_BASE+(76<<7))
5791 #define ___CTOS_UCHAR_ERR (___ERR_BASE+(77<<7))
5792 #define ___CTOS_ISO_8859_1_ERR (___ERR_BASE+(78<<7))
5793 #define ___CTOS_UCS_2_ERR (___ERR_BASE+(79<<7))
5794 #define ___CTOS_UCS_4_ERR (___ERR_BASE+(80<<7))
5795 #define ___CTOS_WCHAR_ERR (___ERR_BASE+(81<<7))
5796 #define ___CTOS_SHORT_ERR (___ERR_BASE+(82<<7))
5797 #define ___CTOS_USHORT_ERR (___ERR_BASE+(83<<7))
5798 #define ___CTOS_INT_ERR (___ERR_BASE+(84<<7))
5799 #define ___CTOS_UINT_ERR (___ERR_BASE+(85<<7))
5800 #define ___CTOS_LONG_ERR (___ERR_BASE+(86<<7))
5801 #define ___CTOS_ULONG_ERR (___ERR_BASE+(87<<7))
5802 #define ___CTOS_LONGLONG_ERR (___ERR_BASE+(88<<7))
5803 #define ___CTOS_ULONGLONG_ERR (___ERR_BASE+(89<<7))
5804 #define ___CTOS_FLOAT_ERR (___ERR_BASE+(90<<7))
5805 #define ___CTOS_DOUBLE_ERR (___ERR_BASE+(91<<7))
5806 #define ___CTOS_STRUCT_ERR (___ERR_BASE+(92<<7))
5807 #define ___CTOS_UNION_ERR (___ERR_BASE+(93<<7))
5808 #define ___CTOS_TYPE_ERR (___ERR_BASE+(94<<7))
5809 #define ___CTOS_POINTER_ERR (___ERR_BASE+(95<<7))
5810 #define ___CTOS_NONNULLPOINTER_ERR (___ERR_BASE+(96<<7))
5811 #define ___CTOS_FUNCTION_ERR (___ERR_BASE+(97<<7))
5812 #define ___CTOS_NONNULLFUNCTION_ERR (___ERR_BASE+(98<<7))
5813 #define ___CTOS_BOOL_ERR (___ERR_BASE+(99<<7))
5814 #define ___CTOS_CHARSTRING_ERR (___ERR_BASE+(100<<7))
5815 #define ___CTOS_NONNULLCHARSTRING_ERR (___ERR_BASE+(101<<7))
5816 #define ___CTOS_NONNULLCHARSTRINGLIST_ERR (___ERR_BASE+(102<<7))
5817 #define ___CTOS_ISO_8859_1STRING_ERR (___ERR_BASE+(103<<7))
5818 #define ___CTOS_NONNULLISO_8859_1STRING_ERR (___ERR_BASE+(104<<7))
5819 #define ___CTOS_NONNULLISO_8859_1STRINGLIST_ERR (___ERR_BASE+(105<<7))
5820 #define ___CTOS_UTF_8STRING_ERR (___ERR_BASE+(106<<7))
5821 #define ___CTOS_NONNULLUTF_8STRING_ERR (___ERR_BASE+(107<<7))
5822 #define ___CTOS_NONNULLUTF_8STRINGLIST_ERR (___ERR_BASE+(108<<7))
5823 #define ___CTOS_UTF_16STRING_ERR (___ERR_BASE+(109<<7))
5824 #define ___CTOS_NONNULLUTF_16STRING_ERR (___ERR_BASE+(110<<7))
5825 #define ___CTOS_NONNULLUTF_16STRINGLIST_ERR (___ERR_BASE+(111<<7))
5826 #define ___CTOS_UCS_2STRING_ERR (___ERR_BASE+(112<<7))
5827 #define ___CTOS_NONNULLUCS_2STRING_ERR (___ERR_BASE+(113<<7))
5828 #define ___CTOS_NONNULLUCS_2STRINGLIST_ERR (___ERR_BASE+(114<<7))
5829 #define ___CTOS_UCS_4STRING_ERR (___ERR_BASE+(115<<7))
5830 #define ___CTOS_NONNULLUCS_4STRING_ERR (___ERR_BASE+(116<<7))
5831 #define ___CTOS_NONNULLUCS_4STRINGLIST_ERR (___ERR_BASE+(117<<7))
5832 #define ___CTOS_WCHARSTRING_ERR (___ERR_BASE+(118<<7))
5833 #define ___CTOS_NONNULLWCHARSTRING_ERR (___ERR_BASE+(119<<7))
5834 #define ___CTOS_NONNULLWCHARSTRINGLIST_ERR (___ERR_BASE+(120<<7))
5835 #define ___CTOS_VARIANT_ERR (___ERR_BASE+(121<<7))
5836 #define ___CTOS_HEAP_OVERFLOW_ERR (___ERR_BASE+(122<<7))
5837 #define ___CTOS_MAX (___ERR_BASE+(123<<7)-1)
5839 #define ___RETURN_POS 127
5841 /*---------------------------------------------------------------------------*/
5843 #define ___USE_RC_ALLOCATION_FOR_FOREIGN
5845 #ifdef ___USE_RC_ALLOCATION_FOR_FOREIGN
5847 #define ___CPLUSPLUS_ASSIGN_NEW(var,type) \
5848 do { \
5849 void *___ptr = ___EXT(___alloc_rc) (sizeof (type)); \
5850 if (___ptr == 0) \
5851 var = 0; \
5852 else \
5853 var = new (___ptr) type; \
5854 } while (0)
5855 #define ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init) \
5856 do { \
5857 void *___ptr = ___EXT(___alloc_rc) (sizeof (type)); \
5858 if (___ptr == 0) \
5859 var = 0; \
5860 else \
5861 var = new (___ptr) type (init); \
5862 } while (0)
5863 #define ___CPLUSPLUS_DELETE_STRUCT(name,ptr) \
5864 do { \
5865 ___EXT(___release_rc) (ptr); \
5866 } while (0)
5867 #define ___CPLUSPLUS_DELETE_UNION(name,ptr) \
5868 do { \
5869 ___EXT(___release_rc) (ptr); \
5870 } while (0)
5871 #define ___CPLUSPLUS_DELETE_TYPE(name,ptr) \
5872 do { \
5873 ___CAST(name*,ptr)->~name (); \
5874 ___EXT(___release_rc) (ptr); \
5875 } while (0)
5877 #define ___C_ASSIGN_NEW(var,type) \
5878 do { \
5879 var = ___CAST(type*,___EXT(___alloc_rc) (sizeof (type)); \
5880 } while (0)
5881 #define ___C_ASSIGN_NEW_WITH_INIT(var,type,init) \
5882 do { \
5883 if ((var = ___CAST(type*,___EXT(___alloc_rc) (sizeof (type)))) != 0) \
5884 *___CAST(type*,var) = init; \
5885 } while (0)
5886 #define ___C_DELETE_STRUCT(name,ptr) \
5887 do { \
5888 ___EXT(___release_rc) (ptr); \
5889 } while (0)
5890 #define ___C_DELETE_UNION(name,ptr) \
5891 do { \
5892 ___EXT(___release_rc) (ptr); \
5893 } while (0)
5894 #define ___C_DELETE_TYPE(name,ptr) \
5895 do { \
5896 ___EXT(___release_rc) (ptr); \
5897 } while (0)
5899 #else
5901 #define ___CPLUSPLUS_ASSIGN_NEW(var,type) \
5902 do { \
5903 try { var = new type; } catch (std::bad_alloc) { var = 0; } \
5904 } while (0)
5905 #define ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init) \
5906 do { \
5907 try { var = new type (init); } catch (std::bad_alloc) { var = 0; } \
5908 } while (0)
5909 #define ___CPLUSPLUS_DELETE_STRUCT(name,ptr) \
5910 do { \
5911 delete ___CAST(struct name*,ptr); \
5912 } while (0)
5913 #define ___CPLUSPLUS_DELETE_UNION(name,ptr) \
5914 do { \
5915 delete ___CAST(union name*,ptr); \
5916 } while (0)
5917 #define ___CPLUSPLUS_DELETE_TYPE(name,ptr) \
5918 do { \
5919 delete ___CAST(name*,ptr); \
5920 } while (0)
5922 #define ___C_ASSIGN_NEW(var,type) \
5923 do { \
5924 var = ___CAST(type*,___EXT(___alloc_mem) (sizeof (type)); \
5925 } while (0)
5926 #define ___C_ASSIGN_NEW_WITH_INIT(var,type,init) \
5927 do { \
5928 if ((var = ___CAST(type*,___EXT(___alloc_mem) (sizeof (type)))) != 0) \
5929 *___CAST(type*,var) = init; \
5930 } while (0)
5931 #define ___C_DELETE_STRUCT(name,ptr) \
5932 do { \
5933 ___EXT(___free_mem) (ptr); \
5934 } while (0)
5935 #define ___C_DELETE_UNION(name,ptr) \
5936 do { \
5937 ___EXT(___free_mem) (ptr); \
5938 } while (0)
5939 #define ___C_DELETE_TYPE(name,ptr) \
5940 do { \
5941 ___EXT(___free_mem) (ptr); \
5942 } while (0)
5944 #endif
5946 #ifdef ___USE_CPLUSPLUS_NEW_DELETE
5948 #define ___ASSIGN_NEW(var,type) \
5949 ___CPLUSPLUS_ASSIGN_NEW(var,type)
5950 #define ___ASSIGN_NEW_WITH_INIT(var,type,init) \
5951 ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init)
5952 #define ___DELETE_STRUCT(name,ptr) ___CPLUSPLUS_DELETE_STRUCT(name,ptr)
5953 #define ___DELETE_UNION(name,ptr) ___CPLUSPLUS_DELETE_UNION(name,ptr)
5954 #define ___DELETE_TYPE(name,ptr) ___CPLUSPLUS_DELETE_TYPE(name,ptr)
5956 #else
5958 #define ___ASSIGN_NEW(var,type) \
5959 ___C_ASSIGN_NEW(var,type)
5960 #define ___ASSIGN_NEW_WITH_INIT(var,type,init) \
5961 ___C_ASSIGN_NEW_WITH_INIT(var,type,init)
5962 #define ___DELETE_STRUCT(name,ptr) ___C_DELETE_STRUCT(name,ptr)
5963 #define ___DELETE_UNION(name,ptr) ___C_DELETE_UNION(name,ptr)
5964 #define ___DELETE_TYPE(name,ptr) ___C_DELETE_TYPE(name,ptr)
5966 #endif
5968 #ifdef ___USE_CPLUSPLUS_CLEANUP
5970 #define ___BEGIN_CLEANUP(cleanup) \
5971 { struct ___cleanup { ~___cleanup () { cleanup; } } ___cleanup_object;
5972 #define ___END_CLEANUP(cleanup) \
5975 #else
5977 #define ___BEGIN_CLEANUP(cleanup) \
5979 #define ___END_CLEANUP(cleanup) \
5980 cleanup; }
5982 #endif
5984 #ifdef ___USE_SETJMP
5986 #define ___BEGIN_TRY \
5987 { ___jmpbuf_struct ___jbuf, *___old_catcher = ___ps->catcher; \
5988 ___ps->catcher = &___jbuf; ___err = ___SETJMP(___jbuf.buf); \
5989 if (___err==___FIX(___NO_ERR)) {
5990 #define ___END_TRY } ___ps->catcher = ___old_catcher; }
5991 #define ___THROW(e)___LONGJMP(___ps->catcher->buf, e)
5992 #define ___ON_THROW(stat1,stat2) \
5993 ___ON_THROW_AUX(___processor_state ___ps=___PSTATE;,stat1,stat2)
5995 #else
5997 #define ___BEGIN_TRY { ___err = ___FIX(___NO_ERR); try {
5998 #define ___END_TRY } catch (___throw_struct ts) { ___err = ts.err; } }
5999 #define ___THROW(e)do { ___throw_struct ts; ts.err = e; throw (ts); } while (0)
6000 #define ___ON_THROW(stat1,stat2) \
6001 ___ON_THROW_AUX(,stat1,stat2)
6003 #endif
6005 #define ___ON_THROW_AUX(decl,stat1,stat2) \
6006 do { \
6007 ___SCMOBJ ___err; decl \
6008 ___BEGIN_TRY stat1; ___END_TRY \
6009 if (___err != ___FIX(___NO_ERR)) stat2; \
6010 } while (0)
6012 #define ___RELEASE_POINTER ___EXT(___release_pointer)
6014 #define ___DEF_RELEASE_FN_STRUCT(name,id) \
6015 ___HIDDEN ___SCMOBJ id \
6016 ___P((void *___x), \
6017 (___x) \
6018 void *___x;) \
6019 { ___DELETE_STRUCT(name,___x); return ___FIX(___NO_ERR); }
6021 #define ___DEF_RELEASE_FN_UNION(name,id) \
6022 ___HIDDEN ___SCMOBJ id \
6023 ___P((void *___x), \
6024 (___x) \
6025 void *___x;) \
6026 { ___DELETE_UNION(name,___x); return ___FIX(___NO_ERR); }
6028 #define ___DEF_RELEASE_FN_TYPE(name,id) \
6029 ___HIDDEN ___SCMOBJ id \
6030 ___P((void *___x), \
6031 (___x) \
6032 void *___x;) \
6033 { ___DELETE_TYPE(name,___x); return ___FIX(___NO_ERR); }
6035 #define ___CFUN_CONV_ERROR if ((___err!=___FIX(___NO_ERR))&&(___err!=___FIX(___UNWIND_C_STACK))) {___ps->temp1=___err;___ps->temp2=___errmsg;___ps->temp3=___LBL(0);___JUMPEXTPRM(___SET_NARGS(___NARGS),___GSTATE->handler_cfun_conv_error;)}
6037 #define ___STOC3(f,s,c,i)___err=___EXT(f)(s,c,i)
6038 #define ___STOC4(f,s,c,t,i)___err=___EXT(f)(s,c,t,i)
6039 #define ___CTOS3(f,c,s,i)___err=___EXT(f)(c,s,i)
6040 #define ___CTOS5(f,c,t,r,s,i)___err=___EXT(f)(c,t,r,s,i)
6041 #define ___IF_STOC3(f,s,c,i)if ((___STOC3(f,s,c,i))==___FIX(___NO_ERR))
6042 #define ___IF_STOC4(f,s,c,t,i)if ((___STOC4(f,s,c,t,i))==___FIX(___NO_ERR))
6043 #define ___IF_CTOS3(f,c,s,i)if ((___CTOS3(f,c,s,i))==___FIX(___NO_ERR))
6044 #define ___IF_CTOS5(f,c,t,r,s,i)if ((___CTOS5(f,c,t,r,s,i))==___FIX(___NO_ERR))
6046 #define ___BEGIN_SFUN_BODY
6047 #define ___END_SFUN_BODY
6049 #define ___BEGIN_SFUN_VOID(proc) ___processor_state ___ps=___PSTATE;___SCMOBJ ___marker;___SCMOBJ ___err;___SCMOBJ ___errmsg=___FAL;if ((___err=___EXT(___make_sfun_stack_marker) (&___marker,proc))==___FIX(___NO_ERR)) {
6050 #define ___SFUN_CALL_VOID ___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker);
6051 #define ___SFUN_SET_RESULT_VOID /* no result to set */
6052 #define ___SFUN_ERROR_VOID while ((___err!=___FIX(___NO_ERR))&&(___err!=___FIX(___UNWIND_C_STACK))) {___ps->temp1=___err;___ps->temp2=___errmsg;___ps->temp3=___marker;___err=___EXT(___call) (0,___GSTATE->handler_sfun_conv_error,___marker);
6053 #define ___END_SFUN_VOID } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6055 #define ___BEGIN_SFUN_SCMOBJ(proc) ___processor_state ___ps=___PSTATE;___SCMOBJ ___marker;___SCMOBJ ___result;___SCMOBJ ___err;___SCMOBJ ___errmsg=___FAL;if ((___err=___EXT(___make_sfun_stack_marker) (&___marker,proc))==___FIX(___NO_ERR)) {
6056 #define ___SFUN_CALL_SCMOBJ ___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker);
6057 #define ___SFUN_SET_RESULT_SCMOBJ ___result = ___SFUN_RESULT;
6058 #define ___SFUN_ERROR_SCMOBJ while ((___err!=___FIX(___NO_ERR))&&(___err!=___FIX(___UNWIND_C_STACK))) {___ps->temp1=___err;___ps->temp2=___errmsg;___ps->temp3=___marker;___err=___EXT(___call) (0,___GSTATE->handler_sfun_conv_error,___marker);
6059 #define ___END_SFUN_SCMOBJ } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6061 #define ___BEGIN_SFUN(proc,decl)___processor_state ___ps=___PSTATE;___SCMOBJ ___marker;decl;___SCMOBJ ___err;___SCMOBJ ___errmsg=___FAL;if ((___err=___EXT(___make_sfun_stack_marker) (&___marker,proc))==___FIX(___NO_ERR)) {
6062 #define ___SFUN_CALL if ((___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker))==___FIX(___NO_ERR))
6063 #define ___SFUN_SET_RESULT /* done in conversion function */
6064 #define ___SFUN_ERROR while ((___err!=___FIX(___NO_ERR))&&(___err!=___FIX(___UNWIND_C_STACK))) {___ps->temp1=___err;___ps->temp2=___errmsg;___ps->temp3=___marker;if ((___err=___EXT(___call) (0,___GSTATE->handler_sfun_conv_error,___marker))==___FIX(___NO_ERR))
6065 #define ___END_SFUN } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6067 #define ___BEGIN_SFUN_ARG(i,arg)___SCMOBJ arg;
6068 #define ___END_SFUN_ARG(i)
6069 #define ___BEGIN_SFUN_ARG_SCMOBJ(i)
6070 #define ___END_SFUN_ARG_SCMOBJ(i)
6071 #define ___SFUN_ARG(i,arg)___PSSTK(___FRAME_SPACE(2)+i)=arg;
6072 #define ___SFUN_RESULT ___PSR1
6074 #define ___BEGIN_SFUN_SCMOBJ_TO_S8(s,c)___STOC3(___SCMOBJ_to_S8,s,&c,___RETURN_POS);
6075 #define ___END_SFUN_SCMOBJ_TO_S8(s,c)
6076 #define ___BEGIN_SFUN_SCMOBJ_TO_U8(s,c)___STOC3(___SCMOBJ_to_U8,s,&c,___RETURN_POS);
6077 #define ___END_SFUN_SCMOBJ_TO_U8(s,c)
6078 #define ___BEGIN_SFUN_SCMOBJ_TO_S16(s,c)___STOC3(___SCMOBJ_to_S16,s,&c,___RETURN_POS);
6079 #define ___END_SFUN_SCMOBJ_TO_S16(s,c)
6080 #define ___BEGIN_SFUN_SCMOBJ_TO_U16(s,c)___STOC3(___SCMOBJ_to_U16,s,&c,___RETURN_POS);
6081 #define ___END_SFUN_SCMOBJ_TO_U16(s,c)
6082 #define ___BEGIN_SFUN_SCMOBJ_TO_S32(s,c)___STOC3(___SCMOBJ_to_S32,s,&c,___RETURN_POS);
6083 #define ___END_SFUN_SCMOBJ_TO_S32(s,c)
6084 #define ___BEGIN_SFUN_SCMOBJ_TO_U32(s,c)___STOC3(___SCMOBJ_to_U32,s,&c,___RETURN_POS);
6085 #define ___END_SFUN_SCMOBJ_TO_U32(s,c)
6086 #define ___BEGIN_SFUN_SCMOBJ_TO_S64(s,c)___STOC3(___SCMOBJ_to_S64,s,&c,___RETURN_POS);
6087 #define ___END_SFUN_SCMOBJ_TO_S64(s,c)
6088 #define ___BEGIN_SFUN_SCMOBJ_TO_U64(s,c)___STOC3(___SCMOBJ_to_U64,s,&c,___RETURN_POS);
6089 #define ___END_SFUN_SCMOBJ_TO_U64(s,c)
6090 #define ___BEGIN_SFUN_SCMOBJ_TO_F32(s,c)___STOC3(___SCMOBJ_to_F32,s,&c,___RETURN_POS);
6091 #define ___END_SFUN_SCMOBJ_TO_F32(s,c)
6092 #define ___BEGIN_SFUN_SCMOBJ_TO_F64(s,c)___STOC3(___SCMOBJ_to_F64,s,&c,___RETURN_POS);
6093 #define ___END_SFUN_SCMOBJ_TO_F64(s,c)
6094 #define ___BEGIN_SFUN_SCMOBJ_TO_CHAR(s,c)___STOC3(___SCMOBJ_to_CHAR,s,&c,___RETURN_POS);
6095 #define ___END_SFUN_SCMOBJ_TO_CHAR(s,c)
6096 #define ___BEGIN_SFUN_SCMOBJ_TO_SCHAR(s,c)___STOC3(___SCMOBJ_to_SCHAR,s,&c,___RETURN_POS);
6097 #define ___END_SFUN_SCMOBJ_TO_SCHAR(s,c)
6098 #define ___BEGIN_SFUN_SCMOBJ_TO_UCHAR(s,c)___STOC3(___SCMOBJ_to_UCHAR,s,&c,___RETURN_POS);
6099 #define ___END_SFUN_SCMOBJ_TO_UCHAR(s,c)
6100 #define ___BEGIN_SFUN_SCMOBJ_TO_ISO_8859_1(s,c)___STOC3(___SCMOBJ_to_ISO_8859_1,s,&c,___RETURN_POS);
6101 #define ___END_SFUN_SCMOBJ_TO_ISO_8859_1(s,c)
6102 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_2(s,c)___STOC3(___SCMOBJ_to_UCS_2,s,&c,___RETURN_POS);
6103 #define ___END_SFUN_SCMOBJ_TO_UCS_2(s,c)
6104 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_4(s,c)___STOC3(___SCMOBJ_to_UCS_4,s,&c,___RETURN_POS);
6105 #define ___END_SFUN_SCMOBJ_TO_UCS_4(s,c)
6106 #define ___BEGIN_SFUN_SCMOBJ_TO_WCHAR(s,c)___STOC3(___SCMOBJ_to_WCHAR,s,&c,___RETURN_POS);
6107 #define ___END_SFUN_SCMOBJ_TO_WCHAR(s,c)
6108 #define ___BEGIN_SFUN_SCMOBJ_TO_SHORT(s,c)___STOC3(___SCMOBJ_to_SHORT,s,&c,___RETURN_POS);
6109 #define ___END_SFUN_SCMOBJ_TO_SHORT(s,c)
6110 #define ___BEGIN_SFUN_SCMOBJ_TO_USHORT(s,c)___STOC3(___SCMOBJ_to_USHORT,s,&c,___RETURN_POS);
6111 #define ___END_SFUN_SCMOBJ_TO_USHORT(s,c)
6112 #define ___BEGIN_SFUN_SCMOBJ_TO_INT(s,c)___STOC3(___SCMOBJ_to_INT,s,&c,___RETURN_POS);
6113 #define ___END_SFUN_SCMOBJ_TO_INT(s,c)
6114 #define ___BEGIN_SFUN_SCMOBJ_TO_UINT(s,c)___STOC3(___SCMOBJ_to_UINT,s,&c,___RETURN_POS);
6115 #define ___END_SFUN_SCMOBJ_TO_UINT(s,c)
6116 #define ___BEGIN_SFUN_SCMOBJ_TO_LONG(s,c)___STOC3(___SCMOBJ_to_LONG,s,&c,___RETURN_POS);
6117 #define ___END_SFUN_SCMOBJ_TO_LONG(s,c)
6118 #define ___BEGIN_SFUN_SCMOBJ_TO_ULONG(s,c)___STOC3(___SCMOBJ_to_ULONG,s,&c,___RETURN_POS);
6119 #define ___END_SFUN_SCMOBJ_TO_ULONG(s,c)
6120 #define ___BEGIN_SFUN_SCMOBJ_TO_FLOAT(s,c)___STOC3(___SCMOBJ_to_FLOAT,s,&c,___RETURN_POS);
6121 #define ___END_SFUN_SCMOBJ_TO_FLOAT(s,c)
6122 #define ___BEGIN_SFUN_SCMOBJ_TO_DOUBLE(s,c)___STOC3(___SCMOBJ_to_DOUBLE,s,&c,___RETURN_POS);
6123 #define ___END_SFUN_SCMOBJ_TO_DOUBLE(s,c)
6124 #define ___BEGIN_SFUN_SCMOBJ_TO_STRUCT(n,s,c,t)___STOC4(___SCMOBJ_to_STRUCT,s,&c,t,___RETURN_POS);
6125 #define ___END_SFUN_SCMOBJ_TO_STRUCT(n,s,c,t)
6126 #define ___BEGIN_SFUN_SCMOBJ_TO_UNION(n,s,c,t)___STOC4(___SCMOBJ_to_UNION,s,&c,t,___RETURN_POS);
6127 #define ___END_SFUN_SCMOBJ_TO_UNION(n,s,c,t)
6128 #define ___BEGIN_SFUN_SCMOBJ_TO_TYPE(n,s,c,t)___STOC4(___SCMOBJ_to_TYPE,s,&c,t,___RETURN_POS);
6129 #define ___END_SFUN_SCMOBJ_TO_TYPE(n,s,c,t)
6130 #define ___BEGIN_SFUN_SCMOBJ_TO_POINTER(s,c,t)___STOC4(___SCMOBJ_to_POINTER,s,&c,t,___RETURN_POS);
6131 #define ___END_SFUN_SCMOBJ_TO_POINTER(s,c,t)
6132 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t)___STOC4(___SCMOBJ_to_NONNULLPOINTER,s,&c,t,___RETURN_POS);
6133 #define ___END_SFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t)
6134 #define ___BEGIN_SFUN_SCMOBJ_TO_FUNCTION(s,cnv,c)___STOC4(___SCMOBJ_to_FUNCTION,s,___CAST(void*,cnv),&c,___RETURN_POS);
6135 #define ___END_SFUN_SCMOBJ_TO_FUNCTION(s,cnv,c)
6136 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c)___STOC4(___SCMOBJ_to_NONNULLFUNCTION,s,___CAST(void*,cnv),&c,___RETURN_POS);
6137 #define ___END_SFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c)
6138 #define ___BEGIN_SFUN_SCMOBJ_TO_BOOL(s,c)___STOC3(___SCMOBJ_to_BOOL,s,&c,___RETURN_POS);
6139 #define ___END_SFUN_SCMOBJ_TO_BOOL(s,c)
6140 #define ___BEGIN_SFUN_SCMOBJ_TO_CHARSTRING(s,c)___STOC3(___SCMOBJ_to_CHARSTRING,s,&c,___RETURN_POS);
6141 #define ___END_SFUN_SCMOBJ_TO_CHARSTRING(s,c)
6142 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c)___STOC3(___SCMOBJ_to_NONNULLCHARSTRING,s,&c,___RETURN_POS);
6143 #define ___END_SFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c)
6144 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLCHARSTRINGLIST,s,&c,___RETURN_POS);
6145 #define ___END_SFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c)
6146 #define ___BEGIN_SFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c)___STOC3(___SCMOBJ_to_ISO_8859_1STRING,s,&c,___RETURN_POS);
6147 #define ___END_SFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c)
6148 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRING,s,&c,___RETURN_POS);
6149 #define ___END_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c)
6150 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST,s,&c,___RETURN_POS);
6151 #define ___END_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c)
6152 #define ___BEGIN_SFUN_SCMOBJ_TO_UTF_8STRING(s,c)___STOC3(___SCMOBJ_to_UTF_8STRING,s,&c,___RETURN_POS);
6153 #define ___END_SFUN_SCMOBJ_TO_UTF_8STRING(s,c)
6154 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_8STRING,s,&c,___RETURN_POS);
6155 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c)
6156 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_8STRINGLIST,s,&c,___RETURN_POS);
6157 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c)
6158 #define ___BEGIN_SFUN_SCMOBJ_TO_UTF_16STRING(s,c)___STOC3(___SCMOBJ_to_UTF_16STRING,s,&c,___RETURN_POS);
6159 #define ___END_SFUN_SCMOBJ_TO_UTF_16STRING(s,c)
6160 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_16STRING,s,&c,___RETURN_POS);
6161 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c)
6162 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_16STRINGLIST,s,&c,___RETURN_POS);
6163 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c)
6164 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_2STRING(s,c)___STOC3(___SCMOBJ_to_UCS_2STRING,s,&c,___RETURN_POS);
6165 #define ___END_SFUN_SCMOBJ_TO_UCS_2STRING(s,c)
6166 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_2STRING,s,&c,___RETURN_POS);
6167 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c)
6168 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_2STRINGLIST,s,&c,___RETURN_POS);
6169 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c)
6170 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_4STRING(s,c)___STOC3(___SCMOBJ_to_UCS_4STRING,s,&c,___RETURN_POS);
6171 #define ___END_SFUN_SCMOBJ_TO_UCS_4STRING(s,c)
6172 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_4STRING,s,&c,___RETURN_POS);
6173 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c)
6174 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_4STRINGLIST,s,&c,___RETURN_POS);
6175 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c)
6176 #define ___BEGIN_SFUN_SCMOBJ_TO_WCHARSTRING(s,c)___STOC3(___SCMOBJ_to_WCHARSTRING,s,&c,___RETURN_POS);
6177 #define ___END_SFUN_SCMOBJ_TO_WCHARSTRING(s,c)
6178 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c)___STOC3(___SCMOBJ_to_NONNULLWCHARSTRING,s,&c,___RETURN_POS);
6179 #define ___END_SFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c)
6180 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLWCHARSTRINGLIST,s,&c,___RETURN_POS);
6181 #define ___END_SFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c)
6182 #define ___BEGIN_SFUN_SCMOBJ_TO_VARIANT(s,c)___STOC3(___SCMOBJ_to_VARIANT,s,&c,___RETURN_POS);
6183 #define ___END_SFUN_SCMOBJ_TO_VARIANT(s,c)
6185 #define ___BEGIN_SFUN_S8_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S8_to_SCMOBJ,c,&s,i){
6186 #define ___END_SFUN_S8_TO_SCMOBJ(c,s,i)}
6187 #define ___BEGIN_SFUN_U8_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U8_to_SCMOBJ,c,&s,i){
6188 #define ___END_SFUN_U8_TO_SCMOBJ(c,s,i)}
6189 #define ___BEGIN_SFUN_S16_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S16_to_SCMOBJ,c,&s,i){
6190 #define ___END_SFUN_S16_TO_SCMOBJ(c,s,i)}
6191 #define ___BEGIN_SFUN_U16_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U16_to_SCMOBJ,c,&s,i){
6192 #define ___END_SFUN_U16_TO_SCMOBJ(c,s,i)}
6193 #define ___BEGIN_SFUN_S32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S32_to_SCMOBJ,c,&s,i){
6194 #define ___END_SFUN_S32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6195 #define ___BEGIN_SFUN_U32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U32_to_SCMOBJ,c,&s,i){
6196 #define ___END_SFUN_U32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6197 #define ___BEGIN_SFUN_S64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S64_to_SCMOBJ,c,&s,i){
6198 #define ___END_SFUN_S64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6199 #define ___BEGIN_SFUN_U64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U64_to_SCMOBJ,c,&s,i){
6200 #define ___END_SFUN_U64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6201 #define ___BEGIN_SFUN_F32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___F32_to_SCMOBJ,c,&s,i){
6202 #define ___END_SFUN_F32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6203 #define ___BEGIN_SFUN_F64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___F64_to_SCMOBJ,c,&s,i){
6204 #define ___END_SFUN_F64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6205 #define ___BEGIN_SFUN_CHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___CHAR_to_SCMOBJ,c,&s,i){
6206 #define ___END_SFUN_CHAR_TO_SCMOBJ(c,s,i)}
6207 #define ___BEGIN_SFUN_SCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___SCHAR_to_SCMOBJ,c,&s,i){
6208 #define ___END_SFUN_SCHAR_TO_SCMOBJ(c,s,i)}
6209 #define ___BEGIN_SFUN_UCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCHAR_to_SCMOBJ,c,&s,i){
6210 #define ___END_SFUN_UCHAR_TO_SCMOBJ(c,s,i)}
6211 #define ___BEGIN_SFUN_ISO_8859_1_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ISO_8859_1_to_SCMOBJ,c,&s,i){
6212 #define ___END_SFUN_ISO_8859_1_TO_SCMOBJ(c,s,i)}
6213 #define ___BEGIN_SFUN_UCS_2_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_2_to_SCMOBJ,c,&s,i){
6214 #define ___END_SFUN_UCS_2_TO_SCMOBJ(c,s,i)}
6215 #define ___BEGIN_SFUN_UCS_4_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_4_to_SCMOBJ,c,&s,i){
6216 #define ___END_SFUN_UCS_4_TO_SCMOBJ(c,s,i)}
6217 #define ___BEGIN_SFUN_WCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___WCHAR_to_SCMOBJ,c,&s,i){
6218 #define ___END_SFUN_WCHAR_TO_SCMOBJ(c,s,i)}
6219 #define ___BEGIN_SFUN_SHORT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___SHORT_to_SCMOBJ,c,&s,i){
6220 #define ___END_SFUN_SHORT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6221 #define ___BEGIN_SFUN_USHORT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___USHORT_to_SCMOBJ,c,&s,i){
6222 #define ___END_SFUN_USHORT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6223 #define ___BEGIN_SFUN_INT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___INT_to_SCMOBJ,c,&s,i){
6224 #define ___END_SFUN_INT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6225 #define ___BEGIN_SFUN_UINT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UINT_to_SCMOBJ,c,&s,i){
6226 #define ___END_SFUN_UINT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6227 #define ___BEGIN_SFUN_LONG_TO_SCMOBJ(c,s,i)___IF_CTOS3(___LONG_to_SCMOBJ,c,&s,i){
6228 #define ___END_SFUN_LONG_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6229 #define ___BEGIN_SFUN_ULONG_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ULONG_to_SCMOBJ,c,&s,i){
6230 #define ___END_SFUN_ULONG_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6231 #define ___BEGIN_SFUN_FLOAT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___FLOAT_to_SCMOBJ,c,&s,i){
6232 #define ___END_SFUN_FLOAT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6233 #define ___BEGIN_SFUN_DOUBLE_TO_SCMOBJ(c,s,i)___IF_CTOS3(___DOUBLE_to_SCMOBJ,c,&s,i){
6234 #define ___END_SFUN_DOUBLE_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6235 #define ___BEGIN_SFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___STRUCT_to_SCMOBJ,(void*)c,t,r,&s,i){
6236 #define ___END_SFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6237 #define ___BEGIN_SFUN_UNION_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___UNION_to_SCMOBJ,(void*)c,t,r,&s,i){
6238 #define ___END_SFUN_UNION_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6239 #define ___BEGIN_SFUN_TYPE_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___TYPE_to_SCMOBJ,(void*)c,t,r,&s,i){
6240 #define ___END_SFUN_TYPE_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6241 #define ___BEGIN_SFUN_POINTER_TO_SCMOBJ(c,t,r,s,i)___IF_CTOS5(___POINTER_to_SCMOBJ,(void*)c,t,r,&s,i){
6242 #define ___END_SFUN_POINTER_TO_SCMOBJ(c,t,r,s,i)___EXT(___release_scmobj)(s);}
6243 #define ___BEGIN_SFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s,i)___IF_CTOS5(___NONNULLPOINTER_to_SCMOBJ,(void*)c,t,r,&s,i){
6244 #define ___END_SFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s,i)___EXT(___release_scmobj)(s);}
6245 #define ___BEGIN_SFUN_FUNCTION_TO_SCMOBJ(c,s,i)___IF_CTOS3(___FUNCTION_to_SCMOBJ,___CAST(void*,c),&s,i){
6246 #define ___END_SFUN_FUNCTION_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6247 #define ___BEGIN_SFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLFUNCTION_to_SCMOBJ,___CAST(void*,c),&s,i){
6248 #define ___END_SFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6249 #define ___BEGIN_SFUN_BOOL_TO_SCMOBJ(c,s,i)___IF_CTOS3(___BOOL_to_SCMOBJ,c,&s,i){
6250 #define ___END_SFUN_BOOL_TO_SCMOBJ(c,s,i)}
6251 #define ___BEGIN_SFUN_CHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___CHARSTRING_to_SCMOBJ,c,&s,i){
6252 #define ___END_SFUN_CHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6253 #define ___BEGIN_SFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLCHARSTRING_to_SCMOBJ,c,&s,i){
6254 #define ___END_SFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6255 #define ___BEGIN_SFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLCHARSTRINGLIST_to_SCMOBJ,c,&s,i){
6256 #define ___END_SFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6257 #define ___BEGIN_SFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ISO_8859_1STRING_to_SCMOBJ,c,&s,i){
6258 #define ___END_SFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6259 #define ___BEGIN_SFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLISO_8859_1STRING_to_SCMOBJ,c,&s,i){
6260 #define ___END_SFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6261 #define ___BEGIN_SFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ,c,&s,i){
6262 #define ___END_SFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6263 #define ___BEGIN_SFUN_UTF_8STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UTF_8STRING_to_SCMOBJ,c,&s,i){
6264 #define ___END_SFUN_UTF_8STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6265 #define ___BEGIN_SFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_8STRING_to_SCMOBJ,c,&s,i){
6266 #define ___END_SFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6267 #define ___BEGIN_SFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_8STRINGLIST_to_SCMOBJ,c,&s,i){
6268 #define ___END_SFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6269 #define ___BEGIN_SFUN_UTF_16STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UTF_16STRING_to_SCMOBJ,c,&s,i){
6270 #define ___END_SFUN_UTF_16STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6271 #define ___BEGIN_SFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_16STRING_to_SCMOBJ,c,&s,i){
6272 #define ___END_SFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6273 #define ___BEGIN_SFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_16STRINGLIST_to_SCMOBJ,c,&s,i){
6274 #define ___END_SFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6275 #define ___BEGIN_SFUN_UCS_2STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_2STRING_to_SCMOBJ,c,&s,i){
6276 #define ___END_SFUN_UCS_2STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6277 #define ___BEGIN_SFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_2STRING_to_SCMOBJ,c,&s,i){
6278 #define ___END_SFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6279 #define ___BEGIN_SFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_2STRINGLIST_to_SCMOBJ,c,&s,i){
6280 #define ___END_SFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6281 #define ___BEGIN_SFUN_UCS_4STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_4STRING_to_SCMOBJ,c,&s,i){
6282 #define ___END_SFUN_UCS_4STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6283 #define ___BEGIN_SFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_4STRING_to_SCMOBJ,c,&s,i){
6284 #define ___END_SFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6285 #define ___BEGIN_SFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_4STRINGLIST_to_SCMOBJ,c,&s,i){
6286 #define ___END_SFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6287 #define ___BEGIN_SFUN_WCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___WCHARSTRING_to_SCMOBJ,c,&s,i){
6288 #define ___END_SFUN_WCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6289 #define ___BEGIN_SFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLWCHARSTRING_to_SCMOBJ,c,&s,i){
6290 #define ___END_SFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6291 #define ___BEGIN_SFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLWCHARSTRINGLIST_to_SCMOBJ,c,&s,i){
6292 #define ___END_SFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6293 #define ___BEGIN_SFUN_VARIANT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___VARIANT_to_SCMOBJ,c,&s,i){
6294 #define ___END_SFUN_VARIANT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6297 #define ___SFUN_CAST_AND_DEREF(type,arg)(*___CAST(type,arg))
6298 #define ___SFUN_CAST(type,arg)___CAST(type,arg)
6300 #define ___BEGIN_SFUN_COPY_STRUCT(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,struct n,arg);
6301 #define ___END_SFUN_COPY_STRUCT(n,r,arg)}
6302 #define ___BEGIN_SFUN_COPY_UNION(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,union n,arg);
6303 #define ___END_SFUN_COPY_UNION(n,r,arg)}
6304 #define ___BEGIN_SFUN_COPY_TYPE(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,n,arg);
6305 #define ___END_SFUN_COPY_TYPE(n,r,arg)}
6307 #define ___CFUN_CAST_AND_DEREF(type,arg)(*___CAST(type,arg))
6308 #define ___CFUN_CAST(type,arg)___CAST(type,arg)
6310 #define ___CFUN_CALL_VOID(call)call;
6311 #define ___CFUN_CALL(r,call)r = call;
6312 #define ___CFUN_CALL_STRUCT(n,r,call)___ASSIGN_NEW_WITH_INIT(r,struct n,call);
6313 #define ___CFUN_CALL_UNION(n,r,call)___ASSIGN_NEW_WITH_INIT(r,union n,call);
6314 #define ___CFUN_CALL_TYPE(n,r,call)___ASSIGN_NEW_WITH_INIT(r,n,call);
6315 #define ___CFUN_CALL_POINTER(r,call)r = call;
6316 #define ___CFUN_CALL_NONNULLPOINTER(r,call)r = call;
6317 #define ___CFUN_CALL_FUNCTION(r,call)r = call;
6318 #define ___CFUN_CALL_NONNULLFUNCTION(r,call)r = call;
6320 #define ___BEGIN_CFUN_BODY
6321 #define ___END_CFUN_BODY ___AT_END
6322 #define ___BEGIN_CFUN_BODY_CLEANUP ___W_ALL ___BEGIN_TRY
6323 #define ___END_CFUN_BODY_CLEANUP ___AT_END ___END_TRY ___R_ALL
6325 #define ___BEGIN_CFUN_VOID ___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___errmsg=___FAL;
6326 #define ___CFUN_SET_RESULT_VOID ___CFUN_RESULT = ___VOID;
6327 #define ___CFUN_ERROR_VOID ___CFUN_CONV_ERROR
6328 #define ___CFUN_ERROR_CLEANUP_VOID ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6329 #define ___END_CFUN_VOID } ___R_ALL
6331 #define ___BEGIN_CFUN_SCMOBJ ___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___result;___SCMOBJ ___errmsg=___FAL;
6332 #define ___CFUN_SET_RESULT_SCMOBJ ___CFUN_RESULT = ___result;
6333 #define ___CFUN_ERROR_SCMOBJ ___CFUN_CONV_ERROR
6334 #define ___CFUN_ERROR_CLEANUP_SCMOBJ ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6335 #define ___END_CFUN_SCMOBJ } ___R_ALL
6337 #define ___BEGIN_CFUN(decl)___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___errmsg=___FAL;decl;
6338 #define ___CFUN_SET_RESULT /* done in conversion function */
6339 #define ___CFUN_ERROR ___CFUN_CONV_ERROR
6340 #define ___CFUN_ERROR_CLEANUP ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6341 #define ___END_CFUN } ___R_ALL
6343 #define ___BEGIN_CFUN_ARG(i,decl)decl;
6344 #define ___END_CFUN_ARG(i)
6345 #define ___BEGIN_CFUN_ARG_SCMOBJ(i)
6346 #define ___END_CFUN_ARG_SCMOBJ(i)
6347 #define ___CFUN_ARG(i)___PSSTK((i-___FRAME_SPACE(___NARGS+1)))
6348 #define ___CFUN_RESULT ___PSR1
6350 #define ___BEGIN_CFUN_SCMOBJ_TO_S8(s,c,i)___IF_STOC3(___SCMOBJ_to_S8,s,&c,i){
6351 #define ___END_CFUN_SCMOBJ_TO_S8(s,c,i)}
6352 #define ___BEGIN_CFUN_SCMOBJ_TO_U8(s,c,i)___IF_STOC3(___SCMOBJ_to_U8,s,&c,i){
6353 #define ___END_CFUN_SCMOBJ_TO_U8(s,c,i)}
6354 #define ___BEGIN_CFUN_SCMOBJ_TO_S16(s,c,i)___IF_STOC3(___SCMOBJ_to_S16,s,&c,i){
6355 #define ___END_CFUN_SCMOBJ_TO_S16(s,c,i)}
6356 #define ___BEGIN_CFUN_SCMOBJ_TO_U16(s,c,i)___IF_STOC3(___SCMOBJ_to_U16,s,&c,i){
6357 #define ___END_CFUN_SCMOBJ_TO_U16(s,c,i)}
6358 #define ___BEGIN_CFUN_SCMOBJ_TO_S32(s,c,i)___IF_STOC3(___SCMOBJ_to_S32,s,&c,i){
6359 #define ___END_CFUN_SCMOBJ_TO_S32(s,c,i)}
6360 #define ___BEGIN_CFUN_SCMOBJ_TO_U32(s,c,i)___IF_STOC3(___SCMOBJ_to_U32,s,&c,i){
6361 #define ___END_CFUN_SCMOBJ_TO_U32(s,c,i)}
6362 #define ___BEGIN_CFUN_SCMOBJ_TO_S64(s,c,i)___IF_STOC3(___SCMOBJ_to_S64,s,&c,i){
6363 #define ___END_CFUN_SCMOBJ_TO_S64(s,c,i)}
6364 #define ___BEGIN_CFUN_SCMOBJ_TO_U64(s,c,i)___IF_STOC3(___SCMOBJ_to_U64,s,&c,i){
6365 #define ___END_CFUN_SCMOBJ_TO_U64(s,c,i)}
6366 #define ___BEGIN_CFUN_SCMOBJ_TO_F32(s,c,i)___IF_STOC3(___SCMOBJ_to_F32,s,&c,i){
6367 #define ___END_CFUN_SCMOBJ_TO_F32(s,c,i)}
6368 #define ___BEGIN_CFUN_SCMOBJ_TO_F64(s,c,i)___IF_STOC3(___SCMOBJ_to_F64,s,&c,i){
6369 #define ___END_CFUN_SCMOBJ_TO_F64(s,c,i)}
6370 #define ___BEGIN_CFUN_SCMOBJ_TO_CHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_CHAR,s,&c,i){
6371 #define ___END_CFUN_SCMOBJ_TO_CHAR(s,c,i)}
6372 #define ___BEGIN_CFUN_SCMOBJ_TO_SCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_SCHAR,s,&c,i){
6373 #define ___END_CFUN_SCMOBJ_TO_SCHAR(s,c,i)}
6374 #define ___BEGIN_CFUN_SCMOBJ_TO_UCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_UCHAR,s,&c,i){
6375 #define ___END_CFUN_SCMOBJ_TO_UCHAR(s,c,i)}
6376 #define ___BEGIN_CFUN_SCMOBJ_TO_ISO_8859_1(s,c,i)___IF_STOC3(___SCMOBJ_to_ISO_8859_1,s,&c,i){
6377 #define ___END_CFUN_SCMOBJ_TO_ISO_8859_1(s,c,i)}
6378 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_2(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_2,s,&c,i){
6379 #define ___END_CFUN_SCMOBJ_TO_UCS_2(s,c,i)}
6380 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_4(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_4,s,&c,i){
6381 #define ___END_CFUN_SCMOBJ_TO_UCS_4(s,c,i)}
6382 #define ___BEGIN_CFUN_SCMOBJ_TO_WCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_WCHAR,s,&c,i){
6383 #define ___END_CFUN_SCMOBJ_TO_WCHAR(s,c,i)}
6384 #define ___BEGIN_CFUN_SCMOBJ_TO_SHORT(s,c,i)___IF_STOC3(___SCMOBJ_to_SHORT,s,&c,i){
6385 #define ___END_CFUN_SCMOBJ_TO_SHORT(s,c,i)}
6386 #define ___BEGIN_CFUN_SCMOBJ_TO_USHORT(s,c,i)___IF_STOC3(___SCMOBJ_to_USHORT,s,&c,i){
6387 #define ___END_CFUN_SCMOBJ_TO_USHORT(s,c,i)}
6388 #define ___BEGIN_CFUN_SCMOBJ_TO_INT(s,c,i)___IF_STOC3(___SCMOBJ_to_INT,s,&c,i){
6389 #define ___END_CFUN_SCMOBJ_TO_INT(s,c,i)}
6390 #define ___BEGIN_CFUN_SCMOBJ_TO_UINT(s,c,i)___IF_STOC3(___SCMOBJ_to_UINT,s,&c,i){
6391 #define ___END_CFUN_SCMOBJ_TO_UINT(s,c,i)}
6392 #define ___BEGIN_CFUN_SCMOBJ_TO_LONG(s,c,i)___IF_STOC3(___SCMOBJ_to_LONG,s,&c,i){
6393 #define ___END_CFUN_SCMOBJ_TO_LONG(s,c,i)}
6394 #define ___BEGIN_CFUN_SCMOBJ_TO_ULONG(s,c,i)___IF_STOC3(___SCMOBJ_to_ULONG,s,&c,i){
6395 #define ___END_CFUN_SCMOBJ_TO_ULONG(s,c,i)}
6396 #define ___BEGIN_CFUN_SCMOBJ_TO_LONGLONG(s,c,i)___IF_STOC3(___SCMOBJ_to_LONGLONG,s,&c,i){
6397 #define ___END_CFUN_SCMOBJ_TO_LONGLONG(s,c,i)}
6398 #define ___BEGIN_CFUN_SCMOBJ_TO_ULONGLONG(s,c,i)___IF_STOC3(___SCMOBJ_to_ULONGLONG,s,&c,i){
6399 #define ___END_CFUN_SCMOBJ_TO_ULONGLONG(s,c,i)}
6400 #define ___BEGIN_CFUN_SCMOBJ_TO_FLOAT(s,c,i)___IF_STOC3(___SCMOBJ_to_FLOAT,s,&c,i){
6401 #define ___END_CFUN_SCMOBJ_TO_FLOAT(s,c,i)}
6402 #define ___BEGIN_CFUN_SCMOBJ_TO_DOUBLE(s,c,i)___IF_STOC3(___SCMOBJ_to_DOUBLE,s,&c,i){
6403 #define ___END_CFUN_SCMOBJ_TO_DOUBLE(s,c,i)}
6404 #define ___BEGIN_CFUN_SCMOBJ_TO_STRUCT(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_STRUCT,s,(void**)&c,t,i){
6405 #define ___END_CFUN_SCMOBJ_TO_STRUCT(n,s,c,t,i)}
6406 #define ___BEGIN_CFUN_SCMOBJ_TO_UNION(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_UNION,s,(void**)&c,t,i){
6407 #define ___END_CFUN_SCMOBJ_TO_UNION(n,s,c,t,i)}
6408 #define ___BEGIN_CFUN_SCMOBJ_TO_TYPE(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_TYPE,s,(void**)&c,t,i){
6409 #define ___END_CFUN_SCMOBJ_TO_TYPE(n,s,c,t,i)}
6410 #define ___BEGIN_CFUN_SCMOBJ_TO_POINTER(s,c,t,i)___IF_STOC4(___SCMOBJ_to_POINTER,s,(void**)&c,t,i){
6411 #define ___END_CFUN_SCMOBJ_TO_POINTER(s,c,t,i)}
6412 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t,i)___IF_STOC4(___SCMOBJ_to_NONNULLPOINTER,s,(void**)&c,t,i){
6413 #define ___END_CFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t,i)}
6414 #define ___BEGIN_CFUN_SCMOBJ_TO_FUNCTION(s,cnv,c,i)___IF_STOC4(___SCMOBJ_to_FUNCTION,s,(void*)cnv,(void**)&c,i){
6415 #define ___END_CFUN_SCMOBJ_TO_FUNCTION(s,cnv,c,i)___EXT(___release_function)(c);}
6416 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c,i)___IF_STOC4(___SCMOBJ_to_NONNULLFUNCTION,s,(void*)cnv,(void**)&c,i){
6417 #define ___END_CFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c,i)___EXT(___release_function)(c);}
6418 #define ___BEGIN_CFUN_SCMOBJ_TO_BOOL(s,c,i)___IF_STOC3(___SCMOBJ_to_BOOL,s,&c,i){
6419 #define ___END_CFUN_SCMOBJ_TO_BOOL(s,c,i)}
6420 #define ___BEGIN_CFUN_SCMOBJ_TO_CHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_CHARSTRING,s,&c,i){
6421 #define ___END_CFUN_SCMOBJ_TO_CHARSTRING(s,c,i)___EXT(___release_string)(c);}
6422 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLCHARSTRING,s,&c,i){
6423 #define ___END_CFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6424 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLCHARSTRINGLIST,s,&c,i){
6425 #define ___END_CFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6426 #define ___BEGIN_CFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_ISO_8859_1STRING,s,&c,i){
6427 #define ___END_CFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c,i)___EXT(___release_string)(c);}
6428 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRING,s,&c,i){
6429 #define ___END_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c,i)___EXT(___release_string)(c);}
6430 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST,s,&c,i){
6431 #define ___END_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6432 #define ___BEGIN_CFUN_SCMOBJ_TO_UTF_8STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UTF_8STRING,s,&c,i){
6433 #define ___END_CFUN_SCMOBJ_TO_UTF_8STRING(s,c,i)___EXT(___release_string)(c);}
6434 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_8STRING,s,&c,i){
6435 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c,i)___EXT(___release_string)(c);}
6436 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_8STRINGLIST,s,&c,i){
6437 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6438 #define ___BEGIN_CFUN_SCMOBJ_TO_UTF_16STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UTF_16STRING,s,&c,i){
6439 #define ___END_CFUN_SCMOBJ_TO_UTF_16STRING(s,c,i)___EXT(___release_string)(c);}
6440 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_16STRING,s,&c,i){
6441 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c,i)___EXT(___release_string)(c);}
6442 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_16STRINGLIST,s,&c,i){
6443 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6444 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_2STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_2STRING,s,&c,i){
6445 #define ___END_CFUN_SCMOBJ_TO_UCS_2STRING(s,c,i)___EXT(___release_string)(c);}
6446 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_2STRING,s,&c,i){
6447 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c,i)___EXT(___release_string)(c);}
6448 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_2STRINGLIST,s,&c,i){
6449 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6450 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_4STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_4STRING,s,&c,i){
6451 #define ___END_CFUN_SCMOBJ_TO_UCS_4STRING(s,c,i)___EXT(___release_string)(c);}
6452 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_4STRING,s,&c,i){
6453 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c,i)___EXT(___release_string)(c);}
6454 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_4STRINGLIST,s,&c,i){
6455 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6456 #define ___BEGIN_CFUN_SCMOBJ_TO_WCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_WCHARSTRING,s,&c,i){
6457 #define ___END_CFUN_SCMOBJ_TO_WCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6458 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLWCHARSTRING,s,&c,i){
6459 #define ___END_CFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6460 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLWCHARSTRINGLIST,s,&c,i){
6461 #define ___END_CFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6462 #define ___BEGIN_CFUN_SCMOBJ_TO_VARIANT(s,c,i)___IF_STOC3(___SCMOBJ_to_VARIANT,s,&c,i){
6463 #define ___END_CFUN_SCMOBJ_TO_VARIANT(s,c,i)___EXT(___release_variant)(c);}
6465 #define ___BEGIN_CFUN_S8_TO_SCMOBJ(c,s)___CTOS3(___S8_to_SCMOBJ,c,&s,___RETURN_POS);
6466 #define ___END_CFUN_S8_TO_SCMOBJ(c,s)
6467 #define ___BEGIN_CFUN_U8_TO_SCMOBJ(c,s)___CTOS3(___U8_to_SCMOBJ,c,&s,___RETURN_POS);
6468 #define ___END_CFUN_U8_TO_SCMOBJ(c,s)
6469 #define ___BEGIN_CFUN_S16_TO_SCMOBJ(c,s)___CTOS3(___S16_to_SCMOBJ,c,&s,___RETURN_POS);
6470 #define ___END_CFUN_S16_TO_SCMOBJ(c,s)
6471 #define ___BEGIN_CFUN_U16_TO_SCMOBJ(c,s)___CTOS3(___U16_to_SCMOBJ,c,&s,___RETURN_POS);
6472 #define ___END_CFUN_U16_TO_SCMOBJ(c,s)
6473 #define ___BEGIN_CFUN_S32_TO_SCMOBJ(c,s)___IF_CTOS3(___S32_to_SCMOBJ,c,&s,___RETURN_POS){
6474 #define ___END_CFUN_S32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6475 #define ___BEGIN_CFUN_U32_TO_SCMOBJ(c,s)___IF_CTOS3(___U32_to_SCMOBJ,c,&s,___RETURN_POS){
6476 #define ___END_CFUN_U32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6477 #define ___BEGIN_CFUN_S64_TO_SCMOBJ(c,s)___IF_CTOS3(___S64_to_SCMOBJ,c,&s,___RETURN_POS){
6478 #define ___END_CFUN_S64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6479 #define ___BEGIN_CFUN_U64_TO_SCMOBJ(c,s)___IF_CTOS3(___U64_to_SCMOBJ,c,&s,___RETURN_POS){
6480 #define ___END_CFUN_U64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6481 #define ___BEGIN_CFUN_F32_TO_SCMOBJ(c,s)___IF_CTOS3(___F32_to_SCMOBJ,c,&s,___RETURN_POS){
6482 #define ___END_CFUN_F32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6483 #define ___BEGIN_CFUN_F64_TO_SCMOBJ(c,s)___IF_CTOS3(___F64_to_SCMOBJ,c,&s,___RETURN_POS){
6484 #define ___END_CFUN_F64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6485 #define ___BEGIN_CFUN_CHAR_TO_SCMOBJ(c,s)___CTOS3(___CHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6486 #define ___END_CFUN_CHAR_TO_SCMOBJ(c,s)
6487 #define ___BEGIN_CFUN_SCHAR_TO_SCMOBJ(c,s)___CTOS3(___SCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6488 #define ___END_CFUN_SCHAR_TO_SCMOBJ(c,s)
6489 #define ___BEGIN_CFUN_UCHAR_TO_SCMOBJ(c,s)___CTOS3(___UCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6490 #define ___END_CFUN_UCHAR_TO_SCMOBJ(c,s)
6491 #define ___BEGIN_CFUN_ISO_8859_1_TO_SCMOBJ(c,s)___CTOS3(___ISO_8859_1_to_SCMOBJ,c,&s,___RETURN_POS);
6492 #define ___END_CFUN_ISO_8859_1_TO_SCMOBJ(c,s)
6493 #define ___BEGIN_CFUN_UCS_2_TO_SCMOBJ(c,s)___CTOS3(___UCS_2_to_SCMOBJ,c,&s,___RETURN_POS);
6494 #define ___END_CFUN_UCS_2_TO_SCMOBJ(c,s)
6495 #define ___BEGIN_CFUN_UCS_4_TO_SCMOBJ(c,s)___CTOS3(___UCS_4_to_SCMOBJ,c,&s,___RETURN_POS);
6496 #define ___END_CFUN_UCS_4_TO_SCMOBJ(c,s)
6497 #define ___BEGIN_CFUN_WCHAR_TO_SCMOBJ(c,s)___CTOS3(___WCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6498 #define ___END_CFUN_WCHAR_TO_SCMOBJ(c,s)
6499 #define ___BEGIN_CFUN_SHORT_TO_SCMOBJ(c,s)___IF_CTOS3(___SHORT_to_SCMOBJ,c,&s,___RETURN_POS){
6500 #define ___END_CFUN_SHORT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6501 #define ___BEGIN_CFUN_USHORT_TO_SCMOBJ(c,s)___IF_CTOS3(___USHORT_to_SCMOBJ,c,&s,___RETURN_POS){
6502 #define ___END_CFUN_USHORT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6503 #define ___BEGIN_CFUN_INT_TO_SCMOBJ(c,s)___IF_CTOS3(___INT_to_SCMOBJ,c,&s,___RETURN_POS){
6504 #define ___END_CFUN_INT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6505 #define ___BEGIN_CFUN_UINT_TO_SCMOBJ(c,s)___IF_CTOS3(___UINT_to_SCMOBJ,c,&s,___RETURN_POS){
6506 #define ___END_CFUN_UINT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6507 #define ___BEGIN_CFUN_LONG_TO_SCMOBJ(c,s)___IF_CTOS3(___LONG_to_SCMOBJ,c,&s,___RETURN_POS){
6508 #define ___END_CFUN_LONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6509 #define ___BEGIN_CFUN_ULONG_TO_SCMOBJ(c,s)___IF_CTOS3(___ULONG_to_SCMOBJ,c,&s,___RETURN_POS){
6510 #define ___END_CFUN_ULONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6511 #define ___BEGIN_CFUN_LONGLONG_TO_SCMOBJ(c,s)___IF_CTOS3(___LONGLONG_to_SCMOBJ,c,&s,___RETURN_POS){
6512 #define ___END_CFUN_LONGLONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6513 #define ___BEGIN_CFUN_ULONGLONG_TO_SCMOBJ(c,s)___IF_CTOS3(___ULONGLONG_to_SCMOBJ,c,&s,___RETURN_POS){
6514 #define ___END_CFUN_ULONGLONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6515 #define ___BEGIN_CFUN_FLOAT_TO_SCMOBJ(c,s)___IF_CTOS3(___FLOAT_to_SCMOBJ,c,&s,___RETURN_POS){
6516 #define ___END_CFUN_FLOAT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6517 #define ___BEGIN_CFUN_DOUBLE_TO_SCMOBJ(c,s)___IF_CTOS3(___DOUBLE_to_SCMOBJ,c,&s,___RETURN_POS){
6518 #define ___END_CFUN_DOUBLE_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6519 #define ___BEGIN_CFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___STRUCT_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6520 #define ___END_CFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6521 #define ___BEGIN_CFUN_UNION_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___UNION_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6522 #define ___END_CFUN_UNION_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6523 #define ___BEGIN_CFUN_TYPE_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___TYPE_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6524 #define ___END_CFUN_TYPE_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6525 #define ___BEGIN_CFUN_POINTER_TO_SCMOBJ(c,t,r,s)___IF_CTOS5(___POINTER_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6526 #define ___END_CFUN_POINTER_TO_SCMOBJ(c,t,r,s)___EXT(___release_scmobj)(s);}
6527 #define ___BEGIN_CFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s)___IF_CTOS5(___NONNULLPOINTER_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6528 #define ___END_CFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s)___EXT(___release_scmobj)(s);}
6529 #define ___BEGIN_CFUN_FUNCTION_TO_SCMOBJ(c,s)___IF_CTOS3(___FUNCTION_to_SCMOBJ,___CAST(void*,c),&s,___RETURN_POS){
6530 #define ___END_CFUN_FUNCTION_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6531 #define ___BEGIN_CFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLFUNCTION_to_SCMOBJ,___CAST(void*,c),&s,___RETURN_POS){
6532 #define ___END_CFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6533 #define ___BEGIN_CFUN_BOOL_TO_SCMOBJ(c,s)___CTOS3(___BOOL_to_SCMOBJ,c,&s,___RETURN_POS);
6534 #define ___END_CFUN_BOOL_TO_SCMOBJ(c,s)
6535 #define ___BEGIN_CFUN_CHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___CHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6536 #define ___END_CFUN_CHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6537 #define ___BEGIN_CFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6538 #define ___END_CFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6539 #define ___BEGIN_CFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLCHARSTRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6540 #define ___END_CFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6541 #define ___BEGIN_CFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___ISO_8859_1STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6542 #define ___END_CFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6543 #define ___BEGIN_CFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLISO_8859_1STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6544 #define ___END_CFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6545 #define ___BEGIN_CFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6546 #define ___END_CFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6547 #define ___BEGIN_CFUN_UTF_8STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UTF_8STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6548 #define ___END_CFUN_UTF_8STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6549 #define ___BEGIN_CFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_8STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6550 #define ___END_CFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6551 #define ___BEGIN_CFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_8STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6552 #define ___END_CFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6553 #define ___BEGIN_CFUN_UTF_16STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UTF_16STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6554 #define ___END_CFUN_UTF_16STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6555 #define ___BEGIN_CFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_16STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6556 #define ___END_CFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6557 #define ___BEGIN_CFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_16STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6558 #define ___END_CFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6559 #define ___BEGIN_CFUN_UCS_2STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UCS_2STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6560 #define ___END_CFUN_UCS_2STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6561 #define ___BEGIN_CFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_2STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6562 #define ___END_CFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6563 #define ___BEGIN_CFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_2STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6564 #define ___END_CFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6565 #define ___BEGIN_CFUN_UCS_4STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UCS_4STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6566 #define ___END_CFUN_UCS_4STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6567 #define ___BEGIN_CFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_4STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6568 #define ___END_CFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6569 #define ___BEGIN_CFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_4STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6570 #define ___END_CFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6571 #define ___BEGIN_CFUN_WCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___WCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6572 #define ___END_CFUN_WCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6573 #define ___BEGIN_CFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLWCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6574 #define ___END_CFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6575 #define ___BEGIN_CFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLWCHARSTRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6576 #define ___END_CFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6577 #define ___BEGIN_CFUN_VARIANT_TO_SCMOBJ(c,s)___IF_CTOS3(___VARIANT_to_SCMOBJ,c,&s,___RETURN_POS){
6578 #define ___END_CFUN_VARIANT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6580 #endif
6582 /*---------------------------------------------------------------------------*/
6584 #ifndef ___DEFINES_ONLY
6586 #ifdef _MSC_VER
6587 #ifdef ___DYNAMIC
6588 int _fltused; /* needed if floating-point used. */
6589 #endif
6590 #endif
6592 #ifdef __BORLANDC__
6593 #ifdef __WIN32__
6594 #ifndef ___OS_WIN32
6595 #define ___OS_WIN32
6596 #endif
6597 #endif
6598 #ifdef ___SHARED
6599 #define _RTLDLL
6600 #endif
6601 #endif
6603 #ifdef ___OS_WIN32
6605 #ifndef _WIN32_WINNT
6606 #define _WIN32_WINNT 0x0501
6607 #endif
6609 #ifndef ___DONT_HAVE_WINSOCK2_H
6610 #include <winsock2.h>
6611 #endif
6613 #ifndef ___DONT_HAVE_WINDOWS_H
6614 #include <windows.h>
6615 #endif
6617 #endif
6619 #ifdef ___USE_CPLUSPLUS_NEW_DELETE
6621 #ifndef ___DONT_HAVE_NEW
6622 #include <new>
6623 #endif
6625 #endif
6627 #ifndef ___DONT_HAVE_MATH_H
6628 #include <math.h>
6629 #endif
6631 #ifdef ___USE_SETJMP
6633 typedef struct ___jmpbuf_struct
6635 jmp_buf buf;
6636 } ___jmpbuf_struct;
6638 #else
6640 typedef struct ___throw_struct
6642 ___SCMOBJ err;
6643 } ___throw_struct;
6645 #endif
6647 typedef void *___VARIANT; /* not yet implemented */
6649 #ifdef ___BUILTIN_64BIT_INT_TYPE
6652 * If the symbol ___BUILTIN_64BIT_INT_TYPE is defined then the data
6653 * types ___S64 and ___U64 are builtin integer types.
6656 #define ___S64_from_SM32(val) \
6657 ___CAST_S64(___CAST_S32(val))
6659 #define ___S64_from_SM32_UM32(hi32,lo32) \
6660 ((___CAST_S64(___CAST_S32(hi32)) << 32) + ___CAST_S64(___CAST_U32(lo32)))
6662 #define ___S64_from_LONGLONG(val) \
6663 ___CAST_S64(val)
6665 #define ___S64_to_LONGLONG(val) \
6666 ___CAST(___LONGLONG,val)
6668 #define ___S64_fits_in_width(val,width) \
6669 ((((val) >> ((width)-1)) == 0) || (((val) >> ((width)-1)) == -1))
6671 #define ___S64_hi32(val)___CAST_S32((val) >> 32)
6672 #define ___S64_lo32(val)___CAST_U32(val)
6674 #define ___U64_from_UM32(val) \
6675 ___CAST_U64(___CAST_U32(val))
6677 #define ___U64_from_UM32_UM32(hi32,lo32) \
6678 ((___CAST_U64(___CAST_U32(hi32)) << 32) + ___CAST_U64(___CAST_U32(lo32)))
6680 #define ___U64_from_ULONGLONG(val) \
6681 ___CAST_U64(val)
6683 #define ___U64_to_ULONGLONG(val) \
6684 ___CAST(___ULONGLONG,val)
6686 #define ___U64_fits_in_width(val,width) \
6687 (((val) >> (width)) == 0)
6689 #define ___U64_mul_UM32_UM32(x,y) \
6690 (___CAST_U64(___CAST_U32(x)) * ___CAST_U32(y))
6692 #define ___U64_add_U64_U64(x,y) \
6693 (___CAST_U64(x) + ___CAST_U64(y))
6695 #define ___U64_hi32(val)___CAST_U32((val) >> 32)
6696 #define ___U64_lo32(val)___CAST_U32(val)
6698 #else
6701 * If the symbol ___BUILTIN_64BIT_INT_TYPE is not defined then the
6702 * data types ___S64 and ___U64 are structures.
6705 typedef struct
6707 #ifdef ___BIG_ENDIAN
6708 ___S32 hi32;
6709 ___U32 lo32;
6710 #else
6711 ___U32 lo32;
6712 ___S32 hi32;
6713 #endif
6714 } ___S64;
6716 typedef struct
6718 #ifdef ___BIG_ENDIAN
6719 ___U32 hi32;
6720 ___U32 lo32;
6721 #else
6722 ___U32 lo32;
6723 ___U32 hi32;
6724 #endif
6725 } ___U64;
6727 #define ___S64_from_SM32(val) \
6728 ___EXT(___S64_from_SM32_fn) (val)
6730 #define ___S64_from_SM32_UM32(hi32,lo32) \
6731 ___EXT(___S64_from_SM32_UM32_fn) (hi32,lo32)
6733 #define ___S64_from_LONGLONG(val) \
6734 ___EXT(___S64_from_LONGLONG_fn) (val)
6736 #define ___S64_to_LONGLONG(val) \
6737 ___EXT(___S64_to_LONGLONG_fn) (val)
6739 #define ___S64_fits_in_width(val,width) \
6740 ___EXT(___S64_fits_in_width_fn) (val,width)
6742 #define ___S64_hi32(val)val.hi32
6743 #define ___S64_lo32(val)val.lo32
6745 #define ___U64_from_UM32(val) \
6746 ___EXT(___U64_from_UM32_fn) (val)
6748 #define ___U64_from_UM32_UM32(hi32,lo32) \
6749 ___EXT(___U64_from_UM32_UM32_fn) (hi32,lo32)
6751 #define ___U64_from_ULONGLONG(val) \
6752 ___EXT(___U64_from_ULONGLONG_fn) (val)
6754 #define ___U64_to_ULONGLONG(val) \
6755 ___EXT(___U64_to_ULONGLONG_fn) (val)
6757 #define ___U64_fits_in_width(val,width) \
6758 ___EXT(___U64_fits_in_width_fn) (val,width)
6760 #define ___U64_mul_UM32_UM32(x,y) \
6761 ___EXT(___U64_mul_UM32_UM32_fn) (x,y)
6763 #define ___U64_add_U64_U64(x,y) \
6764 ___EXT(___U64_add_U64_U64_fn) (x,y)
6766 #define ___U64_hi32(val)val.hi32
6767 #define ___U64_lo32(val)val.lo32
6769 #endif
6771 /* Symbol/keyword structure */
6773 typedef ___FAKEWORD ___symkey_struct[5+___PADDING_SIZE];
6775 /* Global variable structure */
6777 typedef struct ___glo_struct
6779 ___WORD val, prm, next;
6780 } ___glo_struct;
6782 /* Processor structure */
6784 typedef struct ___processor_state_struct
6786 ___WORD *stack_trip;
6787 ___WORD *stack_limit;
6788 ___WORD *fp;
6789 ___WORD *stack_start;
6790 ___WORD *stack_break;
6792 ___WORD *heap_limit;
6793 ___WORD *hp;
6795 ___WORD current_thread;
6796 ___WORD run_queue;
6798 ___WORD r[___NB_GVM_REGS];
6799 ___WORD pc;
6800 ___WORD temp1;
6801 ___WORD temp2;
6802 ___WORD temp3;
6803 ___WORD temp4;
6805 int na;
6806 ___BOOL intr_enabled;
6807 ___BOOL intr_flag[___NB_INTRS];
6809 ___WORD glo_list_head;
6810 ___WORD glo_list_tail;
6812 ___WORD executable_wills;
6813 ___WORD nonexecutable_wills;
6815 void (*dummy8) ___PVOID;
6816 void (*dummy7) ___PVOID;
6817 void (*dummy6) ___PVOID;
6818 void (*dummy5) ___PVOID;
6819 void (*dummy4) ___PVOID;
6820 void (*dummy3) ___PVOID;
6821 void (*dummy2) ___PVOID;
6822 void (*dummy1) ___PVOID;
6824 #ifdef ___USE_SETJMP
6825 ___jmpbuf_struct *catcher;
6826 #endif
6828 #ifdef ___DEBUG_STACK_LIMIT
6829 int poll_line;
6830 char *poll_file;
6831 int stack_limit_line;
6832 char *stack_limit_file;
6833 #endif
6835 #ifdef ___DEBUG_HEAP_LIMIT
6836 int check_heap_line;
6837 char *check_heap_file;
6838 int heap_limit_line;
6839 char *heap_limit_file;
6840 #endif
6841 } ___processor_state_struct, *___processor_state;
6843 typedef ___WORD (*___host) ___P((___processor_state),());
6845 typedef struct ___label_struct
6847 ___WORD header;
6848 ___WORD entry_or_descr;
6849 ___FAKEVOIDSTAR host_label;
6850 ___FAKEHOST host;
6851 } ___label_struct;
6853 #ifdef ___LABEL_ACCESS_OLD
6855 #define ___LABEL_ENTRY_OR_DESCR(lbl)(___CAST(___label_struct*,(lbl)-___tSUBTYPED)->entry_or_descr)
6856 #define ___LABEL_HOST_LABEL(lbl)___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(___CAST(___label_struct*,(lbl)-___tSUBTYPED)->host_label)
6857 #define ___LABEL_HOST(lbl)___CAST_FAKEHOST_TO_HOST(___CAST(___label_struct*,(lbl)-___tSUBTYPED)->host)
6859 #else
6861 #define ___LABEL_ENTRY_OR_DESCR(lbl)(*___CAST(___WORD*,(lbl)+((1<<___LWS)-___tSUBTYPED)))
6862 #define ___LABEL_HOST_LABEL(lbl)(*___CAST(___FAKEVOIDSTAR*,(lbl)+((2<<___LWS)-___tSUBTYPED)))
6863 #define ___LABEL_HOST(lbl)(*___CAST(___FAKEHOST*,(lbl)+((3<<___LWS)-___tSUBTYPED)))
6865 #endif
6867 /* Module structure */
6869 typedef struct ___module_struct
6871 int version;
6872 int kind;
6873 ___UTF_8STRING name;
6874 int flags;
6875 ___FAKEWORD *glo_tbl; int glo_count; int sup_count;
6876 ___UTF_8STRING *glo_names;
6877 ___FAKEWORD *sym_tbl; int sym_count;
6878 ___UTF_8STRING *sym_names;
6879 ___FAKEWORD *key_tbl; int key_count;
6880 ___UTF_8STRING *key_names;
6881 ___WORD *lp;
6882 ___label_struct *lbl_tbl; int lbl_count;
6883 ___WORD *ofd_tbl; int ofd_length;
6884 ___WORD *cns_tbl; int cns_count;
6885 ___FAKEWORD *sub_tbl; int sub_count;
6886 ___WORD (*init_proc) ___PVOID;
6887 ___UTF_8STRING script_line;
6888 struct ___module_struct *next;
6890 void (*dummy8) ___PVOID;
6891 void (*dummy7) ___PVOID;
6892 void (*dummy6) ___PVOID;
6893 void (*dummy5) ___PVOID;
6894 void (*dummy4) ___PVOID;
6895 void (*dummy3) ___PVOID;
6896 void (*dummy2) ___PVOID;
6897 void (*dummy1) ___PVOID;
6898 } ___module_struct;
6900 /* Linkfile structure */
6902 typedef struct ___linkfile_struct
6904 int version;
6905 int kind;
6906 ___UTF_8STRING name;
6907 ___FAKEWORD *sym_list;
6908 ___FAKEWORD *key_list;
6909 void **linker_tbl;
6911 void (*dummy8) ___PVOID;
6912 void (*dummy7) ___PVOID;
6913 void (*dummy6) ___PVOID;
6914 void (*dummy5) ___PVOID;
6915 void (*dummy4) ___PVOID;
6916 void (*dummy3) ___PVOID;
6917 void (*dummy2) ___PVOID;
6918 void (*dummy1) ___PVOID;
6919 } ___linkfile_struct;
6921 /* Module or linkfile structure */
6923 typedef union ___mod_or_lnk_union
6925 ___module_struct module;
6926 ___linkfile_struct linkfile;
6927 } *___mod_or_lnk;
6929 /* Program startup information structure */
6931 typedef struct ___program_startup_info_struct
6933 ___UCS_2STRING *argv;
6934 ___UCS_2STRING script_line;
6936 #ifdef ___OS_WIN32
6938 HINSTANCE hInstance;
6939 HINSTANCE hPrevInstance;
6940 LPSTR lpCmdLine;
6941 int nCmdShow;
6943 #endif
6944 } ___program_startup_info_struct;
6946 /* Global state structure */
6948 typedef struct ___global_state_struct
6950 ___processor_state_struct pstate;
6952 ___F64 nb_gcs;
6953 ___F64 gc_user_time;
6954 ___F64 gc_sys_time;
6955 ___F64 gc_real_time;
6956 ___F64 bytes_allocated_minus_occupied;
6958 ___F64 last_gc_user_time;
6959 ___F64 last_gc_sys_time;
6960 ___F64 last_gc_real_time;
6961 ___F64 last_gc_heap_size;
6962 ___F64 last_gc_alloc;
6963 ___F64 last_gc_live;
6964 ___F64 last_gc_movable;
6965 ___F64 last_gc_nonmovable;
6967 ___WORD handler_sfun_conv_error;
6968 ___WORD handler_cfun_conv_error;
6969 ___WORD handler_stack_limit;
6970 ___WORD handler_heap_limit;
6971 ___WORD handler_not_proc;
6972 ___WORD handler_not_proc_glo;
6973 ___WORD handler_wrong_nargs;
6974 ___WORD handler_get_rest;
6975 ___WORD handler_get_key;
6976 ___WORD handler_get_key_rest;
6977 ___WORD handler_force;
6978 ___WORD handler_return_to_c;
6979 ___WORD handler_break;
6980 ___WORD internal_return;
6981 ___WORD dynamic_env_bind_return;
6983 ___SCMOBJ symbol_table; /* Hash table of all interned symbols. */
6984 ___SCMOBJ keyword_table; /* Hash table of all interned keywords. */
6985 ___SCMOBJ command_line; /* List of command line arguments. */
6986 ___SCMOBJ program_descr; /* Program descriptor. */
6988 void (*dummy8) ___PVOID;
6989 void (*dummy7) ___PVOID;
6990 void (*dummy6) ___PVOID;
6991 void (*dummy5) ___PVOID;
6992 void (*dummy4) ___PVOID;
6993 void (*dummy3) ___PVOID;
6994 void (*dummy2) ___PVOID;
6995 void (*dummy1) ___PVOID;
6997 #ifndef ___CAN_IMPORT_CLIB_DYNAMICALLY
6998 double (*fabs)
6999 ___P((double x),
7000 ());
7001 double (*floor)
7002 ___P((double x),
7003 ());
7004 double (*ceil)
7005 ___P((double x),
7006 ());
7007 double (*exp)
7008 ___P((double x),
7009 ());
7010 double (*log)
7011 ___P((double x),
7012 ());
7013 double (*sin)
7014 ___P((double x),
7015 ());
7016 double (*cos)
7017 ___P((double x),
7018 ());
7019 double (*tan)
7020 ___P((double x),
7021 ());
7022 double (*asin)
7023 ___P((double x),
7024 ());
7025 double (*acos)
7026 ___P((double x),
7027 ());
7028 double (*atan)
7029 ___P((double x),
7030 ());
7031 #ifdef ___GOOD_ATAN2
7032 double (*atan2)
7033 ___P((double y,
7034 double x),
7035 ());
7036 #endif
7037 #ifdef ___GOOD_POW
7038 double (*pow)
7039 ___P((double x,
7040 double y),
7041 ());
7042 #endif
7043 double (*sqrt)
7044 ___P((double x),
7045 ());
7046 #endif
7048 #ifdef ___USE_SETJMP
7049 #ifndef ___CAN_IMPORT_SETJMP_DYNAMICALLY
7050 int (*setjmp)
7051 ___P((jmp_buf env),
7052 ());
7053 #endif
7054 #endif
7056 #ifndef ___CAN_IMPORT_DYNAMICALLY
7057 ___BOOL (*___iswalpha)
7058 ___P((___UCS_4 x),
7059 ());
7060 ___BOOL (*___iswdigit)
7061 ___P((___UCS_4 x),
7062 ());
7063 ___BOOL (*___iswspace)
7064 ___P((___UCS_4 x),
7065 ());
7066 ___BOOL (*___iswupper)
7067 ___P((___UCS_4 x),
7068 ());
7069 ___BOOL (*___iswlower)
7070 ___P((___UCS_4 x),
7071 ());
7072 ___UCS_4 (*___towupper)
7073 ___P((___UCS_4 x),
7074 ());
7075 ___UCS_4 (*___towlower)
7076 ___P((___UCS_4 x),
7077 ());
7078 ___SCMOBJ (*___string_collate)
7079 ___P((___SCMOBJ s1,
7080 ___SCMOBJ s2),
7081 ());
7082 ___SCMOBJ (*___string_collate_ci)
7083 ___P((___SCMOBJ s1,
7084 ___SCMOBJ s2),
7085 ());
7086 double (*___copysign)
7087 ___P((double x,
7088 double y),
7089 ());
7090 ___BOOL (*___isfinite)
7091 ___P((double x),
7092 ());
7093 ___BOOL (*___isnan)
7094 ___P((double x),
7095 ());
7096 double (*___trunc)
7097 ___P((double x),
7098 ());
7099 double (*___round)
7100 ___P((double x),
7101 ());
7102 #ifndef ___GOOD_ATAN2
7103 double (*___atan2)
7104 ___P((double y,
7105 double x),
7106 ());
7107 #endif
7108 #ifndef ___GOOD_POW
7109 double (*___pow)
7110 ___P((double x,
7111 double y),
7112 ());
7113 #endif
7114 ___S64 (*___S64_from_SM32_fn)
7115 ___P((___SM32 val),
7116 ());
7117 ___S64 (*___S64_from_SM32_UM32_fn)
7118 ___P((___SM32 hi32,
7119 ___UM32 lo32),
7120 ());
7121 ___S64 (*___S64_from_LONGLONG_fn)
7122 ___P((___LONGLONG val),
7123 ());
7124 ___LONGLONG (*___S64_to_LONGLONG_fn)
7125 ___P((___S64 val),
7126 ());
7127 ___BOOL (*___S64_fits_in_width_fn)
7128 ___P((___S64 val,
7129 int width),
7130 ());
7131 ___U64 (*___U64_from_UM32_fn)
7132 ___P((___UM32 val),
7133 ());
7134 ___U64 (*___U64_from_UM32_UM32_fn)
7135 ___P((___UM32 hi32,
7136 ___UM32 lo32),
7137 ());
7138 ___U64 (*___U64_from_ULONGLONG_fn)
7139 ___P((___ULONGLONG val),
7140 ());
7141 ___ULONGLONG (*___U64_to_ULONGLONG_fn)
7142 ___P((___U64 val),
7143 ());
7144 ___BOOL (*___U64_fits_in_width_fn)
7145 ___P((___U64 val,
7146 int width),
7147 ());
7148 ___U64 (*___U64_mul_UM32_UM32_fn)
7149 ___P((___UM32 x,
7150 ___UM32 y),
7151 ());
7152 ___U64 (*___U64_add_U64_U64_fn)
7153 ___P((___U64 x,
7154 ___U64 y),
7155 ());
7156 ___SCMOBJ (*___SCMOBJ_to_S8)
7157 ___P((___SCMOBJ obj,
7158 ___S8 *x,
7159 int arg_num),
7160 ());
7161 ___SCMOBJ (*___SCMOBJ_to_U8)
7162 ___P((___SCMOBJ obj,
7163 ___U8 *x,
7164 int arg_num),
7165 ());
7166 ___SCMOBJ (*___SCMOBJ_to_S16)
7167 ___P((___SCMOBJ obj,
7168 ___S16 *x,
7169 int arg_num),
7170 ());
7171 ___SCMOBJ (*___SCMOBJ_to_U16)
7172 ___P((___SCMOBJ obj,
7173 ___U16 *x,
7174 int arg_num),
7175 ());
7176 ___SCMOBJ (*___SCMOBJ_to_S32)
7177 ___P((___SCMOBJ obj,
7178 ___S32 *x,
7179 int arg_num),
7180 ());
7181 ___SCMOBJ (*___SCMOBJ_to_U32)
7182 ___P((___SCMOBJ obj,
7183 ___U32 *x,
7184 int arg_num),
7185 ());
7186 ___SCMOBJ (*___SCMOBJ_to_S64)
7187 ___P((___SCMOBJ obj,
7188 ___S64 *x,
7189 int arg_num),
7190 ());
7191 ___SCMOBJ (*___SCMOBJ_to_U64)
7192 ___P((___SCMOBJ obj,
7193 ___U64 *x,
7194 int arg_num),
7195 ());
7196 ___SCMOBJ (*___SCMOBJ_to_F32)
7197 ___P((___SCMOBJ obj,
7198 ___F32 *x,
7199 int arg_num),
7200 ());
7201 ___SCMOBJ (*___SCMOBJ_to_F64)
7202 ___P((___SCMOBJ obj,
7203 ___F64 *x,
7204 int arg_num),
7205 ());
7206 ___SCMOBJ (*___SCMOBJ_to_CHAR)
7207 ___P((___SCMOBJ obj,
7208 char *x,
7209 int arg_num),
7210 ());
7211 ___SCMOBJ (*___SCMOBJ_to_SCHAR)
7212 ___P((___SCMOBJ obj,
7213 ___SCHAR *x,
7214 int arg_num),
7215 ());
7216 ___SCMOBJ (*___SCMOBJ_to_UCHAR)
7217 ___P((___SCMOBJ obj,
7218 unsigned char *x,
7219 int arg_num),
7220 ());
7221 ___SCMOBJ (*___SCMOBJ_to_ISO_8859_1)
7222 ___P((___SCMOBJ obj,
7223 ___ISO_8859_1 *x,
7224 int arg_num),
7225 ());
7226 ___SCMOBJ (*___SCMOBJ_to_UCS_2)
7227 ___P((___SCMOBJ obj,
7228 ___UCS_2 *x,
7229 int arg_num),
7230 ());
7231 ___SCMOBJ (*___SCMOBJ_to_UCS_4)
7232 ___P((___SCMOBJ obj,
7233 ___UCS_4 *x,
7234 int arg_num),
7235 ());
7236 ___SCMOBJ (*___SCMOBJ_to_WCHAR)
7237 ___P((___SCMOBJ obj,
7238 ___WCHAR *x,
7239 int arg_num),
7240 ());
7241 ___SCMOBJ (*___SCMOBJ_to_SHORT)
7242 ___P((___SCMOBJ obj,
7243 short *x,
7244 int arg_num),
7245 ());
7246 ___SCMOBJ (*___SCMOBJ_to_USHORT)
7247 ___P((___SCMOBJ obj,
7248 unsigned short *x,
7249 int arg_num),
7250 ());
7251 ___SCMOBJ (*___SCMOBJ_to_INT)
7252 ___P((___SCMOBJ obj,
7253 int *x,
7254 int arg_num),
7255 ());
7256 ___SCMOBJ (*___SCMOBJ_to_UINT)
7257 ___P((___SCMOBJ obj,
7258 unsigned int *x,
7259 int arg_num),
7260 ());
7261 ___SCMOBJ (*___SCMOBJ_to_LONG)
7262 ___P((___SCMOBJ obj,
7263 long *x,
7264 int arg_num),
7265 ());
7266 ___SCMOBJ (*___SCMOBJ_to_ULONG)
7267 ___P((___SCMOBJ obj,
7268 unsigned long *x,
7269 int arg_num),
7270 ());
7271 ___SCMOBJ (*___SCMOBJ_to_LONGLONG)
7272 ___P((___SCMOBJ obj,
7273 ___LONGLONG *x,
7274 int arg_num),
7275 ());
7276 ___SCMOBJ (*___SCMOBJ_to_ULONGLONG)
7277 ___P((___SCMOBJ obj,
7278 ___ULONGLONG *x,
7279 int arg_num),
7280 ());
7281 ___SCMOBJ (*___SCMOBJ_to_FLOAT)
7282 ___P((___SCMOBJ obj,
7283 float *x,
7284 int arg_num),
7285 ());
7286 ___SCMOBJ (*___SCMOBJ_to_DOUBLE)
7287 ___P((___SCMOBJ obj,
7288 double *x,
7289 int arg_num),
7290 ());
7291 ___SCMOBJ (*___SCMOBJ_to_STRUCT)
7292 ___P((___SCMOBJ obj,
7293 void **x,
7294 ___SCMOBJ tags,
7295 int arg_num),
7296 ());
7297 ___SCMOBJ (*___SCMOBJ_to_UNION)
7298 ___P((___SCMOBJ obj,
7299 void **x,
7300 ___SCMOBJ tags,
7301 int arg_num),
7302 ());
7303 ___SCMOBJ (*___SCMOBJ_to_TYPE)
7304 ___P((___SCMOBJ obj,
7305 void **x,
7306 ___SCMOBJ tags,
7307 int arg_num),
7308 ());
7309 ___SCMOBJ (*___SCMOBJ_to_POINTER)
7310 ___P((___SCMOBJ obj,
7311 void **x,
7312 ___SCMOBJ tags,
7313 int arg_num),
7314 ());
7315 ___SCMOBJ (*___SCMOBJ_to_NONNULLPOINTER)
7316 ___P((___SCMOBJ obj,
7317 void **x,
7318 ___SCMOBJ tags,
7319 int arg_num),
7320 ());
7321 ___SCMOBJ (*___SCMOBJ_to_FUNCTION)
7322 ___P((___SCMOBJ obj,
7323 void *converter,
7324 void **x,
7325 int arg_num),
7326 ());
7327 ___SCMOBJ (*___SCMOBJ_to_NONNULLFUNCTION)
7328 ___P((___SCMOBJ obj,
7329 void *converter,
7330 void **x,
7331 int arg_num),
7332 ());
7333 ___SCMOBJ (*___SCMOBJ_to_BOOL)
7334 ___P((___SCMOBJ obj,
7335 ___BOOL *x,
7336 int arg_num),
7337 ());
7338 ___SCMOBJ (*___SCMOBJ_to_STRING)
7339 ___P((___SCMOBJ obj,
7340 void **x,
7341 int arg_num,
7342 int char_encoding,
7343 int fudge),
7344 ());
7345 ___SCMOBJ (*___SCMOBJ_to_NONNULLSTRING)
7346 ___P((___SCMOBJ obj,
7347 void **x,
7348 int arg_num,
7349 int char_encoding,
7350 int fudge),
7351 ());
7352 ___SCMOBJ (*___SCMOBJ_to_NONNULLSTRINGLIST)
7353 ___P((___SCMOBJ obj,
7354 void **x,
7355 int arg_num,
7356 int char_encoding),
7357 ());
7358 ___SCMOBJ (*___SCMOBJ_to_CHARSTRING)
7359 ___P((___SCMOBJ obj,
7360 char **x,
7361 int arg_num),
7362 ());
7363 ___SCMOBJ (*___SCMOBJ_to_NONNULLCHARSTRING)
7364 ___P((___SCMOBJ obj,
7365 char **x,
7366 int arg_num),
7367 ());
7368 ___SCMOBJ (*___SCMOBJ_to_NONNULLCHARSTRINGLIST)
7369 ___P((___SCMOBJ obj,
7370 char ***x,
7371 int arg_num),
7372 ());
7373 ___SCMOBJ (*___SCMOBJ_to_ISO_8859_1STRING)
7374 ___P((___SCMOBJ obj,
7375 ___ISO_8859_1STRING *x,
7376 int arg_num),
7377 ());
7378 ___SCMOBJ (*___SCMOBJ_to_NONNULLISO_8859_1STRING)
7379 ___P((___SCMOBJ obj,
7380 ___ISO_8859_1STRING *x,
7381 int arg_num),
7382 ());
7383 ___SCMOBJ (*___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST)
7384 ___P((___SCMOBJ obj,
7385 ___ISO_8859_1STRING **x,
7386 int arg_num),
7387 ());
7388 ___SCMOBJ (*___SCMOBJ_to_UTF_8STRING)
7389 ___P((___SCMOBJ obj,
7390 ___UTF_8STRING *x,
7391 int arg_num),
7392 ());
7393 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_8STRING)
7394 ___P((___SCMOBJ obj,
7395 ___UTF_8STRING *x,
7396 int arg_num),
7397 ());
7398 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_8STRINGLIST)
7399 ___P((___SCMOBJ obj,
7400 ___UTF_8STRING **x,
7401 int arg_num),
7402 ());
7403 ___SCMOBJ (*___SCMOBJ_to_UTF_16STRING)
7404 ___P((___SCMOBJ obj,
7405 ___UTF_16STRING *x,
7406 int arg_num),
7407 ());
7408 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_16STRING)
7409 ___P((___SCMOBJ obj,
7410 ___UTF_16STRING *x,
7411 int arg_num),
7412 ());
7413 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_16STRINGLIST)
7414 ___P((___SCMOBJ obj,
7415 ___UTF_16STRING **x,
7416 int arg_num),
7417 ());
7418 ___SCMOBJ (*___SCMOBJ_to_UCS_2STRING)
7419 ___P((___SCMOBJ obj,
7420 ___UCS_2STRING *x,
7421 int arg_num),
7422 ());
7423 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_2STRING)
7424 ___P((___SCMOBJ obj,
7425 ___UCS_2STRING *x,
7426 int arg_num),
7427 ());
7428 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_2STRINGLIST)
7429 ___P((___SCMOBJ obj,
7430 ___UCS_2STRING **x,
7431 int arg_num),
7432 ());
7433 ___SCMOBJ (*___SCMOBJ_to_UCS_4STRING)
7434 ___P((___SCMOBJ obj,
7435 ___UCS_4STRING *x,
7436 int arg_num),
7437 ());
7438 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_4STRING)
7439 ___P((___SCMOBJ obj,
7440 ___UCS_4STRING *x,
7441 int arg_num),
7442 ());
7443 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_4STRINGLIST)
7444 ___P((___SCMOBJ obj,
7445 ___UCS_4STRING **x,
7446 int arg_num),
7447 ());
7448 ___SCMOBJ (*___SCMOBJ_to_WCHARSTRING)
7449 ___P((___SCMOBJ obj,
7450 ___WCHARSTRING *x,
7451 int arg_num),
7452 ());
7453 ___SCMOBJ (*___SCMOBJ_to_NONNULLWCHARSTRING)
7454 ___P((___SCMOBJ obj,
7455 ___WCHARSTRING *x,
7456 int arg_num),
7457 ());
7458 ___SCMOBJ (*___SCMOBJ_to_NONNULLWCHARSTRINGLIST)
7459 ___P((___SCMOBJ obj,
7460 ___WCHARSTRING **x,
7461 int arg_num),
7462 ());
7463 ___SCMOBJ (*___SCMOBJ_to_VARIANT)
7464 ___P((___SCMOBJ obj,
7465 ___VARIANT *x,
7466 int arg_num),
7467 ());
7468 ___SCMOBJ (*___release_foreign)
7469 ___P((___SCMOBJ obj),
7470 ());
7471 ___SCMOBJ (*___release_pointer)
7472 ___P((void *x),
7473 ());
7474 ___SCMOBJ (*___release_function)
7475 ___P((void *x),
7476 ());
7477 void (*___addref_function)
7478 ___P((void *x),
7479 ());
7480 void (*___release_string)
7481 ___P((void *x),
7482 ());
7483 void (*___addref_string)
7484 ___P((void *x),
7485 ());
7486 void (*___release_string_list)
7487 ___P((void *x),
7488 ());
7489 void (*___addref_string_list)
7490 ___P((void *x),
7491 ());
7492 void (*___release_variant)
7493 ___P((___VARIANT x),
7494 ());
7495 void (*___addref_variant)
7496 ___P((___VARIANT x),
7497 ());
7498 ___SCMOBJ (*___S8_to_SCMOBJ)
7499 ___P((___S8 x,
7500 ___SCMOBJ *obj,
7501 int arg_num),
7502 ());
7503 ___SCMOBJ (*___U8_to_SCMOBJ)
7504 ___P((___U8 x,
7505 ___SCMOBJ *obj,
7506 int arg_num),
7507 ());
7508 ___SCMOBJ (*___S16_to_SCMOBJ)
7509 ___P((___S16 x,
7510 ___SCMOBJ *obj,
7511 int arg_num),
7512 ());
7513 ___SCMOBJ (*___U16_to_SCMOBJ)
7514 ___P((___U16 x,
7515 ___SCMOBJ *obj,
7516 int arg_num),
7517 ());
7518 ___SCMOBJ (*___S32_to_SCMOBJ)
7519 ___P((___S32 x,
7520 ___SCMOBJ *obj,
7521 int arg_num),
7522 ());
7523 ___SCMOBJ (*___U32_to_SCMOBJ)
7524 ___P((___U32 x,
7525 ___SCMOBJ *obj,
7526 int arg_num),
7527 ());
7528 ___SCMOBJ (*___S64_to_SCMOBJ)
7529 ___P((___S64 x,
7530 ___SCMOBJ *obj,
7531 int arg_num),
7532 ());
7533 ___SCMOBJ (*___U64_to_SCMOBJ)
7534 ___P((___U64 x,
7535 ___SCMOBJ *obj,
7536 int arg_num),
7537 ());
7538 ___SCMOBJ (*___F32_to_SCMOBJ)
7539 ___P((___F32 x,
7540 ___SCMOBJ *obj,
7541 int arg_num),
7542 ());
7543 ___SCMOBJ (*___F64_to_SCMOBJ)
7544 ___P((___F64 x,
7545 ___SCMOBJ *obj,
7546 int arg_num),
7547 ());
7548 ___SCMOBJ (*___CHAR_to_SCMOBJ)
7549 ___P((char x,
7550 ___SCMOBJ *obj,
7551 int arg_num),
7552 ());
7553 ___SCMOBJ (*___SCHAR_to_SCMOBJ)
7554 ___P((___SCHAR x,
7555 ___SCMOBJ *obj,
7556 int arg_num),
7557 ());
7558 ___SCMOBJ (*___UCHAR_to_SCMOBJ)
7559 ___P((unsigned char x,
7560 ___SCMOBJ *obj,
7561 int arg_num),
7562 ());
7563 ___SCMOBJ (*___ISO_8859_1_to_SCMOBJ)
7564 ___P((___ISO_8859_1 x,
7565 ___SCMOBJ *obj,
7566 int arg_num),
7567 ());
7568 ___SCMOBJ (*___UCS_2_to_SCMOBJ)
7569 ___P((___UCS_2 x,
7570 ___SCMOBJ *obj,
7571 int arg_num),
7572 ());
7573 ___SCMOBJ (*___UCS_4_to_SCMOBJ)
7574 ___P((___UCS_4 x,
7575 ___SCMOBJ *obj,
7576 int arg_num),
7577 ());
7578 ___SCMOBJ (*___WCHAR_to_SCMOBJ)
7579 ___P((___WCHAR x,
7580 ___SCMOBJ *obj,
7581 int arg_num),
7582 ());
7583 ___SCMOBJ (*___SHORT_to_SCMOBJ)
7584 ___P((short x,
7585 ___SCMOBJ *obj,
7586 int arg_num),
7587 ());
7588 ___SCMOBJ (*___USHORT_to_SCMOBJ)
7589 ___P((unsigned short x,
7590 ___SCMOBJ *obj,
7591 int arg_num),
7592 ());
7593 ___SCMOBJ (*___INT_to_SCMOBJ)
7594 ___P((int x,
7595 ___SCMOBJ *obj,
7596 int arg_num),
7597 ());
7598 ___SCMOBJ (*___UINT_to_SCMOBJ)
7599 ___P((unsigned int x,
7600 ___SCMOBJ *obj,
7601 int arg_num),
7602 ());
7603 ___SCMOBJ (*___LONG_to_SCMOBJ)
7604 ___P((long x,
7605 ___SCMOBJ *obj,
7606 int arg_num),
7607 ());
7608 ___SCMOBJ (*___ULONG_to_SCMOBJ)
7609 ___P((unsigned long x,
7610 ___SCMOBJ *obj,
7611 int arg_num),
7612 ());
7613 ___SCMOBJ (*___LONGLONG_to_SCMOBJ)
7614 ___P((___LONGLONG x,
7615 ___SCMOBJ *obj,
7616 int arg_num),
7617 ());
7618 ___SCMOBJ (*___ULONGLONG_to_SCMOBJ)
7619 ___P((___ULONGLONG x,
7620 ___SCMOBJ *obj,
7621 int arg_num),
7622 ());
7623 ___SCMOBJ (*___FLOAT_to_SCMOBJ)
7624 ___P((float x,
7625 ___SCMOBJ *obj,
7626 int arg_num),
7627 ());
7628 ___SCMOBJ (*___DOUBLE_to_SCMOBJ)
7629 ___P((double x,
7630 ___SCMOBJ *obj,
7631 int arg_num),
7632 ());
7633 ___SCMOBJ (*___STRUCT_to_SCMOBJ)
7634 ___P((void *x,
7635 ___SCMOBJ tags,
7636 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7637 ___SCMOBJ *obj,
7638 int arg_num),
7639 ());
7640 ___SCMOBJ (*___UNION_to_SCMOBJ)
7641 ___P((void *x,
7642 ___SCMOBJ tags,
7643 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7644 ___SCMOBJ *obj,
7645 int arg_num),
7646 ());
7647 ___SCMOBJ (*___TYPE_to_SCMOBJ)
7648 ___P((void *x,
7649 ___SCMOBJ tags,
7650 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7651 ___SCMOBJ *obj,
7652 int arg_num),
7653 ());
7654 ___SCMOBJ (*___POINTER_to_SCMOBJ)
7655 ___P((void *x,
7656 ___SCMOBJ tags,
7657 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7658 ___SCMOBJ *obj,
7659 int arg_num),
7660 ());
7661 ___SCMOBJ (*___NONNULLPOINTER_to_SCMOBJ)
7662 ___P((void *x,
7663 ___SCMOBJ tags,
7664 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7665 ___SCMOBJ *obj,
7666 int arg_num),
7667 ());
7668 ___SCMOBJ (*___FUNCTION_to_SCMOBJ)
7669 ___P((void *x,
7670 ___SCMOBJ *obj,
7671 int arg_num),
7672 ());
7673 ___SCMOBJ (*___NONNULLFUNCTION_to_SCMOBJ)
7674 ___P((void *x,
7675 ___SCMOBJ *obj,
7676 int arg_num),
7677 ());
7678 ___SCMOBJ (*___BOOL_to_SCMOBJ)
7679 ___P((___BOOL x,
7680 ___SCMOBJ *obj,
7681 int arg_num),
7682 ());
7683 ___SCMOBJ (*___STRING_to_SCMOBJ)
7684 ___P((void *x,
7685 ___SCMOBJ *obj,
7686 int arg_num,
7687 int char_encoding),
7688 ());
7689 ___SCMOBJ (*___NONNULLSTRING_to_SCMOBJ)
7690 ___P((void *x,
7691 ___SCMOBJ *obj,
7692 int arg_num,
7693 int char_encoding),
7694 ());
7695 ___SCMOBJ (*___NONNULLSTRINGLIST_to_SCMOBJ)
7696 ___P((void *x,
7697 ___SCMOBJ *obj,
7698 int arg_num,
7699 int char_encoding),
7700 ());
7701 ___SCMOBJ (*___CHARSTRING_to_SCMOBJ)
7702 ___P((char *x,
7703 ___SCMOBJ *obj,
7704 int arg_num),
7705 ());
7706 ___SCMOBJ (*___NONNULLCHARSTRING_to_SCMOBJ)
7707 ___P((char *x,
7708 ___SCMOBJ *obj,
7709 int arg_num),
7710 ());
7711 ___SCMOBJ (*___NONNULLCHARSTRINGLIST_to_SCMOBJ)
7712 ___P((char **x,
7713 ___SCMOBJ *obj,
7714 int arg_num),
7715 ());
7716 ___SCMOBJ (*___ISO_8859_1STRING_to_SCMOBJ)
7717 ___P((___ISO_8859_1STRING x,
7718 ___SCMOBJ *obj,
7719 int arg_num),
7720 ());
7721 ___SCMOBJ (*___NONNULLISO_8859_1STRING_to_SCMOBJ)
7722 ___P((___ISO_8859_1STRING x,
7723 ___SCMOBJ *obj,
7724 int arg_num),
7725 ());
7726 ___SCMOBJ (*___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ)
7727 ___P((___ISO_8859_1STRING *x,
7728 ___SCMOBJ *obj,
7729 int arg_num),
7730 ());
7731 ___SCMOBJ (*___UTF_8STRING_to_SCMOBJ)
7732 ___P((___UTF_8STRING x,
7733 ___SCMOBJ *obj,
7734 int arg_num),
7735 ());
7736 ___SCMOBJ (*___NONNULLUTF_8STRING_to_SCMOBJ)
7737 ___P((___UTF_8STRING x,
7738 ___SCMOBJ *obj,
7739 int arg_num),
7740 ());
7741 ___SCMOBJ (*___NONNULLUTF_8STRINGLIST_to_SCMOBJ)
7742 ___P((___UTF_8STRING *x,
7743 ___SCMOBJ *obj,
7744 int arg_num),
7745 ());
7746 ___SCMOBJ (*___UTF_16STRING_to_SCMOBJ)
7747 ___P((___UTF_16STRING x,
7748 ___SCMOBJ *obj,
7749 int arg_num),
7750 ());
7751 ___SCMOBJ (*___NONNULLUTF_16STRING_to_SCMOBJ)
7752 ___P((___UTF_16STRING x,
7753 ___SCMOBJ *obj,
7754 int arg_num),
7755 ());
7756 ___SCMOBJ (*___NONNULLUTF_16STRINGLIST_to_SCMOBJ)
7757 ___P((___UTF_16STRING *x,
7758 ___SCMOBJ *obj,
7759 int arg_num),
7760 ());
7761 ___SCMOBJ (*___UCS_2STRING_to_SCMOBJ)
7762 ___P((___UCS_2STRING x,
7763 ___SCMOBJ *obj,
7764 int arg_num),
7765 ());
7766 ___SCMOBJ (*___NONNULLUCS_2STRING_to_SCMOBJ)
7767 ___P((___UCS_2STRING x,
7768 ___SCMOBJ *obj,
7769 int arg_num),
7770 ());
7771 ___SCMOBJ (*___NONNULLUCS_2STRINGLIST_to_SCMOBJ)
7772 ___P((___UCS_2STRING *x,
7773 ___SCMOBJ *obj,
7774 int arg_num),
7775 ());
7776 ___SCMOBJ (*___UCS_4STRING_to_SCMOBJ)
7777 ___P((___UCS_4STRING x,
7778 ___SCMOBJ *obj,
7779 int arg_num),
7780 ());
7781 ___SCMOBJ (*___NONNULLUCS_4STRING_to_SCMOBJ)
7782 ___P((___UCS_4STRING x,
7783 ___SCMOBJ *obj,
7784 int arg_num),
7785 ());
7786 ___SCMOBJ (*___NONNULLUCS_4STRINGLIST_to_SCMOBJ)
7787 ___P((___UCS_4STRING *x,
7788 ___SCMOBJ *obj,
7789 int arg_num),
7790 ());
7791 ___SCMOBJ (*___WCHARSTRING_to_SCMOBJ)
7792 ___P((___WCHARSTRING x,
7793 ___SCMOBJ *obj,
7794 int arg_num),
7795 ());
7796 ___SCMOBJ (*___NONNULLWCHARSTRING_to_SCMOBJ)
7797 ___P((___WCHARSTRING x,
7798 ___SCMOBJ *obj,
7799 int arg_num),
7800 ());
7801 ___SCMOBJ (*___NONNULLWCHARSTRINGLIST_to_SCMOBJ)
7802 ___P((___WCHARSTRING *x,
7803 ___SCMOBJ *obj,
7804 int arg_num),
7805 ());
7806 ___SCMOBJ (*___VARIANT_to_SCMOBJ)
7807 ___P((___VARIANT x,
7808 ___SCMOBJ *obj,
7809 int arg_num),
7810 ());
7811 ___SCMOBJ (*___CHARSTRING_to_UCS_2STRING)
7812 ___P((char *str_char,
7813 ___UCS_2STRING *str_UCS_2),
7814 ());
7815 void (*___free_UCS_2STRING)
7816 ___P((___UCS_2STRING str_UCS_2),
7817 ());
7818 ___SCMOBJ (*___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST)
7819 ___P((char **str_list_char,
7820 ___UCS_2STRING **str_list_UCS_2),
7821 ());
7822 void (*___free_NONNULLUCS_2STRINGLIST)
7823 ___P((___UCS_2STRING *str_list_UCS_2),
7824 ());
7825 ___SCMOBJ (*___make_sfun_stack_marker)
7826 ___P((___SCMOBJ *marker,
7827 ___SCMOBJ proc_or_false),
7828 ());
7829 void (*___kill_sfun_stack_marker)
7830 ___P((___SCMOBJ marker),
7831 ());
7832 void *(*___alloc_rc)
7833 ___P((unsigned long bytes),
7834 ());
7835 void (*___release_rc)
7836 ___P((void *ptr),
7837 ());
7838 void (*___addref_rc)
7839 ___P((void *ptr),
7840 ());
7841 ___SCMOBJ (*___data_rc)
7842 ___P((void *ptr),
7843 ());
7844 void (*___set_data_rc)
7845 ___P((void *ptr,
7846 ___SCMOBJ val),
7847 ());
7848 ___SCMOBJ (*___alloc_scmobj)
7849 ___P((int subtype,
7850 long bytes,
7851 int kind),
7852 ());
7853 void (*___release_scmobj)
7854 ___P((___SCMOBJ obj),
7855 ());
7856 ___SCMOBJ (*___make_pair)
7857 ___P((___SCMOBJ car,
7858 ___SCMOBJ cdr,
7859 int kind),
7860 ());
7861 ___SCMOBJ (*___make_vector)
7862 ___P((long length,
7863 ___SCMOBJ init,
7864 int kind),
7865 ());
7866 void (*___still_obj_refcount_inc)
7867 ___P((___SCMOBJ obj),
7868 ());
7869 void (*___still_obj_refcount_dec)
7870 ___P((___SCMOBJ obj),
7871 ());
7872 ___SCMOBJ (*___gc_hash_table_ref)
7873 ___P((___SCMOBJ ht,
7874 ___SCMOBJ key),
7875 ());
7876 ___SCMOBJ (*___gc_hash_table_set)
7877 ___P((___SCMOBJ ht,
7878 ___SCMOBJ key,
7879 ___SCMOBJ val),
7880 ());
7881 ___SCMOBJ (*___gc_hash_table_rehash)
7882 ___P((___SCMOBJ ht_src,
7883 ___SCMOBJ ht_dst),
7884 ());
7885 unsigned long (*___get_min_heap) ___PVOID;
7886 void (*___set_min_heap)
7887 ___P((unsigned long bytes),
7888 ());
7889 unsigned long (*___get_max_heap) ___PVOID;
7890 void (*___set_max_heap)
7891 ___P((unsigned long bytes),
7892 ());
7893 int (*___get_live_percent) ___PVOID;
7894 void (*___set_live_percent)
7895 ___P((int percent),
7896 ());
7897 int (*___get_standard_level) ___PVOID;
7898 void (*___set_standard_level)
7899 ___P((int level),
7900 ());
7901 int (*___set_debug_settings)
7902 ___P((int mask,
7903 int new_settings),
7904 ());
7905 ___program_startup_info_struct *(*___get_program_startup_info) ___PVOID;
7906 void (*___cleanup) ___PVOID;
7907 void (*___cleanup_and_exit_process)
7908 ___P((int status),
7909 ());
7910 ___SCMOBJ (*___call)
7911 ___P((int nargs,
7912 ___SCMOBJ proc,
7913 ___SCMOBJ marker),
7914 ());
7915 void (*___propagate_error)
7916 ___P((___SCMOBJ err),
7917 ());
7918 #ifdef ___DEBUG_HOST_CHANGES
7919 void (*___register_host_entry)
7920 ___P((___WORD start,
7921 char *module_name),
7922 ());
7923 #endif
7924 void (*___raise_interrupt)
7925 ___P((int code),
7926 ());
7927 void (*___begin_interrupt_service) ___PVOID;
7928 ___BOOL (*___check_interrupt)
7929 ___P((int code),
7930 ());
7931 void (*___end_interrupt_service)
7932 ___P((int code),
7933 ());
7934 void (*___disable_interrupts) ___PVOID;
7935 void (*___enable_interrupts) ___PVOID;
7936 void *(*___alloc_mem)
7937 ___P((unsigned long bytes),
7938 ());
7939 void (*___free_mem)
7940 ___P((void *ptr),
7941 ());
7942 void *(*___alloc_mem_code)
7943 ___P((unsigned long bytes),
7944 ());
7945 void (*___free_mem_code)
7946 ___P((void *ptr),
7947 ());
7948 void (*___disable_heartbeat_interrupts) ___PVOID;
7949 void (*___enable_heartbeat_interrupts) ___PVOID;
7950 #endif
7951 } ___global_state_struct;
7953 #ifdef ___LBL_COUNT
7954 ___LOCAL ___WORD ___lp; /* Module's label table pointer */
7955 #endif
7957 ___GLO_DECL
7958 ___SYM_DECL
7959 ___KEY_DECL
7961 /* Setup parameters structure */
7963 typedef struct ___setup_params_struct
7965 int version;
7966 ___UCS_2STRING *argv;
7967 unsigned long min_heap;
7968 unsigned long max_heap;
7969 int live_percent;
7970 long (*gc_hook) ___P((long avail, long live),());
7971 void (*display_error) ___P((char **msgs),());
7972 void (*fatal_error) ___P((char **msgs),());
7973 int standard_level;
7974 int debug_settings;
7975 int file_settings;
7976 int terminal_settings;
7977 int stdio_settings;
7978 ___UCS_2STRING gambcdir;
7979 ___UCS_2STRING *gambcdir_map;
7980 ___UCS_2STRING remote_dbg_addr;
7981 ___UCS_2STRING rpc_server_addr;
7982 ___mod_or_lnk (*linker) ___P((___global_state_struct*),());
7984 void (*dummy8) ___PVOID;
7985 void (*dummy7) ___PVOID;
7986 void (*dummy6) ___PVOID;
7987 void (*dummy5) ___PVOID;
7988 void (*dummy4) ___PVOID;
7989 void (*dummy3) ___PVOID;
7990 void (*dummy2) ___PVOID;
7991 void (*dummy1) ___PVOID;
7992 } ___setup_params_struct;
7994 #define ___DEBUG_SETTINGS_LEVEL_MASK 15
7995 #define ___DEBUG_SETTINGS_LEVEL_SHIFT 0
7996 #define ___DEBUG_SETTINGS_UNCAUGHT_MASK (1<<4)
7997 #define ___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL 0
7998 #define ___DEBUG_SETTINGS_UNCAUGHT_ALL 1
7999 #define ___DEBUG_SETTINGS_UNCAUGHT_SHIFT 4
8000 #define ___DEBUG_SETTINGS_ERROR_MASK (3<<5)
8001 #define ___DEBUG_SETTINGS_ERROR_REPL 0
8002 #define ___DEBUG_SETTINGS_ERROR_SINGLE_STEP 1
8003 #define ___DEBUG_SETTINGS_ERROR_QUIT 2
8004 #define ___DEBUG_SETTINGS_ERROR_SHIFT 5
8005 #define ___DEBUG_SETTINGS_REPL_MASK (3<<7)
8006 #define ___DEBUG_SETTINGS_REPL_IDE 0
8007 #define ___DEBUG_SETTINGS_REPL_CONSOLE 1
8008 #define ___DEBUG_SETTINGS_REPL_STDIO 2
8009 #define ___DEBUG_SETTINGS_REPL_REMOTE 3
8010 #define ___DEBUG_SETTINGS_REPL_SHIFT 7
8011 #define ___DEBUG_SETTINGS_USER_INTR_MASK (3<<9)
8012 #define ___DEBUG_SETTINGS_USER_INTR_REPL 0
8013 #define ___DEBUG_SETTINGS_USER_INTR_DEFER 1
8014 #define ___DEBUG_SETTINGS_USER_INTR_QUIT 2
8015 #define ___DEBUG_SETTINGS_USER_INTR_SHIFT 9
8017 #define ___DEBUG_SETTINGS_LEVEL(settings) \
8018 (((settings) & ___DEBUG_SETTINGS_LEVEL_MASK) \
8019 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
8021 #define ___DEBUG_SETTINGS_UNCAUGHT(settings) \
8022 (((settings) & ___DEBUG_SETTINGS_UNCAUGHT_MASK) \
8023 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
8025 #define ___DEBUG_SETTINGS_ERROR(settings) \
8026 (((settings) & ___DEBUG_SETTINGS_ERROR_MASK) \
8027 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
8029 #define ___DEBUG_SETTINGS_REPL(settings) \
8030 (((settings) & ___DEBUG_SETTINGS_REPL_MASK) \
8031 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
8033 #define ___DEBUG_SETTINGS_USER_INTR(settings) \
8034 (((settings) & ___DEBUG_SETTINGS_USER_INTR_MASK) \
8035 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
8037 #define ___DEBUG_SETTINGS_INITIAL \
8038 ((1 << ___DEBUG_SETTINGS_LEVEL_SHIFT) | \
8039 (___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL \
8040 << ___DEBUG_SETTINGS_UNCAUGHT_SHIFT) | \
8041 (___DEBUG_SETTINGS_ERROR_QUIT \
8042 << ___DEBUG_SETTINGS_ERROR_SHIFT) | \
8043 (___DEBUG_SETTINGS_REPL_IDE \
8044 << ___DEBUG_SETTINGS_REPL_SHIFT) | \
8045 (___DEBUG_SETTINGS_USER_INTR_QUIT \
8046 << ___DEBUG_SETTINGS_USER_INTR_SHIFT))
8048 #define ___DEBUG_SETTINGS_DEFAULT \
8049 ((1 << ___DEBUG_SETTINGS_LEVEL_SHIFT) | \
8050 (___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL \
8051 << ___DEBUG_SETTINGS_UNCAUGHT_SHIFT) | \
8052 (___DEBUG_SETTINGS_ERROR_REPL \
8053 << ___DEBUG_SETTINGS_ERROR_SHIFT) | \
8054 (___DEBUG_SETTINGS_REPL_IDE \
8055 << ___DEBUG_SETTINGS_REPL_SHIFT) | \
8056 (___DEBUG_SETTINGS_USER_INTR_REPL \
8057 << ___DEBUG_SETTINGS_USER_INTR_SHIFT))
8059 #define ___CHAR_ENCODING(x) ((x)&(31<<0))
8060 #define ___CHAR_ENCODING_MASK(x) ((x)&~(31<<0))
8061 #define ___CHAR_ENCODING_ASCII (1<<0)
8062 #define ___CHAR_ENCODING_ISO_8859_1 (2<<0)
8063 #define ___CHAR_ENCODING_UTF_8 (3<<0)
8064 #define ___CHAR_ENCODING_UTF_16 (4<<0)
8065 #define ___CHAR_ENCODING_UTF_16BE (5<<0)
8066 #define ___CHAR_ENCODING_UTF_16LE (6<<0)
8067 #define ___CHAR_ENCODING_UTF_FALLBACK_ASCII (7<<0)
8068 #define ___CHAR_ENCODING_UTF_FALLBACK_ISO_8859_1 (8<<0)
8069 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_8 (9<<0)
8070 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16 (10<<0)
8071 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16BE (11<<0)
8072 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16LE (12<<0)
8073 #define ___CHAR_ENCODING_UCS_2 (13<<0)
8074 #define ___CHAR_ENCODING_UCS_2BE (14<<0)
8075 #define ___CHAR_ENCODING_UCS_2LE (15<<0)
8076 #define ___CHAR_ENCODING_UCS_4 (16<<0)
8077 #define ___CHAR_ENCODING_UCS_4BE (17<<0)
8078 #define ___CHAR_ENCODING_UCS_4LE (18<<0)
8079 #define ___CHAR_ENCODING_WCHAR (19<<0)
8080 #define ___CHAR_ENCODING_NATIVE (20<<0)
8082 #define ___CHAR_ENCODING_UTF ___CHAR_ENCODING_UTF_FALLBACK_UTF_8
8084 #define ___CHAR_ENCODING_SUPPORTS_BMP(x) \
8085 ((x) >= ___CHAR_ENCODING_UTF_8 && \
8086 (x) <= ___CHAR_ENCODING_UCS_4LE)
8088 #ifdef ___BIG_ENDIAN
8089 #define ___CHAR_ENCODING_U8 ___CHAR_ENCODING_ISO_8859_1
8090 #define ___CHAR_ENCODING_U16 ___CHAR_ENCODING_UCS_2BE
8091 #define ___CHAR_ENCODING_U32 ___CHAR_ENCODING_UCS_4BE
8092 #else
8093 #define ___CHAR_ENCODING_U8 ___CHAR_ENCODING_ISO_8859_1
8094 #define ___CHAR_ENCODING_U16 ___CHAR_ENCODING_UCS_2LE
8095 #define ___CHAR_ENCODING_U32 ___CHAR_ENCODING_UCS_4LE
8096 #endif
8098 #define ___CHAR_ENCODING_ERRORS(x) ((x)&(3<<5))
8099 #define ___CHAR_ENCODING_ERRORS_MASK(x) ((x)&~(3<<5))
8100 #define ___CHAR_ENCODING_ERRORS_ON (1<<5)
8101 #define ___CHAR_ENCODING_ERRORS_OFF (2<<5)
8103 #define ___EOL_ENCODING(x) ((x)&(3<<7))
8104 #define ___EOL_ENCODING_MASK(x) ((x)&~(3<<7))
8105 #define ___EOL_ENCODING_LF (1<<7)
8106 #define ___EOL_ENCODING_CR (2<<7)
8107 #define ___EOL_ENCODING_CRLF (3<<7)
8109 #define ___BUFFERING(x) ((x)&(3<<9))
8110 #define ___BUFFERING_MASK(x) ((x)&~(3<<9))
8111 #define ___NO_BUFFERING (1<<9)
8112 #define ___LINE_BUFFERING (2<<9)
8113 #define ___FULL_BUFFERING (3<<9)
8114 #define ___FULLY_BUFFERED(x) (___BUFFERING(x)>=___FULL_BUFFERING)
8116 #define ___DECODE_STATE(x) ((x)&(3<<11))
8117 #define ___DECODE_STATE_MASK(x) ((x)&~(3<<11))
8118 #define ___DECODE_STATE_NONE (0<<11)
8119 #define ___DECODE_STATE_LF (1<<11)
8120 #define ___DECODE_STATE_CR (2<<11)
8122 #define ___TERMINAL_LINE_EDITING(x) ((x)&(3<<16))
8123 #define ___TERMINAL_LINE_EDITING_MASK(x) ((x)&~(3<<16))
8124 #define ___TERMINAL_LINE_EDITING_ON (1<<16)
8125 #define ___TERMINAL_LINE_EDITING_OFF (2<<16)
8127 #define ___FILE_SETTINGS_INITIAL 0
8128 #define ___TERMINAL_SETTINGS_INITIAL 0
8129 #define ___STDIO_SETTINGS_INITIAL 0
8131 #ifndef ___INCLUDED_FROM_C_INTF
8132 ___IMP_FUNC(___S64,___S64_from_SM32_fn)
8133 ___P((___SM32 val),
8134 ());
8135 ___IMP_FUNC(___S64,___S64_from_SM32_UM32_fn)
8136 ___P((___SM32 hi32,
8137 ___UM32 lo32),
8138 ());
8139 ___IMP_FUNC(___S64,___S64_from_LONGLONG_fn)
8140 ___P((___LONGLONG val),
8141 ());
8142 ___IMP_FUNC(___LONGLONG,___S64_to_LONGLONG_fn)
8143 ___P((___S64 val),
8144 ());
8145 ___IMP_FUNC(___BOOL,___S64_fits_in_width_fn)
8146 ___P((___S64 val,
8147 int width),
8148 ());
8149 ___IMP_FUNC(___U64,___U64_from_UM32_fn)
8150 ___P((___UM32 val),
8151 ());
8152 ___IMP_FUNC(___U64,___U64_from_UM32_UM32_fn)
8153 ___P((___UM32 hi32,
8154 ___UM32 lo32),
8155 ());
8156 ___IMP_FUNC(___U64,___U64_from_ULONGLONG_fn)
8157 ___P((___ULONGLONG val),
8158 ());
8159 ___IMP_FUNC(___ULONGLONG,___U64_to_ULONGLONG_fn)
8160 ___P((___U64 val),
8161 ());
8162 ___IMP_FUNC(___BOOL,___U64_fits_in_width_fn)
8163 ___P((___U64 val,
8164 int width),
8165 ());
8166 ___IMP_FUNC(___U64,___U64_mul_UM32_UM32_fn)
8167 ___P((___UM32 x,
8168 ___UM32 y),
8169 ());
8170 ___IMP_FUNC(___U64,___U64_add_U64_U64_fn)
8171 ___P((___U64 x,
8172 ___U64 y),
8173 ());
8174 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S8)
8175 ___P((___SCMOBJ obj,
8176 ___S8 *x,
8177 int arg_num),
8178 ());
8179 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U8)
8180 ___P((___SCMOBJ obj,
8181 ___U8 *x,
8182 int arg_num),
8183 ());
8184 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S16)
8185 ___P((___SCMOBJ obj,
8186 ___S16 *x,
8187 int arg_num),
8188 ());
8189 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U16)
8190 ___P((___SCMOBJ obj,
8191 ___U16 *x,
8192 int arg_num),
8193 ());
8194 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S32)
8195 ___P((___SCMOBJ obj,
8196 ___S32 *x,
8197 int arg_num),
8198 ());
8199 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U32)
8200 ___P((___SCMOBJ obj,
8201 ___U32 *x,
8202 int arg_num),
8203 ());
8204 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S64)
8205 ___P((___SCMOBJ obj,
8206 ___S64 *x,
8207 int arg_num),
8208 ());
8209 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U64)
8210 ___P((___SCMOBJ obj,
8211 ___U64 *x,
8212 int arg_num),
8213 ());
8214 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_F32)
8215 ___P((___SCMOBJ obj,
8216 ___F32 *x,
8217 int arg_num),
8218 ());
8219 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_F64)
8220 ___P((___SCMOBJ obj,
8221 ___F64 *x,
8222 int arg_num),
8223 ());
8224 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_CHAR)
8225 ___P((___SCMOBJ obj,
8226 char *x,
8227 int arg_num),
8228 ());
8229 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_SCHAR)
8230 ___P((___SCMOBJ obj,
8231 ___SCHAR *x,
8232 int arg_num),
8233 ());
8234 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCHAR)
8235 ___P((___SCMOBJ obj,
8236 unsigned char *x,
8237 int arg_num),
8238 ());
8239 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ISO_8859_1)
8240 ___P((___SCMOBJ obj,
8241 ___ISO_8859_1 *x,
8242 int arg_num),
8243 ());
8244 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_2)
8245 ___P((___SCMOBJ obj,
8246 ___UCS_2 *x,
8247 int arg_num),
8248 ());
8249 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_4)
8250 ___P((___SCMOBJ obj,
8251 ___UCS_4 *x,
8252 int arg_num),
8253 ());
8254 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_WCHAR)
8255 ___P((___SCMOBJ obj,
8256 ___WCHAR *x,
8257 int arg_num),
8258 ());
8259 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_SHORT)
8260 ___P((___SCMOBJ obj,
8261 short *x,
8262 int arg_num),
8263 ());
8264 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_USHORT)
8265 ___P((___SCMOBJ obj,
8266 unsigned short *x,
8267 int arg_num),
8268 ());
8269 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_INT)
8270 ___P((___SCMOBJ obj,
8271 int *x,
8272 int arg_num),
8273 ());
8274 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UINT)
8275 ___P((___SCMOBJ obj,
8276 unsigned int *x,
8277 int arg_num),
8278 ());
8279 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_LONG)
8280 ___P((___SCMOBJ obj,
8281 long *x,
8282 int arg_num),
8283 ());
8284 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ULONG)
8285 ___P((___SCMOBJ obj,
8286 unsigned long *x,
8287 int arg_num),
8288 ());
8289 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_LONGLONG)
8290 ___P((___SCMOBJ obj,
8291 ___LONGLONG *x,
8292 int arg_num),
8293 ());
8294 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ULONGLONG)
8295 ___P((___SCMOBJ obj,
8296 ___ULONGLONG *x,
8297 int arg_num),
8298 ());
8299 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_FLOAT)
8300 ___P((___SCMOBJ obj,
8301 float *x,
8302 int arg_num),
8303 ());
8304 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_DOUBLE)
8305 ___P((___SCMOBJ obj,
8306 double *x,
8307 int arg_num),
8308 ());
8309 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_STRUCT)
8310 ___P((___SCMOBJ obj,
8311 void **x,
8312 ___SCMOBJ tags,
8313 int arg_num),
8314 ());
8315 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UNION)
8316 ___P((___SCMOBJ obj,
8317 void **x,
8318 ___SCMOBJ tags,
8319 int arg_num),
8320 ());
8321 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_TYPE)
8322 ___P((___SCMOBJ obj,
8323 void **x,
8324 ___SCMOBJ tags,
8325 int arg_num),
8326 ());
8327 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_POINTER)
8328 ___P((___SCMOBJ obj,
8329 void **x,
8330 ___SCMOBJ tags,
8331 int arg_num),
8332 ());
8333 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLPOINTER)
8334 ___P((___SCMOBJ obj,
8335 void **x,
8336 ___SCMOBJ tags,
8337 int arg_num),
8338 ());
8339 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_FUNCTION)
8340 ___P((___SCMOBJ obj,
8341 void *converter,
8342 void **x,
8343 int arg_num),
8344 ());
8345 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLFUNCTION)
8346 ___P((___SCMOBJ obj,
8347 void *converter,
8348 void **x,
8349 int arg_num),
8350 ());
8351 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_BOOL)
8352 ___P((___SCMOBJ obj,
8353 ___BOOL *x,
8354 int arg_num),
8355 ());
8356 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_STRING)
8357 ___P((___SCMOBJ obj,
8358 void **x,
8359 int arg_num,
8360 int char_encoding,
8361 int fudge),
8362 ());
8363 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLSTRING)
8364 ___P((___SCMOBJ obj,
8365 void **x,
8366 int arg_num,
8367 int char_encoding,
8368 int fudge),
8369 ());
8370 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLSTRINGLIST)
8371 ___P((___SCMOBJ obj,
8372 void **x,
8373 int arg_num,
8374 int char_encoding),
8375 ());
8376 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_CHARSTRING)
8377 ___P((___SCMOBJ obj,
8378 char **x,
8379 int arg_num),
8380 ());
8381 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLCHARSTRING)
8382 ___P((___SCMOBJ obj,
8383 char **x,
8384 int arg_num),
8385 ());
8386 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLCHARSTRINGLIST)
8387 ___P((___SCMOBJ obj,
8388 char ***x,
8389 int arg_num),
8390 ());
8391 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ISO_8859_1STRING)
8392 ___P((___SCMOBJ obj,
8393 ___ISO_8859_1STRING *x,
8394 int arg_num),
8395 ());
8396 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLISO_8859_1STRING)
8397 ___P((___SCMOBJ obj,
8398 ___ISO_8859_1STRING *x,
8399 int arg_num),
8400 ());
8401 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST)
8402 ___P((___SCMOBJ obj,
8403 ___ISO_8859_1STRING **x,
8404 int arg_num),
8405 ());
8406 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UTF_8STRING)
8407 ___P((___SCMOBJ obj,
8408 ___UTF_8STRING *x,
8409 int arg_num),
8410 ());
8411 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_8STRING)
8412 ___P((___SCMOBJ obj,
8413 ___UTF_8STRING *x,
8414 int arg_num),
8415 ());
8416 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_8STRINGLIST)
8417 ___P((___SCMOBJ obj,
8418 ___UTF_8STRING **x,
8419 int arg_num),
8420 ());
8421 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UTF_16STRING)
8422 ___P((___SCMOBJ obj,
8423 ___UTF_16STRING *x,
8424 int arg_num),
8425 ());
8426 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_16STRING)
8427 ___P((___SCMOBJ obj,
8428 ___UTF_16STRING *x,
8429 int arg_num),
8430 ());
8431 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_16STRINGLIST)
8432 ___P((___SCMOBJ obj,
8433 ___UTF_16STRING **x,
8434 int arg_num),
8435 ());
8436 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_2STRING)
8437 ___P((___SCMOBJ obj,
8438 ___UCS_2STRING *x,
8439 int arg_num),
8440 ());
8441 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_2STRING)
8442 ___P((___SCMOBJ obj,
8443 ___UCS_2STRING *x,
8444 int arg_num),
8445 ());
8446 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_2STRINGLIST)
8447 ___P((___SCMOBJ obj,
8448 ___UCS_2STRING **x,
8449 int arg_num),
8450 ());
8451 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_4STRING)
8452 ___P((___SCMOBJ obj,
8453 ___UCS_4STRING *x,
8454 int arg_num),
8455 ());
8456 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_4STRING)
8457 ___P((___SCMOBJ obj,
8458 ___UCS_4STRING *x,
8459 int arg_num),
8460 ());
8461 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_4STRINGLIST)
8462 ___P((___SCMOBJ obj,
8463 ___UCS_4STRING **x,
8464 int arg_num),
8465 ());
8466 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_WCHARSTRING)
8467 ___P((___SCMOBJ obj,
8468 ___WCHARSTRING *x,
8469 int arg_num),
8470 ());
8471 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLWCHARSTRING)
8472 ___P((___SCMOBJ obj,
8473 ___WCHARSTRING *x,
8474 int arg_num),
8475 ());
8476 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLWCHARSTRINGLIST)
8477 ___P((___SCMOBJ obj,
8478 ___WCHARSTRING **x,
8479 int arg_num),
8480 ());
8481 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_VARIANT)
8482 ___P((___SCMOBJ obj,
8483 ___VARIANT *x,
8484 int arg_num),
8485 ());
8486 ___IMP_FUNC(___SCMOBJ,___release_foreign)
8487 ___P((___SCMOBJ obj),
8488 ());
8489 ___IMP_FUNC(___SCMOBJ,___release_pointer)
8490 ___P((void *x),
8491 ());
8492 ___IMP_FUNC(___SCMOBJ,___release_function)
8493 ___P((void *x),
8494 ());
8495 ___IMP_FUNC(void,___addref_function)
8496 ___P((void *x),
8497 ());
8498 ___IMP_FUNC(void,___release_string)
8499 ___P((void *x),
8500 ());
8501 ___IMP_FUNC(void,___addref_string)
8502 ___P((void *x),
8503 ());
8504 ___IMP_FUNC(void,___release_string_list)
8505 ___P((void *x),
8506 ());
8507 ___IMP_FUNC(void,___addref_string_list)
8508 ___P((void *x),
8509 ());
8510 ___IMP_FUNC(void,___release_variant)
8511 ___P((___VARIANT x),
8512 ());
8513 ___IMP_FUNC(void,___addref_variant)
8514 ___P((___VARIANT x),
8515 ());
8516 ___IMP_FUNC(___SCMOBJ,___S8_to_SCMOBJ)
8517 ___P((___S8 x,
8518 ___SCMOBJ *obj,
8519 int arg_num),
8520 ());
8521 ___IMP_FUNC(___SCMOBJ,___U8_to_SCMOBJ)
8522 ___P((___U8 x,
8523 ___SCMOBJ *obj,
8524 int arg_num),
8525 ());
8526 ___IMP_FUNC(___SCMOBJ,___S16_to_SCMOBJ)
8527 ___P((___S16 x,
8528 ___SCMOBJ *obj,
8529 int arg_num),
8530 ());
8531 ___IMP_FUNC(___SCMOBJ,___U16_to_SCMOBJ)
8532 ___P((___U16 x,
8533 ___SCMOBJ *obj,
8534 int arg_num),
8535 ());
8536 ___IMP_FUNC(___SCMOBJ,___S32_to_SCMOBJ)
8537 ___P((___S32 x,
8538 ___SCMOBJ *obj,
8539 int arg_num),
8540 ());
8541 ___IMP_FUNC(___SCMOBJ,___U32_to_SCMOBJ)
8542 ___P((___U32 x,
8543 ___SCMOBJ *obj,
8544 int arg_num),
8545 ());
8546 ___IMP_FUNC(___SCMOBJ,___S64_to_SCMOBJ)
8547 ___P((___S64 x,
8548 ___SCMOBJ *obj,
8549 int arg_num),
8550 ());
8551 ___IMP_FUNC(___SCMOBJ,___U64_to_SCMOBJ)
8552 ___P((___U64 x,
8553 ___SCMOBJ *obj,
8554 int arg_num),
8555 ());
8556 ___IMP_FUNC(___SCMOBJ,___F32_to_SCMOBJ)
8557 ___P((___F32 x,
8558 ___SCMOBJ *obj,
8559 int arg_num),
8560 ());
8561 ___IMP_FUNC(___SCMOBJ,___F64_to_SCMOBJ)
8562 ___P((___F64 x,
8563 ___SCMOBJ *obj,
8564 int arg_num),
8565 ());
8566 ___IMP_FUNC(___SCMOBJ,___CHAR_to_SCMOBJ)
8567 ___P((char x,
8568 ___SCMOBJ *obj,
8569 int arg_num),
8570 ());
8571 ___IMP_FUNC(___SCMOBJ,___SCHAR_to_SCMOBJ)
8572 ___P((___SCHAR x,
8573 ___SCMOBJ *obj,
8574 int arg_num),
8575 ());
8576 ___IMP_FUNC(___SCMOBJ,___UCHAR_to_SCMOBJ)
8577 ___P((unsigned char x,
8578 ___SCMOBJ *obj,
8579 int arg_num),
8580 ());
8581 ___IMP_FUNC(___SCMOBJ,___ISO_8859_1_to_SCMOBJ)
8582 ___P((___ISO_8859_1 x,
8583 ___SCMOBJ *obj,
8584 int arg_num),
8585 ());
8586 ___IMP_FUNC(___SCMOBJ,___UCS_2_to_SCMOBJ)
8587 ___P((___UCS_2 x,
8588 ___SCMOBJ *obj,
8589 int arg_num),
8590 ());
8591 ___IMP_FUNC(___SCMOBJ,___UCS_4_to_SCMOBJ)
8592 ___P((___UCS_4 x,
8593 ___SCMOBJ *obj,
8594 int arg_num),
8595 ());
8596 ___IMP_FUNC(___SCMOBJ,___WCHAR_to_SCMOBJ)
8597 ___P((___WCHAR x,
8598 ___SCMOBJ *obj,
8599 int arg_num),
8600 ());
8601 ___IMP_FUNC(___SCMOBJ,___SHORT_to_SCMOBJ)
8602 ___P((short x,
8603 ___SCMOBJ *obj,
8604 int arg_num),
8605 ());
8606 ___IMP_FUNC(___SCMOBJ,___USHORT_to_SCMOBJ)
8607 ___P((unsigned short x,
8608 ___SCMOBJ *obj,
8609 int arg_num),
8610 ());
8611 ___IMP_FUNC(___SCMOBJ,___INT_to_SCMOBJ)
8612 ___P((int x,
8613 ___SCMOBJ *obj,
8614 int arg_num),
8615 ());
8616 ___IMP_FUNC(___SCMOBJ,___UINT_to_SCMOBJ)
8617 ___P((unsigned int x,
8618 ___SCMOBJ *obj,
8619 int arg_num),
8620 ());
8621 ___IMP_FUNC(___SCMOBJ,___LONG_to_SCMOBJ)
8622 ___P((long x,
8623 ___SCMOBJ *obj,
8624 int arg_num),
8625 ());
8626 ___IMP_FUNC(___SCMOBJ,___ULONG_to_SCMOBJ)
8627 ___P((unsigned long x,
8628 ___SCMOBJ *obj,
8629 int arg_num),
8630 ());
8631 ___IMP_FUNC(___SCMOBJ,___LONGLONG_to_SCMOBJ)
8632 ___P((___LONGLONG x,
8633 ___SCMOBJ *obj,
8634 int arg_num),
8635 ());
8636 ___IMP_FUNC(___SCMOBJ,___ULONGLONG_to_SCMOBJ)
8637 ___P((___ULONGLONG x,
8638 ___SCMOBJ *obj,
8639 int arg_num),
8640 ());
8641 ___IMP_FUNC(___SCMOBJ,___FLOAT_to_SCMOBJ)
8642 ___P((float x,
8643 ___SCMOBJ *obj,
8644 int arg_num),
8645 ());
8646 ___IMP_FUNC(___SCMOBJ,___DOUBLE_to_SCMOBJ)
8647 ___P((double x,
8648 ___SCMOBJ *obj,
8649 int arg_num),
8650 ());
8651 ___IMP_FUNC(___SCMOBJ,___STRUCT_to_SCMOBJ)
8652 ___P((void *x,
8653 ___SCMOBJ tags,
8654 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8655 ___SCMOBJ *obj,
8656 int arg_num),
8657 ());
8658 ___IMP_FUNC(___SCMOBJ,___UNION_to_SCMOBJ)
8659 ___P((void *x,
8660 ___SCMOBJ tags,
8661 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8662 ___SCMOBJ *obj,
8663 int arg_num),
8664 ());
8665 ___IMP_FUNC(___SCMOBJ,___TYPE_to_SCMOBJ)
8666 ___P((void *x,
8667 ___SCMOBJ tags,
8668 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8669 ___SCMOBJ *obj,
8670 int arg_num),
8671 ());
8672 ___IMP_FUNC(___SCMOBJ,___POINTER_to_SCMOBJ)
8673 ___P((void *x,
8674 ___SCMOBJ tags,
8675 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8676 ___SCMOBJ *obj,
8677 int arg_num),
8678 ());
8679 ___IMP_FUNC(___SCMOBJ,___NONNULLPOINTER_to_SCMOBJ)
8680 ___P((void *x,
8681 ___SCMOBJ tags,
8682 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8683 ___SCMOBJ *obj,
8684 int arg_num),
8685 ());
8686 ___IMP_FUNC(___SCMOBJ,___FUNCTION_to_SCMOBJ)
8687 ___P((void *x,
8688 ___SCMOBJ *obj,
8689 int arg_num),
8690 ());
8691 ___IMP_FUNC(___SCMOBJ,___NONNULLFUNCTION_to_SCMOBJ)
8692 ___P((void *x,
8693 ___SCMOBJ *obj,
8694 int arg_num),
8695 ());
8696 ___IMP_FUNC(___SCMOBJ,___BOOL_to_SCMOBJ)
8697 ___P((___BOOL x,
8698 ___SCMOBJ *obj,
8699 int arg_num),
8700 ());
8701 ___IMP_FUNC(___SCMOBJ,___STRING_to_SCMOBJ)
8702 ___P((void *x,
8703 ___SCMOBJ *obj,
8704 int arg_num,
8705 int char_encoding),
8706 ());
8707 ___IMP_FUNC(___SCMOBJ,___NONNULLSTRING_to_SCMOBJ)
8708 ___P((void *x,
8709 ___SCMOBJ *obj,
8710 int arg_num,
8711 int char_encoding),
8712 ());
8713 ___IMP_FUNC(___SCMOBJ,___NONNULLSTRINGLIST_to_SCMOBJ)
8714 ___P((void *x,
8715 ___SCMOBJ *obj,
8716 int arg_num,
8717 int char_encoding),
8718 ());
8719 ___IMP_FUNC(___SCMOBJ,___CHARSTRING_to_SCMOBJ)
8720 ___P((char *x,
8721 ___SCMOBJ *obj,
8722 int arg_num),
8723 ());
8724 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRING_to_SCMOBJ)
8725 ___P((char *x,
8726 ___SCMOBJ *obj,
8727 int arg_num),
8728 ());
8729 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRINGLIST_to_SCMOBJ)
8730 ___P((char **x,
8731 ___SCMOBJ *obj,
8732 int arg_num),
8733 ());
8734 ___IMP_FUNC(___SCMOBJ,___ISO_8859_1STRING_to_SCMOBJ)
8735 ___P((___ISO_8859_1STRING x,
8736 ___SCMOBJ *obj,
8737 int arg_num),
8738 ());
8739 ___IMP_FUNC(___SCMOBJ,___NONNULLISO_8859_1STRING_to_SCMOBJ)
8740 ___P((___ISO_8859_1STRING x,
8741 ___SCMOBJ *obj,
8742 int arg_num),
8743 ());
8744 ___IMP_FUNC(___SCMOBJ,___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ)
8745 ___P((___ISO_8859_1STRING *x,
8746 ___SCMOBJ *obj,
8747 int arg_num),
8748 ());
8749 ___IMP_FUNC(___SCMOBJ,___UTF_8STRING_to_SCMOBJ)
8750 ___P((___UTF_8STRING x,
8751 ___SCMOBJ *obj,
8752 int arg_num),
8753 ());
8754 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_8STRING_to_SCMOBJ)
8755 ___P((___UTF_8STRING x,
8756 ___SCMOBJ *obj,
8757 int arg_num),
8758 ());
8759 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_8STRINGLIST_to_SCMOBJ)
8760 ___P((___UTF_8STRING *x,
8761 ___SCMOBJ *obj,
8762 int arg_num),
8763 ());
8764 ___IMP_FUNC(___SCMOBJ,___UTF_16STRING_to_SCMOBJ)
8765 ___P((___UTF_16STRING x,
8766 ___SCMOBJ *obj,
8767 int arg_num),
8768 ());
8769 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_16STRING_to_SCMOBJ)
8770 ___P((___UTF_16STRING x,
8771 ___SCMOBJ *obj,
8772 int arg_num),
8773 ());
8774 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_16STRINGLIST_to_SCMOBJ)
8775 ___P((___UTF_16STRING *x,
8776 ___SCMOBJ *obj,
8777 int arg_num),
8778 ());
8779 ___IMP_FUNC(___SCMOBJ,___UCS_2STRING_to_SCMOBJ)
8780 ___P((___UCS_2STRING x,
8781 ___SCMOBJ *obj,
8782 int arg_num),
8783 ());
8784 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_2STRING_to_SCMOBJ)
8785 ___P((___UCS_2STRING x,
8786 ___SCMOBJ *obj,
8787 int arg_num),
8788 ());
8789 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_2STRINGLIST_to_SCMOBJ)
8790 ___P((___UCS_2STRING *x,
8791 ___SCMOBJ *obj,
8792 int arg_num),
8793 ());
8794 ___IMP_FUNC(___SCMOBJ,___UCS_4STRING_to_SCMOBJ)
8795 ___P((___UCS_4STRING x,
8796 ___SCMOBJ *obj,
8797 int arg_num),
8798 ());
8799 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_4STRING_to_SCMOBJ)
8800 ___P((___UCS_4STRING x,
8801 ___SCMOBJ *obj,
8802 int arg_num),
8803 ());
8804 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_4STRINGLIST_to_SCMOBJ)
8805 ___P((___UCS_4STRING *x,
8806 ___SCMOBJ *obj,
8807 int arg_num),
8808 ());
8809 ___IMP_FUNC(___SCMOBJ,___WCHARSTRING_to_SCMOBJ)
8810 ___P((___WCHARSTRING x,
8811 ___SCMOBJ *obj,
8812 int arg_num),
8813 ());
8814 ___IMP_FUNC(___SCMOBJ,___NONNULLWCHARSTRING_to_SCMOBJ)
8815 ___P((___WCHARSTRING x,
8816 ___SCMOBJ *obj,
8817 int arg_num),
8818 ());
8819 ___IMP_FUNC(___SCMOBJ,___NONNULLWCHARSTRINGLIST_to_SCMOBJ)
8820 ___P((___WCHARSTRING *x,
8821 ___SCMOBJ *obj,
8822 int arg_num),
8823 ());
8824 ___IMP_FUNC(___SCMOBJ,___VARIANT_to_SCMOBJ)
8825 ___P((___VARIANT x,
8826 ___SCMOBJ *obj,
8827 int arg_num),
8828 ());
8829 ___IMP_FUNC(___SCMOBJ,___CHARSTRING_to_UCS_2STRING)
8830 ___P((char *str_char,
8831 ___UCS_2STRING *str_UCS_2),
8832 ());
8833 ___IMP_FUNC(void,___free_UCS_2STRING)
8834 ___P((___UCS_2STRING str_UCS_2),
8835 ());
8836 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST)
8837 ___P((char **str_list_char,
8838 ___UCS_2STRING **str_list_UCS_2),
8839 ());
8840 ___IMP_FUNC(void,___free_NONNULLUCS_2STRINGLIST)
8841 ___P((___UCS_2STRING *str_list_UCS_2),
8842 ());
8843 ___IMP_FUNC(___SCMOBJ,___make_sfun_stack_marker)
8844 ___P((___SCMOBJ *marker,
8845 ___SCMOBJ proc_or_false),
8846 ());
8847 ___IMP_FUNC(void,___kill_sfun_stack_marker)
8848 ___P((___SCMOBJ marker),
8849 ());
8850 #endif
8852 #ifndef ___INCLUDED_FROM_MEM
8853 ___IMP_FUNC(void*,___alloc_rc)
8854 ___P((unsigned long bytes),
8855 ());
8856 ___IMP_FUNC(void,___release_rc)
8857 ___P((void *ptr),
8858 ());
8859 ___IMP_FUNC(void,___addref_rc)
8860 ___P((void *ptr),
8861 ());
8862 ___IMP_FUNC(___SCMOBJ,___data_rc)
8863 ___P((void *ptr),
8864 ());
8865 ___IMP_FUNC(void,___set_data_rc)
8866 ___P((void *ptr,
8867 ___SCMOBJ val),
8868 ());
8869 ___IMP_FUNC(___SCMOBJ,___alloc_scmobj)
8870 ___P((int subtype,
8871 long bytes,
8872 int kind),
8873 ());
8874 ___IMP_FUNC(void,___release_scmobj)
8875 ___P((___SCMOBJ obj),
8876 ());
8877 ___IMP_FUNC(___SCMOBJ,___make_pair)
8878 ___P((___SCMOBJ car,
8879 ___SCMOBJ cdr,
8880 int kind),
8881 ());
8882 ___IMP_FUNC(___SCMOBJ,___make_vector)
8883 ___P((long length,
8884 ___SCMOBJ init,
8885 int kind),
8886 ());
8887 ___IMP_FUNC(void,___still_obj_refcount_inc)
8888 ___P((___SCMOBJ obj),
8889 ());
8890 ___IMP_FUNC(void,___still_obj_refcount_dec)
8891 ___P((___SCMOBJ obj),
8892 ());
8893 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_ref)
8894 ___P((___SCMOBJ ht,
8895 ___SCMOBJ key),
8896 ());
8897 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_set)
8898 ___P((___SCMOBJ ht,
8899 ___SCMOBJ key,
8900 ___SCMOBJ val),
8901 ());
8902 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_rehash)
8903 ___P((___SCMOBJ ht_src,
8904 ___SCMOBJ ht_dst),
8905 ());
8906 #endif
8908 #ifndef ___INCLUDED_FROM_SETUP
8909 ___GSTATE_DECL
8910 ___IMP_FUNC(___BOOL,___iswalpha)
8911 ___P((___UCS_4 x),
8912 ());
8913 ___IMP_FUNC(___BOOL,___iswdigit)
8914 ___P((___UCS_4 x),
8915 ());
8916 ___IMP_FUNC(___BOOL,___iswspace)
8917 ___P((___UCS_4 x),
8918 ());
8919 ___IMP_FUNC(___BOOL,___iswupper)
8920 ___P((___UCS_4 x),
8921 ());
8922 ___IMP_FUNC(___BOOL,___iswlower)
8923 ___P((___UCS_4 x),
8924 ());
8925 ___IMP_FUNC(___UCS_4,___towupper)
8926 ___P((___UCS_4 x),
8927 ());
8928 ___IMP_FUNC(___UCS_4,___towlower)
8929 ___P((___UCS_4 x),
8930 ());
8931 ___IMP_FUNC(___SCMOBJ,___string_collate)
8932 ___P((___SCMOBJ s1,
8933 ___SCMOBJ s2),
8934 ());
8935 ___IMP_FUNC(___SCMOBJ,___string_collate_ci)
8936 ___P((___SCMOBJ s1,
8937 ___SCMOBJ s2),
8938 ());
8939 ___IMP_FUNC(double,___copysign)
8940 ___P((double x,
8941 double y),
8942 ());
8943 ___IMP_FUNC(___BOOL,___isfinite)
8944 ___P((double x),
8945 ());
8946 ___IMP_FUNC(___BOOL,___isnan)
8947 ___P((double x),
8948 ());
8949 ___IMP_FUNC(double,___trunc)
8950 ___P((double x),
8951 ());
8952 ___IMP_FUNC(double,___round)
8953 ___P((double x),
8954 ());
8955 #ifndef ___GOOD_ATAN2
8956 ___IMP_FUNC(double,___atan2)
8957 ___P((double y,
8958 double x),
8959 ());
8960 #endif
8961 #ifndef ___GOOD_POW
8962 ___IMP_FUNC(double,___pow)
8963 ___P((double x,
8964 double y),
8965 ());
8966 #endif
8967 ___IMP_FUNC(void,___setup_params_reset)
8968 ___P((struct ___setup_params_struct *setup_params),
8969 ());
8970 ___IMP_FUNC(___SCMOBJ,___setup)
8971 ___P((struct ___setup_params_struct *setup_params),
8972 ());
8973 ___IMP_FUNC(unsigned long,___get_min_heap) ___PVOID;
8974 ___IMP_FUNC(void,___set_min_heap)
8975 ___P((unsigned long bytes),
8976 ());
8977 ___IMP_FUNC(unsigned long,___get_max_heap) ___PVOID;
8978 ___IMP_FUNC(void,___set_max_heap)
8979 ___P((unsigned long bytes),
8980 ());
8981 ___IMP_FUNC(int,___get_live_percent) ___PVOID;
8982 ___IMP_FUNC(void,___set_live_percent)
8983 ___P((int percent),
8984 ());
8985 ___IMP_FUNC(int,___get_standard_level) ___PVOID;
8986 ___IMP_FUNC(void,___set_standard_level)
8987 ___P((int level),
8988 ());
8989 ___IMP_FUNC(int,___set_debug_settings)
8990 ___P((int mask,
8991 int new_settings),
8992 ());
8993 ___IMP_FUNC(___program_startup_info_struct*,___get_program_startup_info)
8994 ___PVOID;
8995 ___IMP_FUNC(void,___cleanup) ___PVOID;
8996 ___IMP_FUNC(void,___cleanup_and_exit_process)
8997 ___P((int status),
8998 ());
8999 ___IMP_FUNC(___SCMOBJ,___call)
9000 ___P((int nargs,
9001 ___SCMOBJ proc,
9002 ___SCMOBJ marker),
9003 ());
9004 ___IMP_FUNC(void,___propagate_error)
9005 ___P((___SCMOBJ err),
9006 ());
9007 #ifdef ___DEBUG_HOST_CHANGES
9008 ___IMP_FUNC(void,___register_host_entry)
9009 ___P((___WORD start,
9010 char *module_name),
9011 ());
9012 #endif
9013 ___IMP_FUNC(void,___raise_interrupt)
9014 ___P((int code),
9015 ());
9016 ___IMP_FUNC(void,___begin_interrupt_service) ___PVOID;
9017 ___IMP_FUNC(___BOOL,___check_interrupt)
9018 ___P((int code),
9019 ());
9020 ___IMP_FUNC(void,___end_interrupt_service)
9021 ___P((int code),
9022 ());
9023 ___IMP_FUNC(void,___disable_interrupts) ___PVOID;
9024 ___IMP_FUNC(void,___enable_interrupts) ___PVOID;
9025 #endif
9027 #ifndef ___INCLUDED_FROM_OS_BASE
9028 ___IMP_FUNC(void *,___alloc_mem)
9029 ___P((unsigned long bytes),
9030 ());
9031 ___IMP_FUNC(void,___free_mem)
9032 ___P((void *ptr),
9033 ());
9034 ___IMP_FUNC(void *,___alloc_mem_code)
9035 ___P((unsigned long bytes),
9036 ());
9037 ___IMP_FUNC(void,___free_mem_code)
9038 ___P((void *ptr),
9039 ());
9040 #endif
9042 #ifndef ___INCLUDED_FROM_OS_TIME
9043 ___IMP_FUNC(void,___disable_heartbeat_interrupts) ___PVOID;
9044 ___IMP_FUNC(void,___enable_heartbeat_interrupts) ___PVOID;
9045 #endif
9047 #endif
9048 #endif