Add REPL comma commands: ,N+ and ,N- and ,++ and ,-- .
[gambit-c.git] / include / gambit.h.in
blob883c6734405e843021297c13516666f457a212ac
1 /* File: "gambit.h", Time-stamp: <2009-11-26 16:22:25 feeley> */
3 /*
4 * Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
5 */
7 #ifndef ___VERSION
8 #error "___VERSION has not been set by includer"
9 #endif
11 #if ___VERSION != 405003
12 #include "gambit-not405003.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 #endif
416 #ifdef ___CPU_vax
417 #define ___LITTLE_ENDIAN
418 #endif
420 #ifndef ___LITTLE_ENDIAN
421 #define ___BIG_ENDIAN
422 #endif
424 #endif
425 #endif
428 * Determine the number of bits in various integer and floating point
429 * types and define appropriate macros accordingly. The macro for a
430 * given type is not defined if the type is not supported by the C
431 * compiler or if it is not 8, 16, 32 or 64 bits wide.
434 #ifndef ___CHAR_WIDTH
435 #ifdef ___DONT_HAVE_LIMITS_H
438 * If the file "limits.h" is not available then the symbol
439 * ___DONT_HAVE_LIMITS_H must be defined (for example on the compiler's
440 * command line) and the following definitions will be used:
443 #define ___CHAR_WIDTH 8 /* if needed, edit to suit your platform */
444 #define ___SHORT_WIDTH 16
445 #define ___INT_WIDTH 32
446 #define ___LONG_WIDTH 32
448 #ifdef __GNUC__
449 #define ___LONGLONG_WIDTH 64
450 #endif
452 #else
455 * If the file "limits.h" is available then it contains macros
456 * defining the range of the integer types. The following
457 * preprocessor conditional definitions are written so that they will
458 * work regardless of the number of bits in the integer types
459 * supported by the compiler (many compilers for 32 bit machines give
460 * an error for C preprocessor expressions like ULONG_MAX >> 32 or
461 * ULLONG_MAX == 18446744073709551615UL). Some parentheses seem
462 * redundant, but they are required for MS Visual C/C++ whose
463 * preprocessor signals an error on: x >> 8 >> 8.
466 #include <limits.h>
468 #ifdef UCHAR_MAX
469 #if (UCHAR_MAX & 255) == 255
470 #if (UCHAR_MAX >> 8) == 0
471 #define ___CHAR_WIDTH 8
472 #else
473 #if ((UCHAR_MAX >> 8) & 255) == 255
474 #if ((UCHAR_MAX >> 8) >> 8) == 0
475 #define ___CHAR_WIDTH 16
476 #else
477 #if (((UCHAR_MAX >> 8) >> 8) & 255) == 255
478 #if (((UCHAR_MAX >> 8) >> 8) >> 8) != 0
479 #if ((((UCHAR_MAX >> 8) >> 8) >> 8) & 255) == 255
480 #if ((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) == 0
481 #define ___CHAR_WIDTH 32
482 #else
483 #if (((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
484 #if (((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
485 #if ((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
486 #if ((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
487 #if (((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
488 #if (((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
489 #if ((((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
490 #if ((((((((UCHAR_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
491 #define ___CHAR_WIDTH 64
492 #endif
493 #endif
494 #endif
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
510 #ifdef USHRT_MAX
511 #if (USHRT_MAX & 255) == 255
512 #if (USHRT_MAX >> 8) == 0
513 #define ___SHORT_WIDTH 8
514 #else
515 #if ((USHRT_MAX >> 8) & 255) == 255
516 #if ((USHRT_MAX >> 8) >> 8) == 0
517 #define ___SHORT_WIDTH 16
518 #else
519 #if (((USHRT_MAX >> 8) >> 8) & 255) == 255
520 #if (((USHRT_MAX >> 8) >> 8) >> 8) != 0
521 #if ((((USHRT_MAX >> 8) >> 8) >> 8) & 255) == 255
522 #if ((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) == 0
523 #define ___SHORT_WIDTH 32
524 #else
525 #if (((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
526 #if (((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
527 #if ((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
528 #if ((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
529 #if (((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
530 #if (((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
531 #if ((((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
532 #if ((((((((USHRT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
533 #define ___SHORT_WIDTH 64
534 #endif
535 #endif
536 #endif
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
552 #ifdef UINT_MAX
553 #if (UINT_MAX & 255) == 255
554 #if (UINT_MAX >> 8) == 0
555 #define ___INT_WIDTH 8
556 #else
557 #if ((UINT_MAX >> 8) & 255) == 255
558 #if ((UINT_MAX >> 8) >> 8) == 0
559 #define ___INT_WIDTH 16
560 #else
561 #if (((UINT_MAX >> 8) >> 8) & 255) == 255
562 #if (((UINT_MAX >> 8) >> 8) >> 8) != 0
563 #if ((((UINT_MAX >> 8) >> 8) >> 8) & 255) == 255
564 #if ((((UINT_MAX >> 8) >> 8) >> 8) >> 8) == 0
565 #define ___INT_WIDTH 32
566 #else
567 #if (((((UINT_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
568 #if (((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
569 #if ((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
570 #if ((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
571 #if (((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
572 #if (((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
573 #if ((((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
574 #if ((((((((UINT_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
575 #define ___INT_WIDTH 64
576 #endif
577 #endif
578 #endif
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
594 #ifdef ULONG_MAX
595 #if (ULONG_MAX & 255) == 255
596 #if (ULONG_MAX >> 8) == 0
597 #define ___LONG_WIDTH 8
598 #else
599 #if ((ULONG_MAX >> 8) & 255) == 255
600 #if ((ULONG_MAX >> 8) >> 8) == 0
601 #define ___LONG_WIDTH 16
602 #else
603 #if (((ULONG_MAX >> 8) >> 8) & 255) == 255
604 #if (((ULONG_MAX >> 8) >> 8) >> 8) != 0
605 #if ((((ULONG_MAX >> 8) >> 8) >> 8) & 255) == 255
606 #if ((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) == 0
607 #define ___LONG_WIDTH 32
608 #else
609 #if (((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
610 #if (((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
611 #if ((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
612 #if ((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
613 #if (((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
614 #if (((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
615 #if ((((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
616 #if ((((((((ULONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
617 #define ___LONG_WIDTH 64
618 #endif
619 #endif
620 #endif
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
636 #ifdef __GNUC__
638 #define ___LONGLONG_WIDTH 64
640 #else
642 /* Handle some non ISO C99 compilers that nevertheless support "long long". */
644 #ifndef ULLONG_MAX
645 #ifdef ULONGLONG_MAX
646 #define ULLONG_MAX ULONGLONG_MAX
647 #else
648 #ifdef ULONG_LONG_MAX
649 #define ULLONG_MAX ULONG_LONG_MAX
650 #endif
651 #endif
652 #endif
654 #ifdef ULLONG_MAX
655 #if (ULLONG_MAX & 255) == 255
656 #if (ULLONG_MAX >> 8) == 0
657 #define ___LONGLONG_WIDTH 8
658 #else
659 #if ((ULLONG_MAX >> 8) & 255) == 255
660 #if ((ULLONG_MAX >> 8) >> 8) == 0
661 #define ___LONGLONG_WIDTH 16
662 #else
663 #if (((ULLONG_MAX >> 8) >> 8) & 255) == 255
664 #if (((ULLONG_MAX >> 8) >> 8) >> 8) != 0
665 #if ((((ULLONG_MAX >> 8) >> 8) >> 8) & 255) == 255
666 #if ((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) == 0
667 #define ___LONGLONG_WIDTH 32
668 #else
669 #if (((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) & 255) == 255
670 #if (((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) != 0
671 #if ((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
672 #if ((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
673 #if (((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
674 #if (((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) != 0
675 #if ((((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) & 255) == 255
676 #if ((((((((ULLONG_MAX >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) >> 8) == 0
677 #define ___LONGLONG_WIDTH 64
678 #endif
679 #endif
680 #endif
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
696 #endif
698 #endif
701 * If the "long long" type is not supported, then substitute the type
702 * "long".
705 #ifndef ___LONGLONG_WIDTH
706 #define ___LONGLONG_WIDTH ___LONG_WIDTH
707 #define ___LONGLONG long
708 #define ___ULONGLONG unsigned long
709 #else
710 #define ___LONGLONG long long
711 #define ___ULONGLONG unsigned long long
712 #endif
715 * Some old C compilers do not support the "signed char" and "wchar_t"
716 * types. The following preprocessor directives allow these types to
717 * be redefined (such as on the C compiler's command line, in
718 * "config.h", ...).
721 #ifndef ___SCHAR
722 #define ___SCHAR signed char
723 #endif
725 #ifndef ___WCHAR
726 #ifdef ___DONT_HAVE_WCHAR_H
729 * If the file "wchar.h" is not available then the symbol
730 * ___DONT_HAVE_WCHAR_H must be defined (for example on the compiler's
731 * command line) and the following definitions will be used:
734 #define ___WCHAR unsigned char
735 #define ___WCHAR_MIN 0
736 #define ___WCHAR_MAX ((1<<___CHAR_WIDTH)-1)
738 #else
741 * If the file "wchar.h" is available then it should contain macros
742 * defining the range of the wchar_t type.
745 #include <wchar.h>
747 #define ___WCHAR wchar_t
749 #ifdef WCHAR_MIN
750 #define ___WCHAR_MIN WCHAR_MIN
751 #else
752 #define ___WCHAR_MIN 0
753 #endif
755 #ifdef WCHAR_MAX
756 #define ___WCHAR_MAX WCHAR_MAX
757 #else
758 #ifdef UINT_MAX
759 #define ___WCHAR_MAX UINT_MAX
760 #else
761 #define ___WCHAR_MAX ((1<<___CHAR_WIDTH)-1)
762 #endif
763 #endif
765 #endif
766 #endif
768 #ifdef ___DONT_HAVE_FLOAT_H
771 * If the file "float.h" is not available then the symbol
772 * ___DONT_HAVE_FLOAT_H must be defined (for example on the compiler's
773 * command line) and the following definitions will be used:
776 #define ___FLOAT_WIDTH 32 /* if needed, edit to suit your platform */
777 #define ___DOUBLE_WIDTH 64
779 #else
782 * If the file "float.h" is available then it contains macros defining
783 * the range of the floating point types. The following preprocessor
784 * conditional definitions are not completely correct (and may not
785 * even compile properly because it is possible that FLT_MAX_EXP and
786 * DBL_MAX_EXP are not constant expressions). However, it appears to
787 * work on a wide range of platforms.
790 #include <float.h>
792 #ifdef FLT_MAX_EXP
793 #if FLT_MAX_EXP == 128
794 #define ___FLOAT_WIDTH 32
795 #else
796 #if FLT_MAX_EXP == 1024
797 #define ___FLOAT_WIDTH 64
798 #endif
799 #endif
800 #endif
802 #ifdef DBL_MAX_EXP
803 #if DBL_MAX_EXP == 128
804 #define ___DOUBLE_WIDTH 32
805 #else
806 #if DBL_MAX_EXP == 1024
807 #define ___DOUBLE_WIDTH 64
808 #endif
809 #endif
810 #endif
812 #endif
813 #endif
816 * Size of pointers.
818 * ___VOIDSTAR_WIDTH must be equal to sizeof(void*) * ___CHAR_WIDTH.
819 * This value can't be computed with the "sizeof" operator because it
820 * must be known at macro expansion time. If in doubt just do
822 * #define ___VOIDSTAR_WIDTH ___LONG_WIDTH
826 #ifndef ___VOIDSTAR_WIDTH
827 #define ___VOIDSTAR_WIDTH @CONF_VOIDSTAR_WIDTH@
828 #endif
830 #if ___VOIDSTAR_WIDTH == 32
831 #undef ___USE_32_BIT_ADDR
832 #define ___USE_32_BIT_ADDR
833 #endif
835 /*---------------------------------------------------------------------------*/
838 * The following symbols must be defined to reflect the integer and
839 * floating-point data types supported by the C compiler. A symbol is
840 * only defined if the data type exists. At least ___F64 and one of
841 * the pairs ___S32/___U32 and ___S64/___U64 must be defined.
843 * define ___S8 as the signed integer type of exactly 8 bits
844 * define ___U8 as the unsigned integer type of exactly 8 bits
845 * define ___SM8 as the signed integer type of at least 8 bits
846 * define ___UM8 as the unsigned integer type of at least 8 bits
848 * define ___S16 as the signed integer type of exactly 16 bits
849 * define ___U16 as the unsigned integer type of exactly 16 bits
850 * define ___SM16 as the signed integer type of at least 16 bits
851 * define ___UM16 as the unsigned integer type of at least 16 bits
853 * define ___S32 as the signed integer type of exactly 32 bits
854 * define ___U32 as the unsigned integer type of exactly 32 bits
855 * define ___SM32 as the signed integer type of at least 32 bits
856 * define ___UM32 as the unsigned integer type of at least 32 bits
858 * define ___S64 as the signed integer type of exactly 64 bits
859 * define ___U64 as the unsigned integer type of exactly 64 bits
860 * define ___SM64 as the signed integer type of at least 64 bits
861 * define ___UM64 as the unsigned integer type of at least 64 bits
863 * define ___F32 as the 32 bit floating-point type
864 * define ___F64 as the 64 bit floating-point type
868 * First we make sure that the width of all the integer and
869 * floating-point types is known.
872 #ifndef ___CHAR_WIDTH
873 #error "The definition for ___CHAR_WIDTH is missing"
874 #endif
876 #ifndef ___SHORT_WIDTH
877 #error "The definition for ___SHORT_WIDTH is missing"
878 #endif
880 #ifndef ___INT_WIDTH
881 #error "The definition for ___INT_WIDTH is missing"
882 #endif
884 #ifndef ___LONG_WIDTH
885 #error "The definition for ___LONG_WIDTH is missing"
886 #endif
888 #ifndef ___LONGLONG_WIDTH
889 #error "The definition for ___LONGLONG_WIDTH is missing"
890 #endif
892 #ifndef ___FLOAT_WIDTH
893 #error "The definition for ___FLOAT_WIDTH is missing"
894 #endif
896 #ifndef ___DOUBLE_WIDTH
897 #error "The definition for ___DOUBLE_WIDTH is missing"
898 #endif
900 #if ___INT_WIDTH == 8
901 #define ___S8 int
902 #define ___U8 unsigned int
903 #else
904 #if ___LONG_WIDTH == 8
905 #define ___S8 long
906 #define ___U8 unsigned long
907 #else
908 #if ___SHORT_WIDTH == 8
909 #define ___S8 short
910 #define ___U8 unsigned short
911 #else
912 #if ___CHAR_WIDTH == 8
913 #define ___S8 ___SCHAR
914 #define ___U8 unsigned char
915 #else
916 #if ___LONGLONG_WIDTH == 8
917 #define ___S8 ___LONGLONG
918 #define ___U8 unsigned ___LONGLONG
919 #endif
920 #endif
921 #endif
922 #endif
923 #endif
925 #if ___INT_WIDTH == 16
926 #define ___S16 int
927 #define ___U16 unsigned int
928 #else
929 #if ___LONG_WIDTH == 16
930 #define ___S16 long
931 #define ___U16 unsigned long
932 #else
933 #if ___SHORT_WIDTH == 16
934 #define ___S16 short
935 #define ___U16 unsigned short
936 #else
937 #if ___CHAR_WIDTH == 16
938 #define ___S16 ___SCHAR
939 #define ___U16 unsigned char
940 #else
941 #if ___LONGLONG_WIDTH == 16
942 #define ___S16 ___LONGLONG
943 #define ___U16 unsigned ___LONGLONG
944 #endif
945 #endif
946 #endif
947 #endif
948 #endif
950 #if ___INT_WIDTH == 32
951 #define ___S32 int
952 #define ___U32 unsigned int
953 #else
954 #if ___LONG_WIDTH == 32
955 #define ___S32 long
956 #define ___U32 unsigned long
957 #else
958 #if ___SHORT_WIDTH == 32
959 #define ___S32 short
960 #define ___U32 unsigned short
961 #else
962 #if ___CHAR_WIDTH == 32
963 #define ___S32 ___SCHAR
964 #define ___U32 unsigned char
965 #else
966 #if ___LONGLONG_WIDTH == 32
967 #define ___S32 ___LONGLONG
968 #define ___U32 unsigned ___LONGLONG
969 #endif
970 #endif
971 #endif
972 #endif
973 #endif
975 #if ___INT_WIDTH == 64
976 #define ___S64 int
977 #define ___U64 unsigned int
978 #else
979 #if ___LONG_WIDTH == 64
980 #define ___S64 long
981 #define ___U64 unsigned long
982 #else
983 #if ___SHORT_WIDTH == 64
984 #define ___S64 short
985 #define ___U64 unsigned short
986 #else
987 #if ___CHAR_WIDTH == 64
988 #define ___S64 ___SCHAR
989 #define ___U64 unsigned char
990 #else
991 #if ___LONGLONG_WIDTH == 64
992 #define ___S64 ___LONGLONG
993 #define ___U64 unsigned ___LONGLONG
994 #endif
995 #endif
996 #endif
997 #endif
998 #endif
1000 #if ___FLOAT_WIDTH == 32
1001 #define ___F32 float
1002 #else
1003 #if ___DOUBLE_WIDTH == 32
1004 #define ___F32 double
1005 #endif
1006 #endif
1008 #if ___DOUBLE_WIDTH == 64
1009 #define ___F64 double
1010 #else
1011 #if ___FLOAT_WIDTH == 64
1012 #define ___F64 float
1013 #endif
1014 #endif
1016 #ifdef ___S64
1017 #define ___BUILTIN_64BIT_INT_TYPE
1018 #define ___SM64 ___S64
1019 #define ___UM64 ___U64
1020 #endif
1022 #ifdef ___S32
1023 #define ___SM32 ___S32
1024 #define ___UM32 ___U32
1025 #else
1026 #define ___SM32 ___SM64
1027 #define ___UM32 ___UM64
1028 #endif
1030 #ifdef ___S16
1031 #define ___SM16 ___S16
1032 #define ___UM16 ___U16
1033 #else
1034 #define ___SM16 ___SM32
1035 #define ___UM16 ___UM32
1036 #endif
1038 #ifdef ___S8
1039 #define ___SM8 ___S8
1040 #define ___UM8 ___U8
1041 #else
1042 #define ___SM8 ___SM16
1043 #define ___UM8 ___UM16
1044 #endif
1046 /*---------------------------------------------------------------------------*/
1048 /* SANITY CHECKS AND SETTING OF DEFAULT OPTIONS */
1051 * Verify that the byte order endianness is known.
1054 #ifdef ___BIG_ENDIAN
1055 #ifdef ___LITTLE_ENDIAN
1056 #error "Define either ___BIG_ENDIAN or ___LITTLE_ENDIAN"
1057 #endif
1058 #else
1059 #ifndef ___LITTLE_ENDIAN
1060 #error "Define either ___BIG_ENDIAN or ___LITTLE_ENDIAN"
1061 #endif
1062 #endif
1065 * Generate a single host C procedure or multiple C host
1066 * procedures (default) per Scheme module?
1069 #ifdef ___SINGLE_HOST
1070 #ifdef ___MULTIPLE_HOSTS
1071 #error "Define either ___SINGLE_HOST or ___MULTIPLE_HOSTS"
1072 #endif
1073 #else
1074 #ifndef ___MULTIPLE_HOSTS
1075 #define ___MULTIPLE_HOSTS
1076 #endif
1077 #endif
1080 * Compiling for dynamic loading or not (default).
1083 #ifdef ___DYNAMIC
1084 #ifdef ___NONDYNAMIC
1085 #error "Define either ___DYNAMIC or ___NONDYNAMIC"
1086 #endif
1087 #else
1088 #ifndef ___NONDYNAMIC
1089 #define ___NONDYNAMIC
1090 #endif
1091 #endif
1094 * Define symbols appropriate for dynamic loading.
1097 #ifdef ___DYNAMIC
1098 #undef ___PRIMAL
1099 #define ___PRIMAL
1100 #undef ___LIBRARY
1101 #define ___LIBRARY
1102 #undef ___SHARED
1103 #define ___SHARED
1104 #undef ___BIND_LATE
1105 #define ___BIND_LATE
1106 #endif
1109 * Compiling to produce a library or an application with a "main" (default
1110 * unless compiling a flat link file).
1113 #ifdef ___LIBRARY
1114 #ifdef ___APPLICATION
1115 #error "Define either ___LIBRARY or ___APPLICATION"
1116 #endif
1117 #else
1118 #ifndef ___APPLICATION
1119 #ifdef ___FLAT_LINKFILE
1120 #define ___LIBRARY
1121 #else
1122 #define ___APPLICATION
1123 #endif
1124 #endif
1125 #endif
1128 * Compiling to produce a shared-library or not (default).
1131 #ifdef ___DYNAMIC_LIB
1132 #define ___SHARED
1133 #endif
1135 #ifdef ___SHARED
1136 #ifdef ___NONSHARED
1137 #error "Define either ___SHARED or ___NONSHARED"
1138 #endif
1139 #else
1140 #ifndef ___NONSHARED
1141 #define ___NONSHARED
1142 #endif
1143 #endif
1146 * Select binding time for global variables, symbols, and keywords.
1147 * Early binding (default) produces faster code because it directly
1148 * accesses the resource. Late binding does an indirection at run
1149 * time.
1152 #ifdef ___BIND_LATE
1153 #ifdef ___BIND_EARLY
1154 #error "Define either ___BIND_LATE or ___BIND_EARLY"
1155 #endif
1156 #else
1157 #ifndef ___BIND_EARLY
1158 #define ___BIND_EARLY
1159 #endif
1160 #endif
1163 * Range and size of Scheme characters.
1165 * ___MAX_CHR must be 0xff, 0xffff or 0x10ffff. The value 0xff is
1166 * appropriate when text is limited to the ISO-8859-1 subset of
1167 * Unicode. The value 0xffff is for when text is limited to the BMP
1168 * (Basic Multilingual Plane) subset of Unicode. The value 0x10ffff
1169 * allows all Unicode characters in text. Note that the number of
1170 * bytes per character in a string depends on ___MAX_CHR as follows:
1172 * ___MAX_CHR = 0xff => 1 byte per character
1173 * ___MAX_CHR = 0xffff => 2 bytes per character
1174 * ___MAX_CHR = 0x10ffff => 4 bytes per character
1176 * If in doubt just do
1178 * #define ___MAX_CHR 0x10ffff
1182 #ifndef ___MAX_CHR
1183 #define ___MAX_CHR @CONF_MAX_CHR@
1184 #endif
1187 * Number of registers in the virtual machine. These definitions must
1188 * agree with those in the file "gsc/_t-c-1.scm". All Scheme sources
1189 * must be recompiled if these definitions are changed.
1191 * ___NB_GVM_REGS = total number of registers available
1192 * 3 <= ___NB_GVM_REGS <= 25
1193 * ___NB_ARG_REGS = maximum number of arguments passed in registers
1194 * 1 <= ___NB_ARG_REGS <= min( 12, ___NB_GVM_REGS-2 )
1197 #define ___NB_GVM_REGS 5
1198 #define ___NB_ARG_REGS 3
1201 * Determine if label values (a gcc extension to C) should be used.
1204 #ifdef ___USE_LABEL_VALUES
1205 #ifdef ___NOT_USE_LABEL_VALUES
1206 #error "Define either ___USE_LABEL_VALUES or ___NOT_USE_LABEL_VALUES"
1207 #endif
1208 #else
1209 #ifndef ___NOT_USE_LABEL_VALUES
1210 #ifdef __GNUC__
1211 #define ___USE_LABEL_VALUES
1212 #else
1213 #define ___NOT_USE_LABEL_VALUES
1214 #endif
1215 #endif
1216 #endif
1219 /*---------------------------------------------------------------------------*/
1221 /* Dependencies on language (i.e. C++, ANSI-C, and K&R C). */
1223 #ifdef __cplusplus
1225 #define ___P(ansi,kr)ansi
1226 #define ___PVOID ()
1228 #define ___BEGIN_C_LINKAGE extern "C" {
1229 #define ___END_C_LINKAGE }
1231 #define ___BOOL int /* should be "bool" but some compilers don't support it */
1233 #define ___USE_CPLUSPLUS_NEW_DELETE
1234 #define ___USE_CPLUSPLUS_CLEANUP
1236 #else
1238 #ifdef __STDC__
1240 #define ___P(ansi,kr)ansi
1241 #define ___PVOID (void)
1243 #else
1245 #define ___P(ansi,kr)kr
1246 #define ___PVOID ()
1248 #endif
1250 #define ___BEGIN_C_LINKAGE
1251 #define ___END_C_LINKAGE
1253 #define ___BOOL int
1255 #undef ___USE_SETJMP
1256 #define ___USE_SETJMP
1258 #endif
1261 #ifdef ___USE_SETJMP
1263 #ifdef ___DONT_HAVE_SETJMP_H
1266 * If the file "setjmp.h" is not available then the symbol
1267 * ___DONT_HAVE_SETJMP_H must be defined (for example on the compiler's
1268 * command line). In this case we assume that setjmp is defined as
1269 * a macro.
1272 #undef ___CAN_IMPORT_SETJMP_DYNAMICALLY
1273 #define ___CAN_IMPORT_SETJMP_DYNAMICALLY
1275 #else
1278 * If the file "setjmp.h" is available then we can use the C
1279 * preprocessor to check if setjmp is a macro (otherwise it has to be
1280 * a function). If it is a macro then we can't get a pointer to it!
1283 #include <setjmp.h>
1285 #ifdef setjmp
1286 #undef ___CAN_IMPORT_SETJMP_DYNAMICALLY
1287 #define ___CAN_IMPORT_SETJMP_DYNAMICALLY
1288 #endif
1290 #endif
1292 #endif
1295 /*---------------------------------------------------------------------------*/
1297 /* Visibility directives. */
1299 #ifndef ___HIDDEN
1300 #define ___HIDDEN static
1301 #endif
1303 #ifndef ___LOCAL
1304 #define ___LOCAL static
1305 #endif
1307 #ifdef _MSC_VER
1308 #define ___USE_DECLSPEC
1309 #endif
1311 #ifdef __WATCOMC__
1312 #define ___USE_DECLSPEC
1313 #endif
1315 #ifdef ___USE_DECLSPEC
1316 #define ___EXPORT_FUNC(type,name)__declspec(dllexport) type name
1317 #define ___EXPORT_DATA(type,name)__declspec(dllexport) type name
1318 #define ___IMPORT_FUNC(type,name)__declspec(dllimport) type name
1319 #define ___IMPORT_DATA(type,name)__declspec(dllimport) type name
1320 #endif
1322 #ifndef ___EXPORT_FUNC
1323 #define ___EXPORT_FUNC(type,name)type name
1324 #endif
1326 #ifndef ___EXPORT_DATA
1327 #define ___EXPORT_DATA(type,name)type name
1328 #endif
1330 #ifndef ___IMPORT_FUNC
1331 #define ___IMPORT_FUNC(type,name)extern type name
1332 #endif
1334 #ifndef ___IMPORT_DATA
1335 #define ___IMPORT_DATA(type,name)extern type name
1336 #endif
1338 #define ___EXP_FUNC(type,name)type name
1339 #define ___EXP_DATA(type,name)type name
1340 #define ___IMP_FUNC(type,name)extern type name
1341 #define ___IMP_DATA(type,name)extern type name
1343 #ifdef ___SHARED
1344 #ifdef ___LIBRARY
1345 #undef ___EXP_FUNC
1346 #define ___EXP_FUNC(type,name)___EXPORT_FUNC(type,name)
1347 #undef ___EXP_DATA
1348 #define ___EXP_DATA(type,name)___EXPORT_DATA(type,name)
1349 #endif
1350 #ifndef ___PRIMAL
1351 #undef ___IMP_FUNC
1352 #define ___IMP_FUNC(type,name)___IMPORT_FUNC(type,name)
1353 #undef ___IMP_DATA
1354 #define ___IMP_DATA(type,name)___IMPORT_DATA(type,name)
1355 #endif
1356 #endif
1358 #ifndef ___OS_WIN32
1359 #define ___CAN_IMPORT_EXPORTED
1360 #endif
1362 #ifndef ___CAN_IMPORT_EXPORTED
1363 #ifdef ___SHARED
1364 #ifndef ___PRIMAL
1365 #undef ___BIND_LATE
1366 #define ___BIND_LATE
1367 #endif
1368 #endif
1369 #endif
1371 /*---------------------------------------------------------------------------*/
1373 #ifdef __GNUC__
1374 #if __GNUC__ >= 3
1375 #define ___USE_builtin_expect
1376 #endif
1377 #endif
1379 #ifdef ___USE_builtin_expect
1380 #define ___EXPECT_TRUE(x) __builtin_expect((x),1)
1381 #define ___EXPECT_FALSE(x) __builtin_expect((x),0)
1382 #else
1383 #define ___EXPECT_TRUE(x) (x)
1384 #define ___EXPECT_FALSE(x) (x)
1385 #endif
1387 /*---------------------------------------------------------------------------*/
1390 * IMPORTANT NOTE
1392 * As a general principle, the macros are written in such a way that all
1393 * macros which expand into C expressions yield PRIMARY C expressions.
1394 * Also, macros assume that arguments are PRIMARY expressions. A PRIMARY
1395 * expression is either:
1397 * an identifier, or
1398 * a non-negative constant, or
1399 * a parenthesized expression.
1401 * This convention avoids many operator priority problems and helps keep
1402 * the number of parentheses down. On the other hand, it is easy to
1403 * introduce errors when modifying these macros so be careful.
1406 /*---------------------------------------------------------------------------*/
1409 * The "___CAST" macro is useful to easily locate type casts in the
1410 * source code. Unfortunately there are still places in the sources
1411 * that don't use this macro.
1414 #define ___CAST(type,val)((type)(val))
1417 * Macros to access ___S64 and ___U64 data types. Note that ___S64
1418 * and ___U64 are either defined as a macro or as a typedef.
1421 #define ___FETCH_S64(base,i)*(___CAST(___S64*,base)+(i))
1422 #define ___STORE_S64(base,i,val)*(___CAST(___S64*,base)+(i)) = (val)
1423 #define ___FETCH_U64(base,i)*(___CAST(___U64*,base)+(i))
1424 #define ___STORE_U64(base,i,val)*(___CAST(___U64*,base)+(i)) = (val)
1425 #define ___CAST_S64(x)___CAST(___S64,x)
1426 #define ___CAST_U64(x)___CAST(___U64,x)
1429 * Macros to access ___S32 and ___U32 data types.
1432 #ifdef ___S32
1434 #define ___FETCH_S32(base,i)*(___CAST(___S32*,base)+(i))
1435 #define ___STORE_S32(base,i,val)*(___CAST(___S32*,base)+(i)) = (val)
1436 #define ___FETCH_U32(base,i)*(___CAST(___U32*,base)+(i))
1437 #define ___STORE_U32(base,i,val)*(___CAST(___U32*,base)+(i)) = (val)
1438 #define ___CAST_S32(x)___CAST(___S32,x)
1439 #define ___CAST_U32(x)___CAST(___U32,x)
1441 #else
1443 #define ___FETCH_S32(base,i)___CAST_S32(___FETCH_U32(base,i))
1444 #define ___STORE_S32(base,i,val)___STORE_U32(base,i,___CAST_U32(val))
1446 #ifdef ___BIG_ENDIAN
1447 #define ___FETCH_U32(base,i)(((i)&1) \
1448 ? (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff) \
1449 : ((*(___CAST(___U64*,base)+((i)>>1)))>>32))
1450 #define ___STORE_U32(base,i,val)*(___CAST(___U64*,base)+((i)>>1)) = ((i)&1) \
1451 ? (*(___CAST(___U64*,base)+((i)>>1))&___CAST_U64(0xffffffff<<32))|(val) \
1452 : (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff)|___CAST_U64((val)<<32)
1453 #else
1454 #define ___FETCH_U32(base,i)(((i)&1) \
1455 ? ((*(___CAST(___U64*,base)+((i)>>1)))>>32) \
1456 : (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff))
1457 #define ___STORE_U32(base,i,val)*(___CAST(___U64*,base)+((i)>>1)) = ((i)&1) \
1458 ? (*(___CAST(___U64*,base)+((i)>>1))&0xffffffff)|___CAST_U64((val)<<32) \
1459 : (*(___CAST(___U64*,base)+((i)>>1))&___CAST_U64(0xffffffff<<32))|(val)
1460 #endif
1462 #define ___CAST_S32(x)(___CAST_S64((x)<<32)>>32)
1463 #define ___CAST_U32(x)___CAST_U64((x)&0xffffffff)
1465 #endif
1468 * Macros to access ___S16 and ___U16 data types.
1471 #ifdef ___S16
1473 #define ___FETCH_S16(base,i)*(___CAST(___S16*,base)+(i))
1474 #define ___STORE_S16(base,i,val)*(___CAST(___S16*,base)+(i)) = (val)
1475 #define ___FETCH_U16(base,i)*(___CAST(___U16*,base)+(i))
1476 #define ___STORE_U16(base,i,val)*(___CAST(___U16*,base)+(i)) = (val)
1477 #define ___CAST_S16(x)___CAST(___S16,x)
1478 #define ___CAST_U16(x)___CAST(___U16,x)
1480 #else
1482 #define ___FETCH_S16(base,i)___CAST_S16(___FETCH_U16(base,i))
1483 #define ___STORE_S16(base,i,val)___STORE_U16(base,i,___CAST_U16(val))
1485 #ifdef ___S32
1487 #ifdef ___BIG_ENDIAN
1488 #define ___FETCH_U16(base,i)(((i)&1) \
1489 ? (*(___CAST(___U32*,base)+((i)>>1))&0xffff) \
1490 : ((*(___CAST(___U32*,base)+((i)>>1)))>>16))
1491 #define ___STORE_U16(base,i,val)*(___CAST(___U32*,base)+((i)>>1)) = ((i)&1) \
1492 ? (*(___CAST(___U32*,base)+((i)>>1))&___CAST_U32(0xffff<<16))|(val) \
1493 : (*(___CAST(___U32*,base)+((i)>>1))&0xffff)|___CAST_U32((val)<<16)
1494 #else
1495 #define ___FETCH_U16(base,i)(((i)&1) \
1496 ? ((*(___CAST(___U32*,base)+((i)>>1)))>>16) \
1497 : (*(___CAST(___U32*,base)+((i)>>1))&0xffff))
1498 #define ___STORE_U16(base,i,val)*(___CAST(___U32*,base)+((i)>>1)) = ((i)&1) \
1499 ? (*(___CAST(___U32*,base)+((i)>>1))&0xffff)|___CAST_U32((val)<<16) \
1500 : (*(___CAST(___U32*,base)+((i)>>1))&(0xffff<<16))|(___U32)(val)
1501 #endif
1503 #define ___CAST_S16(x)(___CAST_S32((x)<<16)>>16)
1504 #define ___CAST_U16(x)___CAST_U32((x)&0xffff)
1506 #else
1508 #ifdef ___BIG_ENDIAN
1509 #define ___FETCH_S16(base,i)(((i)&1) \
1510 ? ((*(___CAST(___S64*,base)+((i)>>1)))>>16) \
1511 : ((*(___CAST(___S64*,base)+((i)>>1))<<16)>>16))
1512 #define ___FETCH_U16(base,i) \
1513 ((*(___CAST(___U64*,base)+((i)>>2))>>((~(i)&3)<<4))&0xffff)
1514 #define ___STORE_U16(base,i,val)*(___CAST(___U64*,base)+((i)>>2)) = \
1515 (*(___CAST(___U64*,base)+((i)>>2))&~___CAST_U64(0xffff<<((~(i)&3)<<4))) | \
1516 ___CAST_U64((val)<<((~(i)&3)<<4))
1517 #else
1518 #define ___FETCH_U16(base,i) \
1519 ((*(___CAST(___U64*,base)+((i)>>2))>>(((i)&3)<<4))&0xffff)
1520 #define ___STORE_U16(base,i,val)*(___CAST(___U64*,base)+((i)>>2)) = \
1521 (*(___CAST(___U64*,base)+((i)>>2))&~___CAST_U64(0xffff<<(((i)&3)<<4))) | \
1522 ___CAST_U64((val)<<(((i)&3)<<4))
1523 #endif
1525 #define ___CAST_S16(x)(___CAST_S64((x)<<48)>>48)
1526 #define ___CAST_U16(x)___CAST_U64((x)&0xffff)
1528 #endif
1530 #endif
1533 * Macros to access ___S8 and ___U8 data types.
1536 #ifdef ___S8
1538 #define ___FETCH_S8(base,i)*(___CAST(___S8*,base)+(i))
1539 #define ___FETCH_U8(base,i)*(___CAST(___U8*,base)+(i))
1540 #define ___STORE_S8(base,i,val)*(___CAST(___S8*,base)+(i)) = (val)
1541 #define ___STORE_U8(base,i,val)*(___CAST(___U8*,base)+(i)) = (val)
1542 #define ___CAST_S8(x)(___S8)(x)
1543 #define ___CAST_U8(x)(___U8)(x)
1545 #else
1547 #define ___FETCH_S8(base,i)___CAST_S8(___FETCH_U8(base,i))
1548 #define ___STORE_S8(base,i,val)___STORE_U8(base,i,___CAST_U8(val))
1550 #ifdef ___S32
1552 #ifdef ___BIG_ENDIAN
1553 #define ___FETCH_U8(base,i) \
1554 ((*(___CAST(___U32*,base)+((i)>>2))>>((~(i)&3)<<3))&0xff)
1555 #define ___STORE_U8(base,i,val)*(___CAST(___U32*,base)+((i)>>2)) = \
1556 (*(___CAST(___U32*,base)+((i)>>2))&~___CAST_U32(0xff<<((~(i)&3)<<3))) | \
1557 ___CAST_U32((val)<<((~(i)&3)<<3))
1558 #else
1559 #define ___FETCH_U8(base,i) \
1560 ((*(___CAST(___U32*,base)+((i)>>2))>>(((i)&3)<<3))&0xff)
1561 #define ___STORE_U8(base,i,val)*(___CAST(___U32*,base)+((i)>>2)) = \
1562 (*(___CAST(___U32*,base)+((i)>>2))&~___CAST_U32(0xff<<(((i)&3)<<3))) | \
1563 ___CAST_U32((val)<<(((i)&3)<<3))
1564 #endif
1566 #define ___CAST_S8(x)(___CAST_S32((x)<<24)>>24)
1567 #define ___CAST_U8(x)___CAST_U32((x)&0xff)
1569 #else
1571 #ifdef ___BIG_ENDIAN
1572 #define ___FETCH_U8(base,i) \
1573 ((*(___CAST(___U64*,base)+((i)>>3))>>((~(i)&7)<<3))&0xff)
1574 #define ___STORE_U8(base,i,val)*(___CAST(___U64*,base)+((i)>>3)) = \
1575 (*(___CAST(___U64*,base)+((i)>>3))&~___CAST_U64(0xff<<((~(i)&7)<<3))) | \
1576 ___CAST_U64((val)<<((~(i)&7)<<3))
1577 #else
1578 #define ___FETCH_U8(base,i) \
1579 ((*(___CAST(___U64*,base)+((i)>>3))>>(((i)&7)<<3))&0xff)
1580 #define ___STORE_U8(base,i,val)*(___CAST(___U64*,base)+((i)>>3)) = \
1581 (*(___CAST(___U64*,base)+((i)>>3))&~___CAST_U64(0xff<<(((i)&7)<<3))) | \
1582 ___CAST_U64((val)<<(((i)&7)<<3))
1583 #endif
1585 #define ___CAST_S8(x)(___CAST_S64((x)<<56)>>56)
1586 #define ___CAST_U8(x)___CAST_U64((x)&0xff)
1588 #endif
1590 #endif
1592 /*---------------------------------------------------------------------------*/
1595 * GENERAL DEFINITIONS
1597 * ___WORD an integer type able to contain a pointer with no loss
1598 * ___WORD_WIDTH is equal to the number of bits in the type ___WORD
1599 * ___LOG_WORD_WIDTH is equal to the base 2 logarithm of ___WORD_WIDTH
1600 * ___WS is equal to sizeof (___WORD)
1601 * ___LWS is equal to the base 2 logarithm of ___WS
1602 * ___FLONUM_SIZE is equal to sizeof (___F64) / ___WS
1605 #ifdef ___USE_32_BIT_ADDR
1606 #define ___WORD ___S32
1607 #define ___WORD_WIDTH 32
1608 #define ___LOG_WORD_WIDTH 5
1609 #define ___WS 4
1610 #define ___LWS 2
1611 #define ___FLONUM_SIZE 2
1612 #else
1613 #define ___WORD ___S64
1614 #define ___WORD_WIDTH 64
1615 #define ___LOG_WORD_WIDTH 6
1616 #define ___WS 8
1617 #define ___LWS 3
1618 #define ___FLONUM_SIZE 1
1619 #endif
1621 #define ___SCMOBJ ___WORD
1622 #define ___SCMOBJ_WIDTH ___WORD_WIDTH
1624 #define ___ISO_8859_1 ___UM8
1625 #define ___UTF_8 char
1626 #define ___UTF_16 ___UM16
1627 #define ___UCS_2 ___UM16
1628 #define ___UCS_4 ___UM32
1629 #define ___ISO_8859_1STRING ___ISO_8859_1*
1630 #define ___UTF_8STRING ___UTF_8*
1631 #define ___UTF_16STRING ___UTF_16*
1632 #define ___UCS_2STRING ___UCS_2*
1633 #define ___UCS_4STRING ___UCS_4*
1634 #define ___WCHARSTRING ___WCHAR*
1636 #if ___MAX_CHR <= 0xff
1637 #define ___CS 1
1638 #else
1639 #if ___MAX_CHR <= 0xffff
1640 #define ___CS 2
1641 #else
1642 #define ___CS 4
1643 #endif
1644 #endif
1646 #if ___CS == 1
1647 #define ___CS_SELECT(cs1,cs2,cs4)cs1
1648 #else
1649 #if ___CS == 2
1650 #define ___CS_SELECT(cs1,cs2,cs4)cs2
1651 #else
1652 #define ___CS_SELECT(cs1,cs2,cs4)cs4
1653 #endif
1654 #endif
1656 #define ___LCS ___CS_SELECT(0,1,2)
1658 #define ___C ___CS_SELECT(___U8,___U16,___U32)
1660 #if ___WORD_WIDTH == ___VOIDSTAR_WIDTH
1661 #define ___FAKEWORD ___WORD*
1662 #define ___CAST_FAKEWORD_TO_WORD(x)___CAST(___WORD,x)
1663 #define ___CAST_WORDSTAR_TO_FAKEWORD(x)x
1664 #define ___FAKEHOST ___host
1665 #define ___CAST_HOST_TO_FAKEHOST(x)x
1666 #define ___CAST_FAKEHOST_TO_HOST(x)x
1667 #define ___FAKEVOIDSTAR void*
1668 #define ___CAST_VOIDSTAR_TO_FAKEVOIDSTAR(x)___CAST(___FAKEVOIDSTAR,x)
1669 #define ___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(x)___CAST(void*,x)
1670 #else
1671 #define ___FAKEWORD ___WORD
1672 #define ___CAST_FAKEWORD_TO_WORD(x)x
1673 #define ___CAST_WORDSTAR_TO_FAKEWORD(x)___CAST(___WORD,x)
1674 #define ___FAKEHOST ___WORD
1675 #define ___CAST_HOST_TO_FAKEHOST(x)___CAST(___WORD,x)
1676 #define ___CAST_FAKEHOST_TO_HOST(x)___CAST(___host,x)
1677 #define ___FAKEVOIDSTAR ___WORD
1678 #define ___CAST_VOIDSTAR_TO_FAKEVOIDSTAR(x)___CAST(___WORD,x)
1679 #define ___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(x)___CAST(void*,x)
1680 #endif
1682 /* Padding at end of objects so that they can be aligned to an address */
1683 /* multiple of 4 or 8 by moving them up in memory. */
1685 #ifdef ___USE_32_BIT_ADDR
1686 #define ___PADDING ,0
1687 #define ___PADDING_SIZE 1
1688 #define ___PADDING_LBL ,{0,0,0,0}
1689 #define ___PADDING_64 ,0,0
1690 #else
1691 #define ___PADDING
1692 #define ___PADDING_SIZE 0
1693 #define ___PADDING_LBL
1694 #define ___PADDING_64
1695 #endif
1697 /* Utility macro to select code for SINGLE/MULTIPLE host. */
1699 #ifdef ___SINGLE_HOST
1700 #define ___SM(s,m)s
1701 #else
1702 #define ___SM(s,m)m
1703 #endif
1705 /*---------------------------------------------------------------------------*/
1707 /* OBJECT REPRESENTATION */
1710 * For a complete description of the object representation, read the
1711 * file "lib/mem.c". These definitions must agree with those in the
1712 * files "lib/_gambit#.scm" and "gsc/_t-c-3.scm".
1716 * Type tag assignment.
1718 * Type tags are located in the lower 2 bits of a ___SCMOBJ.
1720 * ___TB = number of tag bits
1721 * ___tFIXNUM = tag for fixnums (small integers), must be 0
1722 * ___tSPECIAL = tag for other immediates (#f, #t, (), #!eof, chars, ...)
1723 * ___tPAIR = tag for pairs
1724 * ___tSUBTYPED = tag for other memory allocated objects
1727 #define ___TB 2
1728 #define ___tFIXNUM 0
1729 #define ___tSPECIAL 2
1730 #define ___tPAIR 3
1731 #define ___tSUBTYPED 1
1733 #define ___MEM_ALLOCATED(obj)((obj)&1)
1734 #define ___MEM_ALLOCATED_CLEAR(obj)((obj)&~___CAST(___WORD,1))
1735 #define ___MEM_ALLOCATED_SET(obj)((obj)|1)
1738 * Subtype tag assignment.
1740 * These tags are stored in the head of memory allocated objects
1741 * (including pairs).
1743 * ___SB = number of subtype tag bits
1744 * ___sVECTOR = tag for vectors
1745 * ___sPAIR = tag for pairs
1746 * ___sRATNUM = tag for ratnums
1747 * ___sCPXNUM = tag for cpxnums
1748 * ___sSTRUCTURE = tag for structures
1749 * ___sBOXVALUES = tag for box and multiple-values objects
1750 * ___sMEROON = tag for Meroon objects
1751 * ___sJAZZ = tag for Jazz objects
1752 * ___sSYMBOL = tag for symbols
1753 * ___sKEYWORD = tag for keywords
1754 * ___sFRAME = tag for continuation frames
1755 * ___sCONTINUATION = tag for continuations
1756 * ___sPROMISE = tag for promises
1757 * ___sWEAK = tag for weak objects (wills and GC hash tables)
1758 * ___sPROCEDURE = tag for procedures
1759 * ___sRETURN = tag for returns
1760 * ___sFOREIGN = tag for foreign data
1761 * ___sSTRING = tag for strings
1762 * ___sS8VECTOR = tag for 8-bit signed integer vectors
1763 * ___sU8VECTOR = tag for 8-bit unsigned integer vectors
1764 * ___sS16VECTOR = tag for 16-bit signed integer vectors
1765 * ___sU16VECTOR = tag for 16-bit unsigned integer vectors
1766 * ___sS32VECTOR = tag for 32-bit signed integer vectors
1767 * ___sU32VECTOR = tag for 32-bit unsigned integer vectors
1768 * ___sF32VECTOR = tag for 32-bit floating point number vectors
1769 * ___sS64VECTOR = tag for 64-bit signed integer vectors
1770 * ___sU64VECTOR = tag for 64-bit unsigned integer vectors
1771 * ___sF64VECTOR = tag for 64-bit floating point number vectors
1772 * ___sFLONUM = tag for flonums
1773 * ___sBIGNUM = tag for bignums
1775 * The five subtype tags ___sS64VECTOR, ___sU64VECTOR, ___sF64VECTOR,
1776 * ___sFLONUM, ___sBIGNUM must come last. These object types (and
1777 * ___sFOREIGN which is always allocated as a ___STILL object) must
1778 * be aligned on a multiple of 8.
1781 #define ___SB 5
1782 #define ___sVECTOR 0
1783 #define ___sPAIR 1
1784 #define ___sRATNUM 2
1785 #define ___sCPXNUM 3
1786 #define ___sSTRUCTURE 4
1787 #define ___sBOXVALUES 5
1788 #define ___sMEROON 6
1789 #define ___sJAZZ 7
1790 #define ___sSYMBOL 8
1791 #define ___sKEYWORD 9
1792 #define ___sFRAME 10
1793 #define ___sCONTINUATION 11
1794 #define ___sPROMISE 12
1795 #define ___sWEAK 13
1796 #define ___sPROCEDURE 14
1797 #define ___sRETURN 15
1798 #define ___sFOREIGN 18
1799 #define ___sSTRING 19
1800 #define ___sS8VECTOR 20
1801 #define ___sU8VECTOR 21
1802 #define ___sS16VECTOR 22
1803 #define ___sU16VECTOR 23
1804 #define ___sS32VECTOR 24
1805 #define ___sU32VECTOR 25
1806 #define ___sF32VECTOR 26
1807 #define ___sS64VECTOR 27
1808 #define ___sU64VECTOR 28
1809 #define ___sF64VECTOR 29
1810 #define ___sFLONUM 30
1811 #define ___sBIGNUM 31
1814 * Head type tag assignment.
1816 * Head type tags are stored in the lower 3 bits of the head of memory
1817 * allocated objects.
1819 * ___HTB = number of head tag bits
1820 * ___MOVABLE0 = tag for movable objects in generation 0
1821 * ___MOVABLE1 = tag for movable objects in generation 1
1822 * ___MOVABLE2 = tag for movable objects in generation 2
1823 * ___FORW = tag for movable objects that have been forwarded
1824 * ___STILL = tag for still objects
1825 * ___PERM = tag for permanent objects
1827 * note: the tag ___FORW+(1<<___TB) is also used for forwarding pointers
1830 #define ___HTB 3
1831 #define ___MOVABLE0 0
1832 #define ___MOVABLE1 1
1833 #define ___MOVABLE2 2
1834 #define ___FORW 3
1835 #define ___STILL 5
1836 #define ___PERM 6
1839 * Miscellaneous masks.
1842 #define ___LF (___HTB+___SB)
1844 #define ___TMASK ((1<<___TB)-1)
1845 #define ___HTMASK ((1<<___HTB)-1)
1846 #define ___SMASK (((1<<___SB)-1)<<___HTB)
1847 #define ___LMASK (~___CAST(unsigned ___WORD,0)<<___LF)
1848 #define ___LSMASK (~___CAST(unsigned ___WORD,0)<<___HTB)
1851 * Value constructors for object references inside executable code.
1854 #define ___FAL ((___CAST(___WORD,-1)<<___TB)+___tSPECIAL)
1855 #define ___TRU ((___CAST(___WORD,-2)<<___TB)+___tSPECIAL)
1856 #define ___NUL ((___CAST(___WORD,-3)<<___TB)+___tSPECIAL)
1857 #define ___EOF ((___CAST(___WORD,-4)<<___TB)+___tSPECIAL)
1858 #define ___VOID ((___CAST(___WORD,-5)<<___TB)+___tSPECIAL)
1859 #define ___ABSENT ((___CAST(___WORD,-6)<<___TB)+___tSPECIAL)
1860 #define ___UNB1 ((___CAST(___WORD,-7)<<___TB)+___tSPECIAL)
1861 #define ___UNB2 ((___CAST(___WORD,-8)<<___TB)+___tSPECIAL)
1862 #define ___OPTIONAL ((___CAST(___WORD,-9)<<___TB)+___tSPECIAL)
1863 #define ___KEY_OBJ ((___CAST(___WORD,-10)<<___TB)+___tSPECIAL)
1864 #define ___REST ((___CAST(___WORD,-11)<<___TB)+___tSPECIAL)
1865 #define ___UNUSED ((___CAST(___WORD,-14)<<___TB)+___tSPECIAL)
1866 #define ___DELETED ((___CAST(___WORD,-15)<<___TB)+___tSPECIAL)
1867 #define ___FIX(x)(___CAST(___WORD,x)<<___TB)
1868 #if ___SCMOBJ_WIDTH == 32
1869 #define ___BIGFIX(i,x)___SUB(i)
1870 #else
1871 #define ___BIGFIX(i,x)___FIX(x)
1872 #endif
1873 #define ___CHR(x)((___CAST(___WORD,___CS_SELECT(___CAST_U8(x),___CAST_U16(x),___CAST_U32(x)))<<___TB)+___tSPECIAL)
1875 #define ___SYM(i,id)___CAST_FAKEWORD_TO_WORD(___sym_tbl[i])
1876 #define ___KEY(i,id)___CAST_FAKEWORD_TO_WORD(___key_tbl[i])
1877 #define ___CNS(i)___TAG((___ALIGNUP(___cns_tbl,___WS)+i*(___PAIR_SIZE+1)),___tPAIR)
1878 #define ___SUB(i)___CAST_FAKEWORD_TO_WORD(___sub_tbl[i])
1881 * Value constructors for object references inside constant
1882 * memory allocated objects.
1885 #define ___REF_FAL ___FAL
1886 #define ___REF_TRU ___TRU
1887 #define ___REF_NUL ___NUL
1888 #define ___REF_EOF ___EOF
1889 #define ___REF_VOID ___VOID
1890 #define ___REF_ABSENT ___ABSENT
1891 #define ___REF_UNB1 ___UNB1
1892 #define ___REF_UNB2 ___UNB2
1893 #define ___REF_OPTIONAL ___OPTIONAL
1894 #define ___REF_KEY_OBJ ___KEY_OBJ
1895 #define ___REF_REST ___REST
1896 #define ___REF_UNUSED ___UNUSED
1897 #define ___REF_DELETED ___DELETED
1898 #define ___REF_FIX(x)___FIX(x)
1899 #if ___SCMOBJ_WIDTH == 32
1900 #define ___REF_BIGFIX(i,x)___REF_SUB(i)
1901 #else
1902 #define ___REF_BIGFIX(i,x)___REF_FIX(x)
1903 #endif
1904 #define ___REF_CHR(x)___CHR(x)
1906 #define ___REF_SYM(i,id)((___CAST(___WORD,-1-i)<<___TB)+___tPAIR)
1907 #define ___REF_KEY(i,id)((___CAST(___WORD,-1-i)<<___TB)+___tSUBTYPED)
1908 #define ___REF_CNS(i)((___CAST(___WORD,i)<<___TB)+___tPAIR)
1909 #define ___REF_SUB(i)((___CAST(___WORD,i)<<___TB)+___tSUBTYPED)
1911 /*---------------------------------------------------------------------------*/
1913 /* Miscellaneous macros */
1915 #define ___IF(x) if (x) {
1916 #define ___END_IF }
1918 #define ___NOTHING
1920 #define ___NBELEMS(table) (sizeof (table) / sizeof ((table)[0]))
1922 #define ___INT(x)((x)>>___TB)
1924 #define ___FIX_WIDTH (___SCMOBJ_WIDTH-___TB)
1925 #define ___MIN_FIX (-(___CAST(___WORD,1)<<(___FIX_WIDTH-1)))
1926 #define ___MAX_FIX ((___CAST(___WORD,1)<<(___FIX_WIDTH-1))-1)
1928 #define ___MAX_FIX32 ((___CAST(___WORD,1)<<(32-___TB-1))-1)
1931 * Module prefix and C id prefix must match the definitions
1932 * in the file "gsc/_parms.scm".
1935 #define ___MODULE_PREFIX " "
1936 #define ___C_ID_PREFIX "___"
1938 /*---------------------------------------------------------------------------*/
1940 #define ___ALIGNUP(x,mult) \
1941 ___CAST(___WORD*,(___CAST(___WORD,x)+((mult)-1))&~((mult)-1))
1943 #define ___ALLOC(n) ___hp += (n)
1945 #if ___SCMOBJ_WIDTH == 32
1947 #define ___ALLOC_ALIGN64(n) \
1948 ___hp = ___CAST(___WORD*, (___CAST(___WORD,___hp) + (((n)<<___LWS) + 7)) & ~7)
1950 #else
1952 #define ___ALLOC_ALIGN64(n) ___ALLOC(n)
1954 #endif
1956 /* Type tests */
1958 #define ___TAG(ptr,tag)(___CAST(___WORD,ptr)+(tag))
1959 #define ___UNTAG(obj)___CAST(___WORD*,(obj)&-(1<<___TB))
1960 #define ___UNTAG_AS(obj,tag)___CAST(___WORD*,(obj)-(tag))
1962 #define ___TYP(x)((x)&___TMASK)
1963 #define ___TESTTYPE(x,typ)(___TYP(x)==(typ))
1965 #define ___TESTHEADERTAG(x,s)(((x)&___SMASK)==((s)<<___HTB))
1966 #define ___TESTSUBTYPETAG(x,s)___TESTHEADERTAG(___HEADER(x),s)
1967 #define ___TESTSUBTYPE(x,s)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTSUBTYPETAG(___temp,(s)))
1968 #define ___TESTLENGTHSUBTYPETAG(x,bytes,s)((___HEADER(x)&___LSMASK)==___MAKE_HD(bytes,s,0))
1969 #define ___TESTLENGTHSUBTYPE(x,bytes,s)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTLENGTHSUBTYPETAG(___temp,bytes,s))
1970 #define ___HEADER(x)(*___UNTAG_AS(x,___tSUBTYPED))
1972 #define ___BODY_OFS 1
1974 #ifdef ___USE_HANDLES
1975 #define ___PAIR_OVERHEAD 2
1976 #define ___SUBTYPED_OVERHEAD 2
1977 #define ___BODY(obj)___CAST(___WORD*,*(___UNTAG(obj)+___BODY_OFS)+___BODY_OFS)
1978 #define ___BODY_AS(obj,tag)___CAST(___WORD*,*(___UNTAG_AS(obj,tag)+___BODY_OFS)+___BODY_OFS)
1979 #else
1980 #define ___PAIR_OVERHEAD 1
1981 #define ___SUBTYPED_OVERHEAD 1
1982 #define ___BODY(obj)(___UNTAG(obj)+___BODY_OFS)
1983 #define ___BODY_AS(obj,tag)(___UNTAG_AS(obj,tag)+___BODY_OFS)
1984 #endif
1986 #define ___MAKE_HD(bytes,subtype,tag)(((bytes)<<___LF)+((subtype)<<___HTB)+(tag))
1987 #define ___HD_TYP(head)((head)&___HTMASK)
1988 #define ___HD_BYTES(head)(___CAST(unsigned ___WORD,head)>>___LF)
1989 #define ___HD_WORDS(head)(((___CAST(unsigned ___WORD,head)+((___WS-1)<<___LF)))>>(___LF+___LWS))
1990 #define ___HD_FIELDS(head)(___CAST(unsigned ___WORD,head)>>(___LF+___LWS))
1991 #define ___HD_SUBTYPE(head)((head)>>___HTB&((1<<___SB)-1))
1993 #define ___FIELD(obj,i)(*(___BODY_AS(obj,___tSUBTYPED)+i))
1995 #define ___WORDS(bytes)(((bytes)+___WS-1)>>___LWS)
1997 #define ___MAKE_HD_BYTES(bytes,subtype)___MAKE_HD(bytes,subtype,___MOVABLE0)
1998 #define ___MAKE_HD_WORDS(words,subtype)___MAKE_HD(((words)<<___LWS),subtype,___MOVABLE0)
2000 #define ___SYMBOL_SIZE 4
2001 #define ___KEYWORD_SIZE 3
2002 #define ___WILL_SIZE 3
2003 #define ___TABLE_SIZE 5
2004 #define ___PROMISE_SIZE 2
2005 #define ___RATNUM_SIZE 2
2006 #define ___CPXNUM_SIZE 2
2007 #define ___CONTINUATION_SIZE 2
2008 #define ___THREAD_SIZE 26
2009 #define ___BOX_SIZE 1
2010 #define ___FOREIGN_SIZE 3
2011 #define ___FOREIGN_TAGS 0
2012 #define ___FOREIGN_RELEASE_FN 1
2013 #define ___FOREIGN_PTR 2
2015 /* Flonum boxing and unboxing */
2017 #define ___FLONUM_VAL(obj) *___CAST(___F64*,___BODY_AS(obj,___tSUBTYPED))
2019 #define ___F64UNBOX(x) ___FLONUM_VAL(x)
2021 #define ___F64BOX(x) \
2022 (___ALLOC_ALIGN64(1+___FLONUM_SIZE), \
2023 ___hp[-(1+___FLONUM_SIZE)] = ___MAKE_HD_WORDS(___FLONUM_SIZE,___sFLONUM), \
2024 *___CAST(___F64*,___hp-___FLONUM_SIZE) = (x), \
2025 ___TAG((___hp-(1+___FLONUM_SIZE)),___tSUBTYPED))
2027 #define ___D_F64(x)___F64 x;
2028 #define ___SET_F64(x,y)x=y;
2030 /* Bignum representation */
2032 #define ___BIG_FBASE_WIDTH 8
2034 #if ___SCMOBJ_WIDTH == 32
2035 #define ___BIG_MBASE_WIDTH 16
2036 #else
2037 #define ___BIG_MBASE_WIDTH 32
2038 #endif
2040 #ifndef ___BUILTIN_64BIT_INT_TYPE
2041 #define ___BIG_ABASE_WIDTH 32
2042 #else
2043 #define ___BIG_ABASE_WIDTH 64
2044 #endif
2046 #if ___BIG_ABASE_WIDTH == 32
2048 #define ___BIGAFETCH(base,i) ___FETCH_U32(base,i)
2049 #define ___BIGAFETCHSIGNED(base,i) ___FETCH_S32(base,i)
2050 #define ___BIGASTORE(base,i,val) ___STORE_U32(base,i,val)
2051 #define ___BIGASTORESIGNED(base,i,val) ___STORE_S32(base,i,val)
2052 #define ___BIGALENGTH(vect) ___U32VECTORLENGTH(vect)
2053 #define ___BIGADIGIT ___U32
2054 #define ___BIGADIGITSIGNED ___S32
2055 #define ___BIGASHRINK(x,y) ___U32VECTORSHRINK(x,y)
2056 #define ___BIGATEMP ___u32_temp
2058 #else
2060 #define ___BIGAFETCH(base,i) ___FETCH_U64(base,i)
2061 #define ___BIGAFETCHSIGNED(base,i) ___FETCH_S64(base,i)
2062 #define ___BIGASTORE(base,i,val) ___STORE_U64(base,i,val)
2063 #define ___BIGASTORESIGNED(base,i,val) ___STORE_S64(base,i,val)
2064 #define ___BIGALENGTH(vect) ___U64VECTORLENGTH(vect)
2065 #define ___BIGADIGIT ___U64
2066 #define ___BIGADIGITSIGNED ___S64
2067 #define ___BIGASHRINK(x,y) ___U64VECTORSHRINK(x,y)
2068 #define ___BIGATEMP ___u64_temp
2070 #endif
2072 #define ___BIG_ABASE_MIN_1 (~___CAST(___BIGADIGIT,0))
2074 #if ___BIG_ABASE_WIDTH == 32
2076 #define ___S32UNBOX(x) \
2077 (___TYP((___temp=x)) == ___tFIXNUM \
2078 ? ___INT(___temp) \
2079 : ___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0))
2081 #define ___U32UNBOX(x) \
2082 (___TYP((___temp=x)) == ___tFIXNUM \
2083 ? ___CAST_U32(___INT(___temp)) \
2084 : ___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))
2086 #define ___S64UNBOX(x) \
2087 (___TYP((___temp=x)) == ___tFIXNUM \
2088 ? ___S64_from_SM32(___INT(___temp)) \
2089 : (___HD_BYTES(___HEADER(___temp)) == (1<<2) \
2090 ? ___S64_from_SM32(___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0)) \
2091 : ___S64_from_SM32_UM32(___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),1),___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2093 #define ___U64UNBOX(x) \
2094 (___TYP((___temp=x)) == ___tFIXNUM \
2095 ? ___U64_from_UM32(___CAST_U32(___INT(___temp))) \
2096 : (___HD_BYTES(___HEADER(___temp)) == (1<<2) \
2097 ? ___U64_from_UM32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0)) \
2098 : ___U64_from_UM32_UM32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),1),___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2100 #if ___SCMOBJ_WIDTH == 32
2102 #define ___S32BOX(x) \
2103 (___s32_temp=(x), \
2104 (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2105 ? ___FIX(___s32_temp) \
2106 : (___ALLOC(1+___WORDS(1<<2)), \
2107 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2108 ___BIGASTORESIGNED(___hp,-1,___s32_temp), \
2109 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))))
2111 #define ___U32BOX(x) \
2112 (___u32_temp=(x), \
2113 (___u32_temp <= ___CAST_U32(___MAX_FIX) \
2114 ? ___FIX(___u32_temp) \
2115 : (___CAST_S32(___u32_temp) < 0 \
2116 ? (___ALLOC(1+___WORDS(2<<2)), \
2117 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2118 ___BIGASTORE(___hp,-2,___u32_temp), \
2119 ___BIGASTORE(___hp,-1,0), \
2120 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)) \
2121 : (___ALLOC(1+___WORDS(1<<2)), \
2122 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2123 ___BIGASTORE(___hp,-1,___u32_temp), \
2124 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)))))
2126 #define ___S64BOX(x) \
2127 (___s64_temp=(x), \
2128 (((___s32_temp = ___CAST_S32(___S64_lo32(___s64_temp)))>>31) \
2129 == ___S64_hi32(___s64_temp) \
2130 ? (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2131 ? ___FIX(___s32_temp) \
2132 : (___ALLOC(1+___WORDS(1<<2)), \
2133 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2134 ___BIGASTORE(___hp,-1,___s32_temp), \
2135 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))) \
2136 : (___ALLOC(1+___WORDS(2<<2)), \
2137 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2138 ___BIGASTORE(___hp,-2,___s32_temp), \
2139 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___s64_temp)), \
2140 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))))
2142 #define ___U64BOX(x) \
2143 (___u64_temp=(x), \
2144 (___CAST_S32(___U64_hi32(___u64_temp)) < 0 \
2145 ? (___ALLOC(1+___WORDS(3<<2)), \
2146 ___hp[-(1+___WORDS(3<<2))] = ___MAKE_HD_BYTES(3<<2,___sBIGNUM), \
2147 ___BIGASTORE(___hp,-3,___U64_lo32(___u64_temp)), \
2148 ___BIGASTORE(___hp,-2,___U64_hi32(___u64_temp)), \
2149 ___BIGASTORE(___hp,-1,0), \
2150 ___TAG((___hp-(1+___WORDS(3<<2))),___tSUBTYPED)) \
2151 : (((___u32_temp = ___U64_lo32(___u64_temp)) & (___CAST_U32(1)<<31)) \
2152 == ___U64_hi32(___u64_temp) \
2153 ? (___u32_temp <= ___MAX_FIX \
2154 ? ___FIX(___u32_temp) \
2155 : (___ALLOC(1+___WORDS(1<<2)), \
2156 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2157 ___BIGASTORE(___hp,-1,___u32_temp), \
2158 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))) \
2159 : (___ALLOC(1+___WORDS(2<<2)), \
2160 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2161 ___BIGASTORE(___hp,-2,___u32_temp), \
2162 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___u64_temp)), \
2163 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)))))
2165 #else
2167 #define ___S32BOX(x) ___FIX(___CAST_S64(x))
2168 #define ___U32BOX(x) ___FIX(___CAST_U64(x))
2170 #define ___S64BOX(x) \
2171 (___s64_temp=(x), \
2172 (___s64_temp >= ___MIN_FIX && ___s64_temp <= ___MAX_FIX \
2173 ? ___FIX(___s64_temp) \
2174 : ((___CAST_S32(___S64_lo32(___s64_temp))>>31) == ___S64_hi32(___s64_temp) \
2175 ? (___ALLOC(1+___WORDS(1<<2)), \
2176 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2177 ___BIGASTORE(___hp,-1,___S64_lo32(___s64_temp)), \
2178 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)) \
2179 : (___ALLOC(1+___WORDS(2<<2)), \
2180 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2181 ___BIGASTORE(___hp,-2,___S64_lo32(___s64_temp)), \
2182 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___s64_temp)), \
2183 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED)))))
2185 #define ___U64BOX(x) \
2186 (___u64_temp=(x), \
2187 (___u64_temp <= ___CAST_U64(___MAX_FIX) \
2188 ? ___FIX(___u64_temp) \
2189 : (___CAST_S64(___u64_temp) < 0 \
2190 ? (___ALLOC(1+___WORDS(3<<2)), \
2191 ___hp[-(1+___WORDS(3<<2))] = ___MAKE_HD_BYTES(3<<2,___sBIGNUM), \
2192 ___BIGASTORE(___hp,-3,___U64_lo32(___u64_temp)), \
2193 ___BIGASTORE(___hp,-2,___U64_hi32(___u64_temp)), \
2194 ___BIGASTORE(___hp,-1,0), \
2195 ___TAG((___hp-(1+___WORDS(3<<2))),___tSUBTYPED)) \
2196 : ((___U64_lo32(___u64_temp) & (___CAST_U32(1)<<31)) == ___U64_hi32(___u64_temp) \
2197 ? (___ALLOC(1+___WORDS(1<<2)), \
2198 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2199 ___BIGASTORE(___hp,-1,___S64_lo32(___u64_temp)), \
2200 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED)) \
2201 : (___ALLOC(1+___WORDS(2<<2)), \
2202 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2203 ___BIGASTORE(___hp,-2,___S64_lo32(___u64_temp)), \
2204 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___u64_temp)), \
2205 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))))))
2207 #endif
2209 #else
2211 #define ___S32UNBOX(x) \
2212 (___TYP((___temp=x)) == ___tFIXNUM \
2213 ? ___INT(___temp) \
2214 : ___CAST_S32(___U64_lo32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))))
2216 #define ___U32UNBOX(x) \
2217 (___TYP((___temp=x)) == ___tFIXNUM \
2218 ? ___CAST_U32(___INT(___temp)) \
2219 : ___U64_lo32(___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0)))
2221 #define ___S64UNBOX(x) \
2222 (___TYP((___temp=x)) == ___tFIXNUM \
2223 ? ___INT(___temp) \
2224 : ___BIGAFETCHSIGNED(___BODY_AS(___temp,___tSUBTYPED),0))
2226 #define ___U64UNBOX(x) \
2227 (___TYP((___temp=x)) == ___tFIXNUM \
2228 ? ___CAST_U64(___INT(___temp)) \
2229 : ___BIGAFETCH(___BODY_AS(___temp,___tSUBTYPED),0))
2231 #if ___SCMOBJ_WIDTH == 32
2233 #define ___S32BOX(x) \
2234 (___s32_temp=(x), \
2235 (___s32_temp >= ___MIN_FIX && ___s32_temp <= ___MAX_FIX \
2236 ? ___FIX(___s32_temp) \
2237 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2238 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2239 ___BIGASTORESIGNED(___hp,-1,___S64_from_SM32(___s32_temp)), \
2240 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2242 #define ___U32BOX(x) \
2243 (___u32_temp=(x), \
2244 (___u32_temp <= ___CAST_U32(___MAX_FIX) \
2245 ? ___FIX(___u32_temp) \
2246 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2247 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2248 ___BIGASTORE(___hp,-1,___U64_from_UM32(___u32_temp)), \
2249 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2251 #else
2253 #define ___S32BOX(x) ___FIX(___CAST_S64(x))
2254 #define ___U32BOX(x) ___FIX(___CAST_U64(x))
2256 #endif
2258 #define ___S64BOX(x) \
2259 (___s64_temp=(x), \
2260 (___s64_temp >= ___MIN_FIX && ___s64_temp <= ___MAX_FIX \
2261 ? ___FIX(___s64_temp) \
2262 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2263 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2264 ___BIGASTORESIGNED(___hp,-1,___s64_temp), \
2265 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))))
2267 #define ___U64BOX(x) \
2268 (___u64_temp=(x), \
2269 (___u64_temp <= ___CAST_U64(___MAX_FIX) \
2270 ? ___FIX(___u64_temp) \
2271 : (___CAST_S64(___u64_temp) < 0 \
2272 ? (___ALLOC_ALIGN64(1+___WORDS(2<<3)), \
2273 ___hp[-(1+___WORDS(2<<3))] = ___MAKE_HD_BYTES(2<<3,___sBIGNUM), \
2274 ___BIGASTORE(___hp,-2,___u64_temp), \
2275 ___BIGASTORE(___hp,-1,0), \
2276 ___TAG((___hp-(1+___WORDS(2<<3))),___tSUBTYPED)) \
2277 : (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2278 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2279 ___BIGASTORE(___hp,-1,___u64_temp), \
2280 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED)))))
2282 #endif
2284 #if ___BIG_ABASE_WIDTH == 32
2286 #if ___SCMOBJ_WIDTH == 32
2288 #define ___BIGFROMFIX(x) \
2289 (___ALLOC(1+___WORDS(1<<2)), \
2290 ___hp[-(1+___WORDS(1<<2))] = ___MAKE_HD_BYTES(1<<2,___sBIGNUM), \
2291 ___BIGASTORESIGNED(___hp,-1,___INT(x)), \
2292 ___TAG((___hp-(1+___WORDS(1<<2))),___tSUBTYPED))
2294 #else
2296 #define ___BIGFROMFIX(x) \
2297 (___ALLOC(1+___WORDS(2<<2)), \
2298 ___hp[-(1+___WORDS(2<<2))] = ___MAKE_HD_BYTES(2<<2,___sBIGNUM), \
2299 ___BIGASTORE(___hp,-2,___S64_lo32(___INT(x))), \
2300 ___BIGASTORESIGNED(___hp,-1,___S64_hi32(___INT(x))), \
2301 ___TAG((___hp-(1+___WORDS(2<<2))),___tSUBTYPED))
2303 #endif
2305 #else
2307 #define ___BIGFROMFIX(x) \
2308 (___ALLOC_ALIGN64(1+___WORDS(1<<3)), \
2309 ___hp[-(1+___WORDS(1<<3))] = ___MAKE_HD_BYTES(1<<3,___sBIGNUM), \
2310 ___BIGASTORESIGNED(___hp,-1,___CAST(___BIGADIGIT,___INT(x))), \
2311 ___TAG((___hp-(1+___WORDS(1<<3))),___tSUBTYPED))
2313 #endif
2315 #define ___BIGALESSP(x,y,i) \
2316 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) \
2317 < (___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(i)>>___TB)))
2319 #define ___BIGAEQP(x,y,i) \
2320 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) \
2321 == (___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(i)>>___TB)))
2323 #define ___BIGAONESP(x,i) \
2324 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) == ___BIG_ABASE_MIN_1)
2326 #define ___BIGAZEROP(x,i) \
2327 (___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) == 0)
2329 #define ___BIGANEGATIVEP(x,i) \
2330 (___BIGAFETCHSIGNED(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) < 0)
2332 #define ___BIGTOFIX(x) \
2333 (___BIGATEMP=___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),0), \
2334 (___BIGATEMP == ___CAST(___BIGADIGIT,___INT(___FIX(___BIGATEMP))) ? ___FIX(___BIGATEMP) : ___FAL))
2337 #define ___BIGACAT(x,i,hi,j,lo,k,divider) \
2338 ___BIGATEMP=((___BIGADIGIT)___BIGAFETCH(___BODY_AS(hi,___tSUBTYPED),(j)>>___TB) << ___INT(divider)) | \
2339 ((___BIGADIGIT)___BIGAFETCH(___BODY_AS(lo,___tSUBTYPED),(k)>>___TB) >> (___BIG_ABASE_WIDTH - ___INT(divider))); \
2340 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2342 #define ___BIGAAND(x,i,y,j) \
2343 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) & ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2344 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2346 #define ___BIGAIOR(x,i,y,j) \
2347 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) | ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2348 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2350 #define ___BIGAXOR(x,i,y,j) \
2351 ___BIGATEMP= ___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB) ^ ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB); \
2352 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2354 #define ___BIGANOT(x,i) \
2355 ___BIGATEMP= ~___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB); \
2356 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP);
2360 #define ___BIGNEGATIVEP(x) \
2361 (___BIGAFETCHSIGNED(___BODY_AS(x,___tSUBTYPED),___FIXSUB(___BIGALENGTH(x),___FIX_1)>>___TB) < 0)
2363 #define ___BIGACOPY(result,i,y,j) \
2364 ___BIGASTORE(___BODY_AS(result,___tSUBTYPED),(i)>>___TB, \
2365 ___BIGAFETCH(___BODY_AS(y,___tSUBTYPED),(j)>>___TB));
2367 #define ___BIGAINC(x,i) \
2368 (___BIGATEMP = (___BIGADIGIT)___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB)+(___BIGADIGIT) 1, \
2369 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP), \
2370 (___BIGATEMP == 0 ? ___FIX_1 : ___FIX_0))
2372 #define ___BIGADEC(x,i) \
2373 (___BIGATEMP = (___BIGADIGIT)___BIGAFETCH(___BODY_AS(x,___tSUBTYPED),(i)>>___TB)-(___BIGADIGIT) 1, \
2374 ___BIGASTORE(___BODY_AS(x,___tSUBTYPED),(i)>>___TB,(___BIGADIGIT)___BIGATEMP), \
2375 (___BIGATEMP == ___BIG_ABASE_MIN_1 ? ___FIX_1 : ___FIX_0))
2377 #define ___BIGAADD(result,i,y,j,carry) \
2378 (carry ? (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))+ \
2379 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j))+ \
2380 (___BIGADIGIT) 1, \
2381 ((___BIGADIGIT) ___BIGATEMP <= (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2383 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2385 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))) \
2387 (___BIGATEMP=(___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i))+ \
2388 (___BIGADIGIT)___BIGAFETCH(___BODY_AS( y,___tSUBTYPED),___INT(j)), \
2389 ((___BIGADIGIT) ___BIGATEMP < (___BIGADIGIT)___BIGAFETCH(___BODY_AS(result,___tSUBTYPED),___INT(i)) \
2391 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_1) \
2393 (___BIGASTORE(___BODY_AS(result,___tSUBTYPED),___INT(i),(___BIGADIGIT)___BIGATEMP), ___FIX_0))))
2395 #define ___BIGASUB(result,i,y,j,borrow) \
2396 (borrow ? (___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 #if ___BIG_MBASE_WIDTH == 16
2415 #ifdef ___BIG_ENDIAN
2417 #if ___BIG_ABASE_WIDTH == 64
2418 #define ___BIG_END_MFLIP(x)((x)^___FIX(3))
2419 #else
2420 #define ___BIG_END_MFLIP(x)((x)^___FIX(1))
2421 #endif
2422 #else
2423 #define ___BIG_END_MFLIP(x)(x)
2424 #endif
2426 #define ___BIGMLENGTH(v) ___U16VECTORLENGTH(v)
2427 #define ___BIGMFETCH(base,i) ___FETCH_U16(base,i)
2428 #define ___BIGMSTORE(base,i,val) ___STORE_U16(base,i,val)
2429 #define ___BIGMDIGIT ___U16
2430 #define ___BIGMDOUBLEDIGIT ___U32
2432 #else
2434 #ifdef ___BIG_ENDIAN
2435 #define ___BIG_END_MFLIP(x)((x)^___FIX(1))
2436 #else
2437 #define ___BIG_END_MFLIP(x)(x)
2438 #endif
2440 #define ___BIGMLENGTH(v) ___U32VECTORLENGTH(v)
2441 #define ___BIGMFETCH(base,i) ___FETCH_U32(base,i)
2442 #define ___BIGMSTORE(base,i,val) ___STORE_U32(base,i,val)
2443 #define ___BIGMDIGIT ___U32
2444 #define ___BIGMDOUBLEDIGIT ___U64
2446 #endif
2448 #define ___BIG_MBASE ((___BIGMDOUBLEDIGIT)1 << ___BIG_MBASE_WIDTH)
2450 #define ___BIGMREF(x,j) \
2451 ___FIX(___BIGMFETCH(___BODY_AS(x,___tSUBTYPED),___BIG_END_MFLIP(j)>>___TB))
2453 #define ___BIGMSET(result,i,carry) \
2454 ___BIGMSTORE(___BODY_AS(result,___tSUBTYPED),___BIG_END_MFLIP(i)>>___TB,___INT(carry));
2456 #define ___BIGMMUL(result,i,y,j,multiplier,carry) \
2457 (___temp=(___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(result,___tSUBTYPED),___INT(___BIG_END_MFLIP(i))) \
2458 + (___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(y,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) \
2459 * (___BIGMDOUBLEDIGIT)___INT(multiplier) \
2460 + (___BIGMDOUBLEDIGIT)___INT(carry), \
2461 ___BIGMSTORE(___BODY_AS(result,___tSUBTYPED),___INT(___BIG_END_MFLIP(i)),(___BIGMDIGIT)___temp), \
2462 ___FIX((___BIGMDOUBLEDIGIT)___temp >> ___BIG_MBASE_WIDTH))
2464 #define ___BIGMDIV(u,i,v,k,q,borrow) \
2465 (___temp = (___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(i))) \
2466 -(___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(v,___tSUBTYPED),___INT(___BIG_END_MFLIP(k))) \
2467 * (___BIGMDOUBLEDIGIT)___INT(q) \
2468 + (___BIGMDOUBLEDIGIT)___INT(borrow),\
2469 ___BIGMSTORE(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(i)),((___BIGMDIGIT) ___temp)), \
2470 ___temp >>= ___BIG_MBASE_WIDTH, \
2471 (___temp > 0 ? ___FIX(___temp - ___BIG_MBASE) : ___FIX(___temp)))
2474 #define ___BIGMQUO(u,j,v) \
2475 ___FIX((((___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) << ___BIG_MBASE_WIDTH) \
2476 +___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j-___FIX(1)))))/___INT(v))
2479 #define ___BIGMREM(u,j,v,q) \
2480 ___FIX((((___BIGMDOUBLEDIGIT)___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j))) << ___BIG_MBASE_WIDTH) \
2481 +___BIGMFETCH(___BODY_AS(u,___tSUBTYPED),___INT(___BIG_END_MFLIP(j-___FIX(1))))) \
2482 -((___BIGMDOUBLEDIGIT)___INT(v)*(___BIGMDOUBLEDIGIT)___INT(q)))
2484 #define ___BIGMTESTP(q,v,r,u) \
2485 (((___BIGMDOUBLEDIGIT)___INT(v)*___INT(q))>((___BIGMDOUBLEDIGIT)___INT(r) << ___BIG_MBASE_WIDTH) +___INT(u))
2490 #ifdef ___BIG_ENDIAN
2492 #if ___BIG_ABASE_WIDTH == 64
2493 #define ___BIG_END_FFLIP(x)((x)^___FIX(7))
2494 #else
2495 #define ___BIG_END_FFLIP(x)((x)^___FIX(3))
2496 #endif
2498 #else
2500 #define ___BIG_END_FFLIP(x)(x)
2502 #endif
2504 #define ___BIGFREF(x,j)___U8VECTORREF(x,___BIG_END_FFLIP(j))
2506 #define ___BIGFSET(result,i,carry)___U8VECTORSET(result,___BIG_END_FFLIP(i),carry)
2508 #define ___BIGFLENGTH(x)___U8VECTORLENGTH(x)
2510 /*---------------------------------------------------------------------------*/
2512 /* Inlinable operations (for 'apply' and 'ifjump' GVM instructions) */
2514 /* APPLY-able operations */
2516 #define ___TYPE(x)___FIX(___TYP(x))
2517 #define ___TYPECAST(x,y)(((x)&~___TMASK)+___INT(y))
2518 #define ___SUBTYPE(x)((*___UNTAG(x)&___SMASK)>>(___HTB-___TB))
2519 #define ___SUBTYPESET(x,y)___temp=(x);___HEADER(___temp)=(___HEADER(___temp)&~___SMASK)+((y)<<(___HTB-___TB));
2521 /* IFJUMP-able operations */
2523 #define ___FALSEP(x)((x)==___FAL)
2524 #define ___BOOLEANP(x)(((x)==___FAL)||((x)==___TRU))
2525 #define ___NULLP(x)((x)==___NUL)
2526 #define ___UNBOUNDP(x)(((___temp=(x))==___UNB1)||(___temp==___UNB2))
2527 #define ___EQP(x,y)((x)==(y))
2528 #define ___EOFP(x)((x)==___EOF)
2530 /* IFJUMP-able operations */
2532 #define ___FIXNUMP(x)___TESTTYPE(x,___tFIXNUM)
2533 #define ___FLONUMP(x)___TESTSUBTYPE(x,___sFLONUM)
2534 #define ___SPECIALP(x)___TESTTYPE(x,___tSPECIAL)
2535 #define ___PAIRP(x)___TESTTYPE(x,___tPAIR)
2536 #define ___PAIRMUTABLEP(obj)(___HD_TYP(*___UNTAG_AS(obj,___tPAIR))!=___PERM)
2537 #define ___SUBTYPEDP(x)___TESTTYPE(x,___tSUBTYPED)
2538 #define ___SUBTYPEDMUTABLEP(obj)(___HD_TYP(*___UNTAG_AS(obj,___tSUBTYPED))!=___PERM)
2539 #define ___SUBTYPEDVECTORP(x)___TESTSUBTYPETAG(x,___sVECTOR)
2540 #define ___SUBTYPEDSYMBOLP(x)___TESTSUBTYPETAG(x,___sSYMBOL)
2541 #define ___SUBTYPEDFLONUMP(x)___TESTSUBTYPETAG(x,___sFLONUM)
2542 #define ___SUBTYPEDBIGNUMP(x)___TESTSUBTYPETAG(x,___sBIGNUM)
2543 #define ___VECTORP(x)___TESTSUBTYPE(x,___sVECTOR)
2544 #define ___RATNUMP(x)___TESTSUBTYPE(x,___sRATNUM)
2545 #define ___CPXNUMP(x)___TESTSUBTYPE(x,___sCPXNUM)
2546 #define ___STRUCTUREP(x)___TESTSUBTYPE(x,___sSTRUCTURE)
2547 #define ___BOXP(x)(___TYP((___temp=x))==___tSUBTYPED&&(___HEADER(___temp)&___LSMASK)==___MAKE_HD((___BOX_SIZE<<___LWS),___sBOXVALUES,0))
2548 #define ___VALUESP(x)(___TYP((___temp=x))==___tSUBTYPED&&___TESTSUBTYPETAG(___temp,___sBOXVALUES)&&(___HEADER(___temp)&___LSMASK)!=___MAKE_HD((___BOX_SIZE<<___LWS),___sBOXVALUES,0))
2549 #define ___MEROONP(x)___TESTSUBTYPE(x,___sMEROON)
2550 #define ___JAZZP(x)___TESTSUBTYPE(x,___sJAZZ)
2551 #define ___SYMBOLP(x)___TESTSUBTYPE(x,___sSYMBOL)
2552 #define ___KEYWORDP(x)___TESTSUBTYPE(x,___sKEYWORD)
2553 #define ___SYMKEYP(x)(___SYMBOLP(x)||___KEYWORDP(x))
2554 #define ___FRAMEP(x)___TESTSUBTYPE(x,___sFRAME)
2555 #define ___CONTINUATIONP(x)___TESTSUBTYPE(x,___sCONTINUATION)
2556 #define ___PROMISEP(x)___TESTSUBTYPE(x,___sPROMISE)
2557 #define ___WILLP(x)___TESTLENGTHSUBTYPE(x,(___WILL_SIZE<<___LWS),___sWEAK)
2558 #define ___GCHASHTABLEP(x)(___TYP((___temp=(x)))==___tSUBTYPED&&___TESTHEADERTAG((___temp=___HEADER(___temp)),___sWEAK)&&(___temp&___LSMASK)!=___MAKE_HD((___WILL_SIZE<<___LWS),___sWEAK,0))
2559 #define ___MEMALLOCATEDP(x)___MEM_ALLOCATED(x)
2560 #define ___PROCEDUREP(x)___TESTSUBTYPE(x,___sPROCEDURE)
2561 #define ___RETURNP(x)___TESTSUBTYPE(x,___sRETURN)
2562 #define ___FOREIGNP(x)___TESTSUBTYPE(x,___sFOREIGN)
2563 #define ___STRINGP(x)___TESTSUBTYPE(x,___sSTRING)
2564 #define ___S8VECTORP(x)___TESTSUBTYPE(x,___sS8VECTOR)
2565 #define ___U8VECTORP(x)___TESTSUBTYPE(x,___sU8VECTOR)
2566 #define ___S16VECTORP(x)___TESTSUBTYPE(x,___sS16VECTOR)
2567 #define ___U16VECTORP(x)___TESTSUBTYPE(x,___sU16VECTOR)
2568 #define ___S32VECTORP(x)___TESTSUBTYPE(x,___sS32VECTOR)
2569 #define ___U32VECTORP(x)___TESTSUBTYPE(x,___sU32VECTOR)
2570 #define ___S64VECTORP(x)___TESTSUBTYPE(x,___sS64VECTOR)
2571 #define ___U64VECTORP(x)___TESTSUBTYPE(x,___sU64VECTOR)
2572 #define ___F32VECTORP(x)___TESTSUBTYPE(x,___sF32VECTOR)
2573 #define ___F64VECTORP(x)___TESTSUBTYPE(x,___sF64VECTOR)
2574 #define ___BIGNUMP(x)___TESTSUBTYPE(x,___sBIGNUM)
2575 #define ___CHARP(x)(___TYP((___temp=x))==___tSPECIAL&&___temp>=0)
2576 #define ___NUMBERP(x)___COMPLEXP(x)
2577 #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))))
2579 /* APPLY-able operations */
2581 #define ___FIX_0 ___FIX(0)
2582 #define ___FIXPOS(x)((___WORD)(x))
2583 #define ___FIXMAX(x,y)(((x)<(y))?(y):(x))
2584 #define ___FIXMIN(x,y)(((x)<(y))?(x):(y))
2585 #define ___FIXADD(x,y)((___WORD)((x)+(y)))
2586 #ifndef ___FIXADDP
2587 #define ___FIXADDP(x,y)(___temp=___FIXADD(x,y),___EXPECT_FALSE(((___temp^(x))&(___temp^(y)))<0)?___FAL:___temp)
2588 #endif
2589 #define ___FIX_1 ___FIX(1)
2590 #define ___FIXMUL(x,y)((___WORD)((x)*___INT(y)))
2591 #define ___FIXMULP(x,y)(___EXPECT_FALSE(___FIXQUO((___temp=___FIXMUL(x,y)),y)!=(x))?___FAL:___temp)
2592 #define ___FIXNEG(x)((___WORD)(-(x)))
2593 #define ___FIXNEGP(x)(___EXPECT_FALSE((x)==___FIX(___MIN_FIX))?___FAL:___FIXNEG(x))
2594 #define ___FIXSUB(x,y)((___WORD)((x)-(y)))
2595 #ifndef ___FIXSUBP
2596 #define ___FIXSUBP(x,y)(___temp=___FIXSUB(x,y),___EXPECT_FALSE(((___temp^(x))&((y)^(x)))<0)?___FAL:___temp)
2597 #endif
2598 #define ___FIXQUO(x,y)___FIX(((x)/(y)))
2599 #define ___FIXREM(x,y)((___WORD)((x)%(y)))/****is this ok?*******/
2600 #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)))
2601 #define ___FIXNOT(x)((___WORD)((x)^~___TMASK))
2602 #define ___FIXAND(x,y)((___WORD)((x)&(y)))
2603 #define ___FIX_M1 ___FIX(-1)
2604 #define ___FIXIOR(x,y)((___WORD)((x)|(y)))
2605 #define ___FIXXOR(x,y)((___WORD)((x)^(y)))
2606 #define ___FIXIF(x,y,z)((___WORD)(((x)&(y))|(~(x)&(z))))
2607 #define ___FIXABS(x)((x)<0?___FIXNEG(x):(x))
2608 #define ___FIXABSP(x)((x)<0?((___EXPECT_FALSE((x)==___FIX(___MIN_FIX))?___FAL:___FIXNEG(x))):(x))
2610 #if ___SCMOBJ_WIDTH == 32
2611 #define ___SCMOBJ_MASK(x,y)y
2612 #define ___BITCOUNT_TEMP() \
2613 (___temp=(___temp&___SCMOBJ_MASK(0x55555555,0x55555555))+ \
2614 ((___temp>>1)&___SCMOBJ_MASK(0x55555555,0x55555555)), \
2615 ___temp=(___temp&___SCMOBJ_MASK(0x33333333,0x33333333))+ \
2616 ((___temp>>2)&___SCMOBJ_MASK(0x33333333,0x33333333)), \
2617 ___temp=(___temp&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))+ \
2618 ((___temp>>4)&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f)), \
2619 ___temp=___temp+(___temp>>8), \
2620 ___temp=___temp+(___temp>>16), \
2621 ___FIX(___temp&0xff))
2622 #define ___FIXLENGTH(x) \
2623 (((___temp=___INT(x))<0)&&(___temp=~___temp), \
2624 ___temp|=(___temp>>1), \
2625 ___temp|=(___temp>>2), \
2626 ___temp|=(___temp>>4), \
2627 ___temp|=(___temp>>8), \
2628 ___temp|=(___temp>>16), \
2629 ___BITCOUNT_TEMP())
2630 #define ___FIXFIRSTBITSET(x) \
2631 (((___temp=(x))==0) \
2632 ?___FIX(-1) \
2633 :(___temp=(___temp&-___temp), \
2634 ___FIX((((___temp&~___SCMOBJ_MASK(0x55555555,0x55555555))!=0)| \
2635 (((___temp&~___SCMOBJ_MASK(0x33333333,0x33333333))!=0)<<1)| \
2636 (((___temp&~___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))!=0)<<2)| \
2637 (((___temp&~___SCMOBJ_MASK(0x00ff00ff,0x00ff00ff))!=0)<<3)| \
2638 (((___temp&~___SCMOBJ_MASK(0x0000ffff,0x0000ffff))!=0)<<4))-___TB)))
2639 #else
2640 #define ___SCMOBJ_MASK(x,y)((___CAST(___SCMOBJ,x)<<32)|y)
2641 #define ___BITCOUNT_TEMP() \
2642 (___temp=((___temp)&___SCMOBJ_MASK(0x55555555,0x55555555))+ \
2643 (((___temp)>>1)&___SCMOBJ_MASK(0x55555555,0x55555555)), \
2644 ___temp=(___temp&___SCMOBJ_MASK(0x33333333,0x33333333))+ \
2645 ((___temp>>2)&___SCMOBJ_MASK(0x33333333,0x33333333)), \
2646 ___temp=(___temp&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))+ \
2647 ((___temp>>4)&___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f)), \
2648 ___temp=___temp+(___temp>>8), \
2649 ___temp=___temp+(___temp>>16), \
2650 ___temp=___temp+(___temp>>32), \
2651 ___FIX(___temp&0xff))
2652 #define ___FIXLENGTH(x) \
2653 (((___temp=___INT(x))<0)&&(___temp=~___temp), \
2654 ___temp|=(___temp>>1), \
2655 ___temp|=(___temp>>2), \
2656 ___temp|=(___temp>>4), \
2657 ___temp|=(___temp>>8), \
2658 ___temp|=(___temp>>16), \
2659 ___temp|=(___temp>>32), \
2660 ___BITCOUNT_TEMP())
2661 #define ___FIXFIRSTBITSET(x) \
2662 (((___temp=(x))==0) \
2663 ?___FIX(-1) \
2664 :(___temp=(___temp&-___temp), \
2665 ___FIX((((___temp&~___SCMOBJ_MASK(0x55555555,0x55555555))!=0)| \
2666 (((___temp&~___SCMOBJ_MASK(0x33333333,0x33333333))!=0)<<1)| \
2667 (((___temp&~___SCMOBJ_MASK(0x0f0f0f0f,0x0f0f0f0f))!=0)<<2)| \
2668 (((___temp&~___SCMOBJ_MASK(0x00ff00ff,0x00ff00ff))!=0)<<3)| \
2669 (((___temp&~___SCMOBJ_MASK(0x0000ffff,0x0000ffff))!=0)<<4)| \
2670 (((___temp&~___SCMOBJ_MASK(0x00000000,0xffffffff))!=0)<<5))-___TB)))
2671 #endif
2672 #define ___FIXBITCOUNT(x) \
2673 ((((___temp=___INT(x))<0)&&(___temp=~___temp)),___BITCOUNT_TEMP())
2674 #define ___FIXBITSETP(x,y)((y)&(___CAST(___SCMOBJ,1)<<(___INT(x)+___TB)))
2676 #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)))
2677 #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)))
2678 #define ___FIXASHL(x,y)((x)<<___INT(y))
2679 #define ___FIXASHLP(x,y)((y)>=___FIX(0)?___FIXASHLP2(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2680 #define ___FIXASHLP2(x,y)((x)==((___temp=___FIXASHL(x,y))>>___INT(y))?___temp:___FAL)
2681 #define ___FIXASHR(x,y)(((x)>>___INT(y))&~___TMASK)
2682 #define ___FIXASHRP(x,y)((y)>=___FIX(0)?___FIXASHR(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2683 #define ___FIXLSHR(x,y)((___WORD)(((unsigned ___WORD)(x)>>___INT(y))&~___TMASK))
2684 #define ___FIXLSHRP(x,y)((y)>=___FIX(0)?___FIXLSHR(x,(y)<=___FIX(___FIX_WIDTH)?(y):___FIX(___FIX_WIDTH)):___FAL)
2685 #define ___FIXTOCHR(x)(((x)&~___TMASK)+___tSPECIAL)
2686 #define ___FIXFROMCHR(x)((x)&~___TMASK)
2688 /* IFJUMP-able operations */
2690 #define ___FIXZEROP(x)((x)==0)
2691 #define ___FIXPOSITIVEP(x)((x)>0)
2692 #define ___FIXNEGATIVEP(x)((x)<0)
2693 #define ___FIXODDP(x)((x)&___FIX(1))
2694 #define ___FIXEVENP(x)!((x)&___FIX(1))
2695 #define ___FIXEQ(x,y)((x)==(y))
2696 #define ___FIXLT(x,y)((x)<(y))
2697 #define ___FIXGT(x,y)((x)>(y))
2698 #define ___FIXLE(x,y)((x)<=(y))
2699 #define ___FIXGE(x,y)((x)>=(y))
2701 /* APPLY-able operations */
2703 #define ___F64TOFIX(x)___FIX(x)
2704 #define ___F64FROMFIX(x)___INT(x)
2705 #define ___F64_0 0.0
2706 #define ___F64POS(x)x
2707 #define ___F64MAX(x,y)(___F64NANP(x)?x:(((x)>(y))?(x):(y)))
2708 #define ___F64MIN(x,y)(___F64NANP(x)?x:(((x)<(y))?(x):(y)))
2709 #define ___F64ADD(x,y)((x)+(y))
2710 #define ___F64_1 1.0
2711 #define ___F64MUL(x,y)((x)*(y))
2712 #define ___F64NEG(x)(-(x))
2713 #define ___F64SUB(x,y)((x)-(y))
2714 #define ___F64INV(x)(1.0/(x))
2715 #define ___F64DIV(x,y)((x)/(y))
2716 #define ___F64ABS(x)___CLIBEXT(fabs)(x)
2717 #define ___F64FLOOR(x)___CLIBEXT(floor)(x)
2718 #define ___F64CEILING(x)___CLIBEXT(ceil)(x)
2719 #define ___F64TRUNCATE(x)___EXT(___trunc)(x)
2720 #define ___F64ROUND(x)___EXT(___round)(x)
2721 #define ___F64EXP(x)___CLIBEXT(exp)(x)
2722 #define ___F64LOG(x)___CLIBEXT(log)(x)
2723 #define ___F64SIN(x)___CLIBEXT(sin)(x)
2724 #define ___F64COS(x)___CLIBEXT(cos)(x)
2725 #define ___F64TAN(x)___CLIBEXT(tan)(x)
2726 #define ___F64ASIN(x)___CLIBEXT(asin)(x)
2727 #define ___F64ACOS(x)___CLIBEXT(acos)(x)
2728 #define ___F64ATAN(x)___CLIBEXT(atan)(x)
2729 #ifdef ___GOOD_ATAN2
2730 #define ___F64ATAN2(y,x)___CLIBEXT(atan2)(y,x)
2731 #else
2732 #define ___F64ATAN2(y,x)___EXT(___atan2)(y,x)
2733 #endif
2734 #ifdef ___GOOD_POW
2735 #define ___F64EXPT(x,y)___CLIBEXT(pow)(x,y)
2736 #else
2737 #define ___F64EXPT(x,y)___EXT(___pow)(x,y)
2738 #endif
2739 #define ___F64SQRT(x)___CLIBEXT(sqrt)(x)
2740 #define ___F64COPYSIGN(x,y)___EXT(___copysign)(x,y)
2742 /* IFJUMP-able operations */
2744 #define ___F64INTEGERP(x)(!___F64INFINITEP(x) && (x)==___F64FLOOR(x))
2745 #define ___F64ZEROP(x)((x)==0.0)
2746 #define ___F64POSITIVEP(x)((x)>0.0)
2747 #define ___F64NEGATIVEP(x)((x)<0.0)
2748 #define ___F64ODDP(x)(___F64INTEGERP(x) && (x)!=2.0*___CLIBEXT(floor)((x)*0.5))
2749 #define ___F64EVENP(x)(___F64INTEGERP(x) && (x)==2.0*___CLIBEXT(floor)((x)*0.5))
2750 #define ___F64FINITEP(x)___EXT(___isfinite)(x)
2751 #define ___F64INFINITEP(x)((x)!=0.0 && (x)==2.0*(x))
2752 #ifdef ___USE_ISNAN
2753 #define ___F64NANP(x)___EXT(___isnan)(x)
2754 #else
2755 #define ___F64NANP(x)((x)!=(x))
2756 #endif
2757 #if ___SCMOBJ_WIDTH == 32
2758 #define ___F64FROMFIXEXACTP(x)(1)
2759 #else
2760 #define ___F64FROMFIXEXACTP(x)(___INT(x)==(___WORD)(___F64)___INT(x))
2761 #endif
2762 #define ___F64EQ(x,y)((x)==(y))
2763 #define ___F64LT(x,y)((x)<(y))
2764 #define ___F64GT(x,y)((x)>(y))
2765 #define ___F64LE(x,y)((x)<=(y))
2766 #define ___F64GE(x,y)((x)>=(y))
2768 /* IFJUMP-able operations */
2770 #define ___CHAREQP(x,y)((x)==(y))
2771 #define ___CHARLTP(x,y)((x)<(y))
2772 #define ___CHARGTP(x,y)((x)>(y))
2773 #define ___CHARLEP(x,y)((x)<=(y))
2774 #define ___CHARGEP(x,y)((x)>=(y))
2776 #define ___CHARALPHABETICP(x)___EXT(___iswalpha(___INT(x)))
2777 #define ___CHARNUMERICP(x)___EXT(___iswdigit(___INT(x)))
2778 #define ___CHARWHITESPACEP(x)___EXT(___iswspace(___INT(x)))
2779 #define ___CHARUPPERCASEP(x)___EXT(___iswupper(___INT(x)))
2780 #define ___CHARLOWERCASEP(x)___EXT(___iswlower(___INT(x)))
2781 #define ___CHARUPCASE(x)___CHR(___EXT(___towupper(___INT(x))))
2782 #define ___CHARDOWNCASE(x)___CHR(___EXT(___towlower(___INT(x))))
2784 /* APPLY-able operations */
2786 #define ___PAIR_SIZE 2
2787 #define ___PAIR_CDR_OFS 0
2788 #define ___PAIR_CAR_OFS 1
2790 #define ___PAIR_CAR(obj)(*(___BODY_AS(obj,___tPAIR)+___PAIR_CAR_OFS))
2791 #define ___PAIR_CDR(obj)(*(___BODY_AS(obj,___tPAIR)+___PAIR_CDR_OFS))
2793 #define ___ALLOC_PAIR_EXPR(x,y)(___hp[0]=___MAKE_HD_WORDS(___PAIR_SIZE,___sPAIR), \
2794 ___hp[___PAIR_CAR_OFS+1]=x,___hp[___PAIR_CDR_OFS+1]=y,___ALLOC(___PAIR_SIZE+1))
2795 #define ___ALLOC_PAIR(x,y){___hp[0]=___MAKE_HD_WORDS(___PAIR_SIZE,___sPAIR); \
2796 ___hp[___PAIR_CAR_OFS+1]=x;___hp[___PAIR_CDR_OFS+1]=y;___ALLOC(___PAIR_SIZE+1);}
2797 #define ___CONS(x,y)(___ALLOC_PAIR_EXPR(x,y),___TAG((___hp-___PAIR_SIZE-1),___tPAIR))
2799 #define ___SETCAR(obj,car)___PAIR_CAR(obj)=car;
2800 #define ___SETCDR(obj,cdr)___PAIR_CDR(obj)=cdr;
2801 #define ___CAR(obj)___PAIR_CAR(obj)
2802 #define ___CDR(obj)___PAIR_CDR(obj)
2803 #define ___CAAR(obj)___CAR(___CAR(obj))
2804 #define ___CADR(obj)___CAR(___CDR(obj))
2805 #define ___CDAR(obj)___CDR(___CAR(obj))
2806 #define ___CDDR(obj)___CDR(___CDR(obj))
2807 #define ___CAAAR(obj)___CAR(___CAR(___CAR(obj)))
2808 #define ___CAADR(obj)___CAR(___CAR(___CDR(obj)))
2809 #define ___CADAR(obj)___CAR(___CDR(___CAR(obj)))
2810 #define ___CADDR(obj)___CAR(___CDR(___CDR(obj)))
2811 #define ___CDAAR(obj)___CDR(___CAR(___CAR(obj)))
2812 #define ___CDADR(obj)___CDR(___CAR(___CDR(obj)))
2813 #define ___CDDAR(obj)___CDR(___CDR(___CAR(obj)))
2814 #define ___CDDDR(obj)___CDR(___CDR(___CDR(obj)))
2815 #define ___CAAAAR(obj)___CAR(___CAR(___CAR(___CAR(obj))))
2816 #define ___CAAADR(obj)___CAR(___CAR(___CAR(___CDR(obj))))
2817 #define ___CAADAR(obj)___CAR(___CAR(___CDR(___CAR(obj))))
2818 #define ___CAADDR(obj)___CAR(___CAR(___CDR(___CDR(obj))))
2819 #define ___CADAAR(obj)___CAR(___CDR(___CAR(___CAR(obj))))
2820 #define ___CADADR(obj)___CAR(___CDR(___CAR(___CDR(obj))))
2821 #define ___CADDAR(obj)___CAR(___CDR(___CDR(___CAR(obj))))
2822 #define ___CADDDR(obj)___CAR(___CDR(___CDR(___CDR(obj))))
2823 #define ___CDAAAR(obj)___CDR(___CAR(___CAR(___CAR(obj))))
2824 #define ___CDAADR(obj)___CDR(___CAR(___CAR(___CDR(obj))))
2825 #define ___CDADAR(obj)___CDR(___CAR(___CDR(___CAR(obj))))
2826 #define ___CDADDR(obj)___CDR(___CAR(___CDR(___CDR(obj))))
2827 #define ___CDDAAR(obj)___CDR(___CDR(___CAR(___CAR(obj))))
2828 #define ___CDDADR(obj)___CDR(___CDR(___CAR(___CDR(obj))))
2829 #define ___CDDDAR(obj)___CDR(___CDR(___CDR(___CAR(obj))))
2830 #define ___CDDDDR(obj)___CDR(___CDR(___CDR(___CDR(obj))))
2832 /* APPLY-able operations */
2834 #define ___BOX(x)(___ALLOC(2),___hp[-2]=___MAKE_HD_WORDS(1,___sBOXVALUES), \
2835 ___hp[-1]=x,___TAG((___hp-2),___tSUBTYPED))
2836 #define ___UNBOX(x)___BODY_AS(x,___tSUBTYPED)[0]
2837 #define ___SETBOX(x,y)___BODY_AS(x,___tSUBTYPED)[0]=y;
2839 #define ___VECTORLENGTH(x)___FIX(___HD_FIELDS(___HEADER(x)))
2840 #define ___VECTORREF(x,y)*(___WORD*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(___LWS-___TB)))
2841 #define ___VECTORSET(x,y,z)*(___WORD*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(___LWS-___TB)))=z;
2842 #define ___VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+___LWS));
2844 #define ___STRINGLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>___LCS))
2845 #define ___STRINGREF(x,y)___CHR(___CS_SELECT( \
2846 ___FETCH_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB), \
2847 ___FETCH_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB), \
2848 ___FETCH_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB)))
2849 #define ___STRINGSET(x,y,z)___CS_SELECT( \
2850 ___STORE_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)), \
2851 ___STORE_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)), \
2852 ___STORE_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z)));
2853 #define ___STRINGSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+___LCS));
2855 #define ___S8VECTORLENGTH(x)___FIX(___HD_BYTES(___HEADER(x)))
2856 #define ___S8VECTORREF(x,y) \
2857 ___FIX(___FETCH_S8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2858 #define ___S8VECTORSET(x,y,z) \
2859 ___STORE_S8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2860 #define ___S8VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB));
2862 #define ___U8VECTORLENGTH(x)___FIX(___HD_BYTES(___HEADER(x)))
2863 #define ___U8VECTORREF(x,y) \
2864 ___FIX(___FETCH_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2865 #define ___U8VECTORSET(x,y,z) \
2866 ___STORE_U8(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2867 #define ___U8VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB));
2869 #define ___S16VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>1))
2870 #define ___S16VECTORREF(x,y) \
2871 ___FIX(___FETCH_S16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2872 #define ___S16VECTORSET(x,y,z) \
2873 ___STORE_S16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2874 #define ___S16VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+1));
2876 #define ___U16VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>1))
2877 #define ___U16VECTORREF(x,y) \
2878 ___FIX(___FETCH_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2879 #define ___U16VECTORSET(x,y,z) \
2880 ___STORE_U16(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___INT(z));
2881 #define ___U16VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+1));
2883 #define ___S32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2884 #define ___S32VECTORREF(x,y) \
2885 ___S32BOX(___FETCH_S32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2886 #define ___S32VECTORSET(x,y,z) \
2887 ___STORE_S32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___S32UNBOX(z));
2888 #define ___S32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2890 #define ___U32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2891 #define ___U32VECTORREF(x,y) \
2892 ___U32BOX(___FETCH_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2893 #define ___U32VECTORSET(x,y,z) \
2894 ___STORE_U32(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___U32UNBOX(z));
2895 #define ___U32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2897 #define ___S64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2898 #define ___S64VECTORREF(x,y) \
2899 ___S64BOX(___FETCH_S64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2900 #define ___S64VECTORSET(x,y,z) \
2901 ___STORE_S64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___S64UNBOX(z));
2902 #define ___S64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2904 #define ___U64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2905 #define ___U64VECTORREF(x,y) \
2906 ___U64BOX(___FETCH_U64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB))
2907 #define ___U64VECTORSET(x,y,z) \
2908 ___STORE_U64(___BODY_AS(x,___tSUBTYPED),(y)>>___TB,___U64UNBOX(z));
2909 #define ___U64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2911 #define ___F32VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>2))
2912 #ifdef ___F32
2913 #define ___F32VECTORREF(x,y)*(___F32*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(2-___TB)))
2914 #define ___F32VECTORSET(x,y,z)*(___F32*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(2-___TB)))=z;
2915 #else
2916 #define ___F32VECTORREF(x,y)0.0
2917 #define ___F32VECTORSET(x,y,z);
2918 #endif
2919 #define ___F32VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+2));
2921 #define ___F64VECTORLENGTH(x)___FIX((___HD_BYTES(___HEADER(x))>>3))
2922 #define ___F64VECTORREF(x,y)*(___F64*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(3-___TB)))
2923 #define ___F64VECTORSET(x,y,z)*(___F64*)(((___WORD)___BODY_AS(x,___tSUBTYPED))+((y)<<(3-___TB)))=z;
2924 #define ___F64VECTORSHRINK(x,y)___temp=x;___HEADER(___temp)=(___HEADER(___temp)&~___LMASK)+((y)<<(___LF-___TB+3));
2926 #define ___TYPEID(x)___VECTORREF(x,___FIX(1))
2927 #define ___TYPENAME(x)___VECTORREF(x,___FIX(2))
2928 #define ___TYPEFLAGS(x)___VECTORREF(x,___FIX(3))
2929 #define ___TYPESUPER(x)___VECTORREF(x,___FIX(4))
2930 #define ___TYPEFIELDS(x)___VECTORREF(x,___FIX(5))
2932 #define ___STRUCTURETYPE(x)___VECTORREF(x,___FIX(0))
2933 #define ___STRUCTURETYPESET(x,y)___VECTORSET(x,___FIX(0),y)
2934 #define ___STRUCTUREDIOP(x,typeid)(___TESTSUBTYPE(x,___sSTRUCTURE)&&___TYPEID(___STRUCTURETYPE(___temp))==(typeid))
2935 #define ___UNCHECKEDSTRUCTUREREF(x,y,type,proc)___VECTORREF(x,y)
2936 #define ___UNCHECKEDSTRUCTURESET(x,y,z,type,proc)___VECTORSET(x,z,y)
2938 #define ___CLOSURELENGTH(x)___FIX(___HD_FIELDS(___HEADER(x)))
2939 #define ___CLOSURECODE(x)___CLO(x,0)
2940 #define ___CLOSUREREF(x,y)___CLO(x,___INT(y))
2941 #define ___CLOSURESET(x,y,z)___SET_CLO(x,___INT(y),z)
2943 #define ___GLOBALVARREF(gv)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->val
2944 #define ___GLOBALVARPRIMREF(gv)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->prm
2945 #define ___GLOBALVARSET(gv,x)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->val = x;
2946 #define ___GLOBALVARPRIMSET(gv,x)((___glo_struct*)___FIELD(gv,___SYMBOL_GLOBAL))->prm = x;
2948 #define ___MAKEPROMISE(x) \
2949 (___ALLOC(___PROMISE_SIZE+1), \
2950 ___hp[-3]=___MAKE_HD_WORDS(___PROMISE_SIZE,___sPROMISE), \
2951 ___hp[-2]=x, ___hp[-1]=___TAG((___hp-___PROMISE_SIZE-1),___tSUBTYPED))
2953 #define ___MAKEWILL(testator,action) \
2954 (___hp[0]=___MAKE_HD_WORDS(___WILL_SIZE,___sWEAK), \
2955 ___hp[1]=___ps->nonexecutable_wills, \
2956 ___hp[2]=testator, \
2957 ___hp[3]=action, \
2958 ___ps->nonexecutable_wills=___TAG(___hp,0), \
2959 ___ALLOC(___WILL_SIZE+1), \
2960 ___TAG((___hp-___WILL_SIZE-1),___tSUBTYPED))
2961 #define ___WILLTESTATOR(x)___BODY_AS(x,___tSUBTYPED)[1]
2963 #define ___EXECUTABLE_WILL 1
2964 #define ___UNMARKED_TESTATOR_WILL 2
2966 #define ___GCHASHTABLEREF(x,y)___EXT(___gc_hash_table_ref)(x,y)
2967 #define ___GCHASHTABLESET(x,y,z)___EXT(___gc_hash_table_set)(x,y,z)
2968 #define ___GCHASHTABLEREHASH(x,y)___EXT(___gc_hash_table_rehash)(x,y)
2970 #define ___GCHASHTABLE_HASH1(obj,mod) ((((obj)>>___TB)&___MAX_FIX)%(mod))
2971 #define ___GCHASHTABLE_HASH2(obj,mod) (((((obj)>>___TB)&___MAX_FIX)%((mod)-1))+1)
2973 #define ___GCHASHTABLE_FLAG_WEAK_KEYS 1
2974 #define ___GCHASHTABLE_FLAG_WEAK_VALS 2
2975 #define ___GCHASHTABLE_FLAG_KEY_MOVED 4
2976 #define ___GCHASHTABLE_FLAG_ENTRY_DELETED 8
2977 #define ___GCHASHTABLE_FLAG_MEM_ALLOC_KEYS 16
2978 #define ___GCHASHTABLE_FLAG_NEED_REHASH 32
2980 #define ___GCHASHTABLE_NEXT 0
2981 #define ___GCHASHTABLE_FLAGS 1
2982 #define ___GCHASHTABLE_COUNT 2
2983 #define ___GCHASHTABLE_MIN_COUNT 3
2984 #define ___GCHASHTABLE_FREE 4
2985 #define ___GCHASHTABLE_KEY0 5
2986 #define ___GCHASHTABLE_VAL0 6
2988 #define ___CURRENTTHREAD ___ps->current_thread
2989 #define ___RUNQUEUE ___ps->run_queue
2991 #define ___THREAD_SAVE \
2992 if (___R0 == ___GSTATE->handler_break) \
2993 frame = ___STK(-___BREAK_FRAME_NEXT); \
2994 else \
2996 ___SET_STK(-___FRAME_STACK_RA,___R0) \
2997 ___R0 = ___GSTATE->handler_break; \
2998 frame = ___CAST(___SCMOBJ,___fp); \
2999 ___ADJFP(___BREAK_FRAME_SPACE) \
3000 ___SET_STK(-___BREAK_FRAME_NEXT,frame) \
3001 ___ps->stack_break = ___fp; \
3003 thread = ___ps->current_thread; \
3004 ___FIELD(___FIELD(thread,___THREAD_CONT),___CONTINUATION_FRAME) = frame;
3006 #define ___JUMP_THREAD_SAVE1(jump) \
3007 { ___SCMOBJ proc; \
3008 ___SCMOBJ thread; \
3009 ___SCMOBJ frame; \
3010 ___POP_ARGS1(proc) \
3011 ___THREAD_SAVE \
3012 ___PUSH_ARGS1(thread) \
3013 jump(___SET_NARGS(1),proc) \
3016 #define ___JUMP_THREAD_SAVE2(jump) \
3017 { ___SCMOBJ proc; \
3018 ___SCMOBJ arg1; \
3019 ___SCMOBJ thread; \
3020 ___SCMOBJ frame; \
3021 ___POP_ARGS2(proc,arg1) \
3022 ___THREAD_SAVE \
3023 ___PUSH_ARGS2(thread,arg1) \
3024 jump(___SET_NARGS(2),proc) \
3027 #define ___JUMP_THREAD_SAVE3(jump) \
3028 { ___SCMOBJ proc; \
3029 ___SCMOBJ arg1; \
3030 ___SCMOBJ arg2; \
3031 ___SCMOBJ thread; \
3032 ___SCMOBJ frame; \
3033 ___POP_ARGS3(proc,arg1,arg2) \
3034 ___THREAD_SAVE \
3035 ___PUSH_ARGS3(thread,arg1,arg2) \
3036 jump(___SET_NARGS(3),proc) \
3039 #define ___JUMP_THREAD_SAVE4(jump) \
3040 { ___SCMOBJ proc; \
3041 ___SCMOBJ arg1; \
3042 ___SCMOBJ arg2; \
3043 ___SCMOBJ arg3; \
3044 ___SCMOBJ thread; \
3045 ___SCMOBJ frame; \
3046 ___POP_ARGS4(proc,arg1,arg2,arg3) \
3047 ___THREAD_SAVE \
3048 ___PUSH_ARGS4(thread,arg1,arg2,arg3) \
3049 jump(___SET_NARGS(4),proc) \
3052 #define ___THREAD_RESTORE \
3053 { ___SCMOBJ cont = ___FIELD(thread,___THREAD_CONT); \
3054 ___fp = ___ps->stack_break; \
3055 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3056 ___FIELD(cont,___CONTINUATION_FRAME) = ___FIX(0); \
3057 ___ps->current_thread = thread; \
3058 ___SET_R0(___GSTATE->handler_break) \
3061 #define ___JUMP_THREAD_RESTORE2(jump) \
3062 { ___SCMOBJ thread; \
3063 ___SCMOBJ proc; \
3064 ___POP_ARGS2(thread,proc) \
3065 ___THREAD_RESTORE \
3066 jump(___SET_NARGS(0),proc) \
3069 #define ___JUMP_THREAD_RESTORE3(jump) \
3070 { ___SCMOBJ thread; \
3071 ___SCMOBJ proc; \
3072 ___SCMOBJ arg1; \
3073 ___POP_ARGS3(thread,proc,arg1) \
3074 ___THREAD_RESTORE \
3075 ___PUSH_ARGS1(arg1) \
3076 jump(___SET_NARGS(1),proc) \
3079 #define ___JUMP_THREAD_RESTORE4(jump) \
3080 { ___SCMOBJ thread; \
3081 ___SCMOBJ proc; \
3082 ___SCMOBJ arg1; \
3083 ___SCMOBJ arg2; \
3084 ___POP_ARGS4(thread,proc,arg1,arg2) \
3085 ___THREAD_RESTORE \
3086 ___PUSH_ARGS2(arg1,arg2) \
3087 jump(___SET_NARGS(2),proc) \
3090 #define ___JUMP_THREAD_RESTORE5(jump) \
3091 { ___SCMOBJ thread; \
3092 ___SCMOBJ proc; \
3093 ___SCMOBJ arg1; \
3094 ___SCMOBJ arg2; \
3095 ___SCMOBJ arg3; \
3096 ___POP_ARGS5(thread,proc,arg1,arg2,arg3) \
3097 ___THREAD_RESTORE \
3098 ___PUSH_ARGS3(arg1,arg2,arg3) \
3099 jump(___SET_NARGS(3),proc) \
3102 #define ___FRAME_OVERHEAD(n) (___FRAME_SPACE(n)-(n))
3103 #define ___RETI_RA (-___FRAME_OVERHEAD(___NB_GVM_REGS+1))
3104 #define ___FRAME_RETI_RA (1-___FRAME_RESERVE-___RETI_RA)
3106 #define ___SYMKEY_NAME 0
3107 #define ___SYMKEY_HASH 1
3108 #define ___SYMKEY_NEXT 2
3109 #define ___SYMBOL_GLOBAL 3
3110 #define ___PROMISE_THUNK 0
3111 #define ___PROMISE_RESULT 1
3112 #define ___CONTINUATION_FRAME 0
3113 #define ___CONTINUATION_DENV 1
3114 #define ___THREAD_CONT 19
3115 #define ___THREAD_DENV 20
3116 #define ___THREAD_DENV_CACHE1 21
3117 #define ___THREAD_DENV_CACHE2 22
3118 #define ___THREAD_DENV_CACHE3 23
3119 #define ___ENV_NAME_VAL 0
3120 #define ___ENV_LEFT 1
3121 #define ___ENV_RIGHT 2
3122 #define ___DENV_LOCAL 0
3123 #define ___DENV_DYNWIND 1
3124 #define ___DENV_INTERRUPT_MASK 2
3125 #define ___DENV_DEBUGGING_SETTINGS 3
3126 #define ___DENV_EXCEPTION_HANDLER 4
3127 #define ___DENV_INPUT_PORT 5
3128 #define ___DENV_OUTPUT_PORT 6
3130 #define ___FRAME_EXTRA_SLOTS 1
3131 #define ___FRAME_STACK_RA 0
3132 #define ___FRAME_RA 0
3134 #define ___FRAME_STORE_RA(ra) \
3135 if (___fp != ___ps->stack_break) \
3136 ___SET_STK(-___FRAME_STACK_RA,ra)
3138 #define ___FRAME_FETCH_RA \
3139 ((___fp != ___ps->stack_break) \
3140 ? ___STK(-___FRAME_STACK_RA) \
3141 : ___GSTATE->handler_break)
3143 #define ___CONTINUATION_CAPTURE \
3144 if (___R0 == ___GSTATE->handler_break) \
3145 frame = ___STK(-___BREAK_FRAME_NEXT); \
3146 else \
3148 ___SET_STK(-___FRAME_STACK_RA,___R0) \
3149 ___R0 = ___GSTATE->handler_break; \
3150 frame = ___CAST(___SCMOBJ,___fp); \
3152 ___ADJFP(___ROUND_TO_MULT(___SUBTYPED_OVERHEAD+___CONTINUATION_SIZE,___FRAME_ALIGN)) \
3153 ___SET_STK(0,___MAKE_HD_WORDS(___CONTINUATION_SIZE,___sCONTINUATION)) \
3154 ___SET_STK(-1,frame) \
3155 ___SET_STK(-2,___FIELD(___ps->current_thread,___THREAD_DENV)) \
3156 cont = ___TAG(&___STK(0),___tSUBTYPED); \
3157 ___ADJFP(___BREAK_FRAME_SPACE) \
3158 ___SET_STK(-___BREAK_FRAME_NEXT,frame) \
3159 ___ps->stack_break = ___fp;
3161 #define ___JUMP_CONTINUATION_CAPTURE1(jump) \
3162 { ___SCMOBJ proc; \
3163 ___SCMOBJ frame; \
3164 ___SCMOBJ cont; \
3165 ___POP_ARGS1(proc) \
3166 ___CONTINUATION_CAPTURE \
3167 ___PUSH_ARGS1(cont); \
3168 jump(___SET_NARGS(1),proc) \
3171 #define ___JUMP_CONTINUATION_CAPTURE2(jump) \
3172 { ___SCMOBJ proc; \
3173 ___SCMOBJ arg1; \
3174 ___SCMOBJ frame; \
3175 ___SCMOBJ cont; \
3176 ___POP_ARGS2(proc,arg1) \
3177 ___CONTINUATION_CAPTURE \
3178 ___PUSH_ARGS2(cont,arg1); \
3179 jump(___SET_NARGS(2),proc) \
3182 #define ___JUMP_CONTINUATION_CAPTURE3(jump) \
3183 { ___SCMOBJ proc; \
3184 ___SCMOBJ arg1; \
3185 ___SCMOBJ arg2; \
3186 ___SCMOBJ frame; \
3187 ___SCMOBJ cont; \
3188 ___POP_ARGS3(proc,arg1,arg2) \
3189 ___CONTINUATION_CAPTURE \
3190 ___PUSH_ARGS3(cont,arg1,arg2); \
3191 jump(___SET_NARGS(3),proc) \
3194 #define ___JUMP_CONTINUATION_CAPTURE4(jump) \
3195 { ___SCMOBJ proc; \
3196 ___SCMOBJ arg1; \
3197 ___SCMOBJ arg2; \
3198 ___SCMOBJ arg3; \
3199 ___SCMOBJ frame; \
3200 ___SCMOBJ cont; \
3201 ___POP_ARGS4(proc,arg1,arg2,arg3) \
3202 ___CONTINUATION_CAPTURE \
3203 ___PUSH_ARGS4(cont,arg1,arg2,arg3); \
3204 jump(___SET_NARGS(4),proc) \
3207 #define ___CONTINUATION_GRAFT_NO_WINDING \
3208 ___fp = ___ps->stack_break; \
3209 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3210 temp = ___FIELD(cont,___CONTINUATION_DENV); \
3211 thread = ___ps->current_thread; \
3212 ___FIELD(thread,___THREAD_DENV) = temp; \
3213 temp = ___FIELD(___FIELD(temp,___DENV_LOCAL),___ENV_NAME_VAL); \
3214 ___FIELD(thread,___THREAD_DENV_CACHE1) = temp; \
3215 ___FIELD(thread,___THREAD_DENV_CACHE2) = temp; \
3216 ___FIELD(thread,___THREAD_DENV_CACHE3) = temp; \
3217 ___SET_R0(___GSTATE->handler_break)
3219 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING2(jump) \
3220 { ___SCMOBJ cont; \
3221 ___SCMOBJ proc; \
3222 ___SCMOBJ temp; \
3223 ___SCMOBJ thread; \
3224 ___POP_ARGS2(cont,proc) \
3225 ___CONTINUATION_GRAFT_NO_WINDING \
3226 jump(___SET_NARGS(0),proc) \
3229 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING3(jump) \
3230 { ___SCMOBJ cont; \
3231 ___SCMOBJ proc; \
3232 ___SCMOBJ arg1; \
3233 ___SCMOBJ temp; \
3234 ___SCMOBJ thread; \
3235 ___POP_ARGS3(cont,proc,arg1) \
3236 ___CONTINUATION_GRAFT_NO_WINDING \
3237 ___PUSH_ARGS1(arg1) \
3238 jump(___SET_NARGS(1),proc) \
3241 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING4(jump) \
3242 { ___SCMOBJ cont; \
3243 ___SCMOBJ proc; \
3244 ___SCMOBJ arg1; \
3245 ___SCMOBJ arg2; \
3246 ___SCMOBJ temp; \
3247 ___SCMOBJ thread; \
3248 ___POP_ARGS4(cont,proc,arg1,arg2) \
3249 ___CONTINUATION_GRAFT_NO_WINDING \
3250 ___PUSH_ARGS2(arg1,arg2) \
3251 jump(___SET_NARGS(2),proc) \
3254 #define ___JUMP_CONTINUATION_GRAFT_NO_WINDING5(jump) \
3255 { ___SCMOBJ cont; \
3256 ___SCMOBJ proc; \
3257 ___SCMOBJ arg1; \
3258 ___SCMOBJ arg2; \
3259 ___SCMOBJ arg3; \
3260 ___SCMOBJ temp; \
3261 ___SCMOBJ thread; \
3262 ___POP_ARGS5(cont,proc,arg1,arg2,arg3) \
3263 ___CONTINUATION_GRAFT_NO_WINDING \
3264 ___PUSH_ARGS3(arg1,arg2,arg3) \
3265 jump(___SET_NARGS(3),proc) \
3268 #define ___JUMP_CONTINUATION_RETURN_NO_WINDING2(jump) \
3269 { ___SCMOBJ cont; \
3270 ___SCMOBJ result; \
3271 ___SCMOBJ temp; \
3272 ___SCMOBJ thread; \
3273 ___POP_ARGS2(cont,result) \
3274 ___SET_R1(result) \
3275 ___fp = ___ps->stack_break; \
3276 ___SET_STK(-___BREAK_FRAME_NEXT,___FIELD(cont,___CONTINUATION_FRAME)) \
3277 temp = ___FIELD(cont,___CONTINUATION_DENV); \
3278 thread = ___ps->current_thread; \
3279 ___FIELD(thread,___THREAD_DENV) = temp; \
3280 temp = ___FIELD(___FIELD(temp,___DENV_LOCAL),___ENV_NAME_VAL); \
3281 ___FIELD(thread,___THREAD_DENV_CACHE1) = temp; \
3282 ___FIELD(thread,___THREAD_DENV_CACHE2) = temp; \
3283 ___FIELD(thread,___THREAD_DENV_CACHE3) = temp; \
3284 ___JUMPPRM(___NOTHING,___GSTATE->handler_break) \
3287 /*---------------------------------------------------------------------------*/
3289 /* Stack manipulation */
3291 #define ___FP_AFTER(fp1,fp2)((fp1) < (fp2))
3292 #define ___FP_PUSH(fp,val)*--fp=(val);
3293 #define ___FP_POP(fp)*fp++
3294 #define ___FP_STK(fp,fpo)fp[-(fpo)]
3295 #define ___FP_SET_STK(fp,fpo,val)fp[-(fpo)]=(val);
3296 #define ___FP_ADJFP(fp,fpa)fp-=(fpa);
3298 #define ___PUSH(val)___FP_PUSH(___fp,val)
3299 #define ___POP ___FP_POP(___fp)
3300 #define ___STK(fpo)___FP_STK(___fp,fpo)
3301 #define ___SET_STK(fpo,val)___FP_SET_STK(___fp,fpo,val)
3302 #define ___ADJFP(fpa)___FP_ADJFP(___fp,fpa)
3303 #define ___PSSTK(fpo)___FP_STK(___PSFP,fpo)
3304 #define ___PSADJFP(fpa)___FP_ADJFP(___PSFP,fpa)
3306 #define ___PRM(i,glo)___GLOSTRUCT(i,glo).prm
3307 #define ___GLO(i,glo)___GLOSTRUCT(i,glo).val
3308 #define ___SET_GLO(i,glo,x)___GLOSTRUCT(i,glo).val=x;
3309 #ifdef ___BIND_LATE
3310 #define ___GLOSTRUCT(i,glo)(*(___glo_struct*)___glo_tbl[i])
3311 #else
3312 #define ___GLOSTRUCT(i,glo)glo
3313 #endif
3315 #define ___HOST_PROC ___SM(___MH_PROC,___PH_PROC)
3316 #define ___HOST_LBL0 ___SM(1,___PH_LBL0)
3318 #define ___BEGIN_M_COD ___SM(___BEGIN_COD,___NOTHING)
3319 #define ___END_M_COD ___SM(___END_COD,___NOTHING)
3321 #define ___BEGIN_M_HLBL ___SM(___BEGIN_HLBL,___NOTHING)
3322 #define ___DEF_M_HLBL_INTRO ___SM(___DEF_HLBL_INTRO,___NOTHING)
3323 #define ___DEF_M_HLBL(id)___SM(___DEF_HLBL(id),___NOTHING)
3324 #define ___END_M_HLBL ___SM(___END_HLBL,___NOTHING)
3326 #define ___BEGIN_M_SW ___SM(___BEGIN_SW,___NOTHING)
3327 #define ___END_M_SW ___SM(___END_SW,___NOTHING)
3329 #define ___BEGIN_P_COD ___SM(___NOTHING,___BEGIN_COD)
3330 #define ___END_P_COD ___SM(___NOTHING,___END_COD)
3332 #define ___BEGIN_P_HLBL ___SM(___NOTHING,___BEGIN_HLBL)
3333 #define ___DEF_P_HLBL_INTRO ___SM(___NOTHING,___DEF_HLBL_INTRO)
3334 #define ___DEF_P_HLBL(id)___SM(___NOTHING,___DEF_HLBL(id))
3335 #define ___END_P_HLBL ___SM(___NOTHING,___END_HLBL)
3337 #define ___BEGIN_P_SW ___SM(___NOTHING,___BEGIN_SW)
3338 #define ___END_P_SW ___SM(___NOTHING,___END_SW)
3340 #define ___D_ALL ___SM(___MD_ALL,___PD_ALL)
3341 #define ___R_ALL ___SM(___MR_ALL,___PR_ALL)
3342 #define ___W_ALL ___SM(___MW_ALL,___PW_ALL)
3344 #define ___BEGIN_COD \
3345 ___HIDDEN ___WORD ___HOST_PROC ___P((___processor_state ___ps),(___ps) \
3346 ___processor_state ___ps;){ \
3347 register ___WORD ___pc, ___start, ___temp; \
3348 register ___S32 ___s32_temp; /*******************/ \
3349 register ___U32 ___u32_temp; /*******************/ \
3350 register ___S64 ___s64_temp; /*******************/ \
3351 register ___U64 ___u64_temp; /*******************/ \
3352 ___D_ALL
3354 #define ___END_COD \
3355 ___ps->pc=___pc; ___W_ALL return ___pc; }
3357 #ifdef ___DEBUG_HOST_CHANGES
3358 #define ___REGISTER_HOST_ENTRY \
3359 ___EXT(___register_host_entry) (___start, ___MODULE_NAME);
3360 #else
3361 #define ___REGISTER_HOST_ENTRY
3362 #endif
3364 #ifdef ___USE_LABEL_VALUES
3366 #define ___SETUP_HOST_LABEL 1
3368 #define ___BEGIN_HLBL static void *___hlbl_tbl[]={
3369 #define ___DEF_HLBL_INTRO 0,
3370 #define ___DEF_HLBL(id)&&id,
3371 #define ___END_HLBL \
3372 0}; if (___EXPECT_FALSE(___ps == 0)) return ___CAST(___WORD,___hlbl_tbl);
3374 #define ___BEGIN_SW \
3375 ___R_ALL ___start=___MLBL(___HOST_LBL0); ___pc=___ps->pc; \
3376 ___REGISTER_HOST_ENTRY \
3377 goto *___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(((___label_struct*)(___pc-___tSUBTYPED))->host_label);
3379 #define ___DEF_SW(n)
3381 #ifdef ___USE_INLINE_JUMPS
3383 #define ___END_SW \
3384 ___jumpext:
3386 #define ___JUMP(dest) \
3387 {void *___host_label; ___pc=dest; \
3388 ___host_label=___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(((___label_struct*)(___pc-___tSUBTYPED))->host_label); \
3389 if (___EXPECT_TRUE(___CAST_FAKEHOST_TO_HOST(((___label_struct*)(___pc-___tSUBTYPED))->host) \
3390 == ___HOST_PROC)) \
3391 goto *___host_label; \
3392 goto ___jumpext;}
3394 #else
3396 #define ___END_SW \
3397 ___jump: \
3398 {void *___host_label=___CAST_FAKEVOIDSTAR_TO_VOIDSTAR(((___label_struct*)(___pc-___tSUBTYPED))->host_label); \
3399 if (___EXPECT_TRUE(___CAST_FAKEHOST_TO_HOST(((___label_struct*)(___pc-___tSUBTYPED))->host) \
3400 == ___HOST_PROC)) \
3401 goto *___host_label;} \
3402 ___jumpext:
3404 #define ___JUMP(dest){___pc=dest;goto ___jump;}
3406 #endif
3408 #define ___JUMPEXT(dest){___pc=dest;goto ___jumpext;}
3410 #else
3412 #define ___SETUP_HOST_LABEL 0
3414 #define ___BEGIN_HLBL
3415 #define ___DEF_HLBL_INTRO
3416 #define ___DEF_HLBL(id)
3417 #define ___END_HLBL
3419 #define ___BEGIN_SW \
3420 ___R_ALL ___start=___MLBL(___HOST_LBL0); ___pc=___ps->pc; \
3421 ___REGISTER_HOST_ENTRY \
3422 ___jump: \
3423 switch((___pc-=___start)/(___LS*___WS)) \
3426 #define ___DEF_SW(n)case ___PH_LBL0-___HOST_LBL0+n:
3428 #define ___END_SW \
3429 }___pc+=___start;___jumpext:
3431 #define ___JUMP(dest){___pc=dest;goto ___jump;}
3432 #define ___JUMPEXT(dest){___pc=dest;goto ___jumpext;}
3434 #endif
3436 #define ___BEGIN_P_SLBL ___SM(___NOTHING,___BEGIN_SLBL)
3437 #define ___DEF_P_SLBL(id)
3438 #define ___END_P_SLBL ___SM(___NOTHING,___END_SLBL)
3440 #define ___LS 4
3442 #define ___PSHEAP ___ps->hp
3443 #define ___D_HEAP register ___WORD *___hp;
3444 #define ___R_HEAP ___hp=___PSHEAP;
3445 #define ___W_HEAP ___PSHEAP=___hp;
3447 #define ___PSFP ___ps->fp
3448 #define ___D_FP register ___WORD *___fp;
3449 #define ___R_FP ___fp=___PSFP;
3450 #define ___W_FP ___PSFP=___fp;
3452 /*---------------------------------------------------------------------------*/
3454 /* GVM registers */
3456 #ifndef ___MAX_LOCAL_GVM_REGS
3457 #define ___MAX_LOCAL_GVM_REGS 25
3458 #endif
3460 #if ___NB_ARG_REGS == 0
3461 #define ___PUSH_ARGS1(a)___PUSH(a)
3462 #define ___POP_ARGS1(a)a = ___POP;
3463 #define ___PUSH_ARGS2(a,b)___PUSH(a)___PUSH(b)
3464 #define ___POP_ARGS2(a,b)b = ___POP; a = ___POP;
3465 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___PUSH(b)___PUSH(c)
3466 #define ___POP_ARGS3(a,b,c)c = ___POP; b = ___POP; a = ___POP;
3467 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)
3468 #define ___POP_ARGS4(a,b,c,d)d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3469 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)___PUSH(e)
3470 #define ___POP_ARGS5(a,b,c,d,e)e = ___POP; d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3471 #else
3472 #define ___PUSH_ARGS1(a)___SET_R1(a)
3473 #define ___POP_ARGS1(a)a = ___R1;
3474 #if ___NB_ARG_REGS == 1
3475 #define ___PUSH_ARGS2(a,b)___PUSH(a)___SET_R1(b)
3476 #define ___POP_ARGS2(a,b)b = ___R1; a = ___POP;
3477 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___PUSH(b)___SET_R1(c)
3478 #define ___POP_ARGS3(a,b,c)c = ___R1; b = ___POP; a = ___POP;
3479 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___PUSH(c)___SET_R1(d)
3480 #define ___POP_ARGS4(a,b,c,d)d = ___R1; c = ___POP; b = ___POP; a = ___POP;
3481 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___PUSH(d)___SET_R1(e)
3482 #define ___POP_ARGS5(a,b,c,d,e)e = ___R1; d = ___POP; c = ___POP; b = ___POP; a = ___POP;
3483 #else
3484 #define ___PUSH_ARGS2(a,b)___SET_R1(a)___SET_R2(b)
3485 #define ___POP_ARGS2(a,b)b = ___R2; a = ___R1;
3486 #if ___NB_ARG_REGS == 2
3487 #define ___PUSH_ARGS3(a,b,c)___PUSH(a)___SET_R1(b)___SET_R2(c)
3488 #define ___POP_ARGS3(a,b,c)c = ___R2; b = ___R1; a = ___POP;
3489 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___PUSH(b)___SET_R1(c)___SET_R2(d)
3490 #define ___POP_ARGS4(a,b,c,d)d = ___R2; c = ___R1; b = ___POP; a = ___POP;
3491 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___PUSH(c)___SET_R1(d)___SET_R2(e)
3492 #define ___POP_ARGS5(a,b,c,d,e)e = ___R2; d = ___R1; c = ___POP; b = ___POP; a = ___POP;
3493 #else
3494 #define ___PUSH_ARGS3(a,b,c)___SET_R1(a)___SET_R2(b)___SET_R3(c)
3495 #define ___POP_ARGS3(a,b,c)c = ___R3; b = ___R2; a = ___R1;
3496 #if ___NB_ARG_REGS == 3
3497 #define ___PUSH_ARGS4(a,b,c,d)___PUSH(a)___SET_R1(b)___SET_R2(c)___SET_R3(d)
3498 #define ___POP_ARGS4(a,b,c,d)d = ___R3; c = ___R2; b = ___R1; a = ___POP;
3499 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___PUSH(b)___SET_R1(c)___SET_R2(d)___SET_R3(e)
3500 #define ___POP_ARGS5(a,b,c,d,e)e = ___R3; d = ___R2; c = ___R1; b = ___POP; a = ___POP;
3501 #else
3502 #define ___PUSH_ARGS4(a,b,c,d)___SET_R1(a)___SET_R2(b)___SET_R3(c)___SET_R4(d)
3503 #define ___POP_ARGS4(a,b,c,d)d = ___R4; c = ___R3; b = ___R2; a = ___R1;
3504 #if ___NB_ARG_REGS == 4
3505 #define ___PUSH_ARGS5(a,b,c,d,e)___PUSH(a)___SET_R1(b)___SET_R2(c)___SET_R3(d)___SET_R4(e)
3506 #define ___POP_ARGS5(a,b,c,d,e)e = ___R4; d = ___R3; c = ___R2; b = ___R1; a = ___POP;
3507 #else
3508 #define ___PUSH_ARGS5(a,b,c,d,e)___SET_R1(a)___SET_R2(b)___SET_R3(c)___SET_R4(d)___SET_R5(e)
3509 #define ___POP_ARGS5(a,b,c,d,e)e = ___R5; d = ___R4; c = ___R3; b = ___R2; a = ___R1;
3510 #endif
3511 #endif
3512 #endif
3513 #endif
3514 #endif
3516 #define ___PSR0 ___ps->r[0]
3517 #if ___MAX_LOCAL_GVM_REGS > 0
3518 #define ___D_R0 register ___WORD ___r0;
3519 #define ___R_R0 ___r0=___PSR0;
3520 #define ___W_R0 ___PSR0=___r0;
3521 #define ___R0 ___r0
3522 #else
3523 #define ___D_R0
3524 #define ___R_R0
3525 #define ___W_R0
3526 #define ___R0 ___PSR0
3527 #endif
3528 #define ___SET_R0(val)___R0=val;
3529 #define ___PUSH_R0 ___PUSH(___R0)
3530 #define ___POP_R0 ___SET_R0(___POP)
3532 #if ___NB_ARG_REGS == 0
3533 #define ___PUSH_ARGS_IN_REGS(na)
3534 #define ___POP_ARGS_IN_REGS(na)
3535 #define ___PSSELF ___PSR1
3536 #define ___SELF ___R1
3537 #define ___LD_ARG_REGS
3538 #define ___ST_ARG_REGS
3539 #endif
3541 #define ___PSR1 ___ps->r[1]
3542 #if ___MAX_LOCAL_GVM_REGS > 1
3543 #define ___D_R1 register ___WORD ___r1;
3544 #define ___R_R1 ___r1=___PSR1;
3545 #define ___W_R1 ___PSR1=___r1;
3546 #define ___R1 ___r1
3547 #else
3548 #define ___D_R1
3549 #define ___R_R1
3550 #define ___W_R1
3551 #define ___R1 ___PSR1
3552 #endif
3553 #define ___SET_R1(val)___R1=(val);
3554 #define ___PUSH_R1_TO_R1 ___PUSH(___R1)
3555 #define ___POP_R1_TO_R1 ___SET_R1(___POP)
3556 #define ___LD_R1_TO_R1 ___D_R1 ___R_R1
3557 #define ___ST_R1_TO_R1 ___W_R1
3559 #if ___NB_ARG_REGS == 1
3560 #define ___PUSH_ARGS_IN_REGS(na) \
3561 if ((na)>0) ___PUSH_R1_TO_R1
3562 #define ___POP_ARGS_IN_REGS(na) \
3563 if ((na)>0) ___POP_R1_TO_R1
3564 #define ___PSSELF ___PSR2
3565 #define ___SELF ___R2
3566 #define ___LD_ARG_REGS ___LD_R1_TO_R1
3567 #define ___ST_ARG_REGS ___ST_R1_TO_R1
3568 #endif
3570 #if ___NB_GVM_REGS == 2
3572 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R1
3573 #define ___POP_REGS ___POP_R1_TO_R1 ___POP_R0
3575 #else
3577 #define ___PSR2 ___ps->r[2]
3578 #if ___MAX_LOCAL_GVM_REGS > 2
3579 #define ___D_R2 register ___WORD ___r2;
3580 #define ___R_R2 ___r2=___PSR2;
3581 #define ___W_R2 ___PSR2=___r2;
3582 #define ___R2 ___r2
3583 #else
3584 #define ___D_R2
3585 #define ___R_R2
3586 #define ___W_R2
3587 #define ___R2 ___PSR2
3588 #endif
3589 #define ___SET_R2(val)___R2=(val);
3590 #define ___PUSH_R1_TO_R2 ___PUSH_R1_TO_R1 ___PUSH(___R2)
3591 #define ___POP_R2_TO_R1 ___SET_R2(___POP)___POP_R1_TO_R1
3592 #define ___LD_R1_TO_R2 ___D_R2 ___LD_R1_TO_R1 ___R_R2
3593 #define ___ST_R1_TO_R2 ___ST_R1_TO_R1 ___W_R2
3595 #if ___NB_ARG_REGS == 2
3596 #define ___PUSH_ARGS_IN_REGS(na) \
3597 switch (na) \
3599 case 0: break; \
3600 case 1: ___PUSH_R1_TO_R1 break; \
3601 default: ___PUSH_R1_TO_R2 \
3603 #define ___POP_ARGS_IN_REGS(na) \
3604 switch (na) \
3606 case 0: break; \
3607 case 1: ___POP_R1_TO_R1 break; \
3608 default: ___POP_R2_TO_R1 \
3610 #define ___PSSELF ___PSR3
3611 #define ___SELF ___R3
3612 #define ___LD_ARG_REGS ___LD_R1_TO_R2
3613 #define ___ST_ARG_REGS ___ST_R1_TO_R2
3614 #endif
3616 #if ___NB_GVM_REGS == 3
3618 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R2
3619 #define ___POP_REGS ___POP_R2_TO_R1 ___POP_R0
3621 #else
3623 #define ___PSR3 ___ps->r[3]
3624 #if ___MAX_LOCAL_GVM_REGS > 3
3625 #define ___D_R3 register ___WORD ___r3;
3626 #define ___R_R3 ___r3=___PSR3;
3627 #define ___W_R3 ___PSR3=___r3;
3628 #define ___R3 ___r3
3629 #else
3630 #define ___D_R3
3631 #define ___R_R3
3632 #define ___W_R3
3633 #define ___R3 ___PSR3
3634 #endif
3635 #define ___SET_R3(val)___R3=(val);
3636 #define ___PUSH_R1_TO_R3 ___PUSH_R1_TO_R2 ___PUSH(___R3)
3637 #define ___POP_R3_TO_R1 ___SET_R3(___POP)___POP_R2_TO_R1
3638 #define ___LD_R1_TO_R3 ___D_R3 ___LD_R1_TO_R2 ___R_R3
3639 #define ___ST_R1_TO_R3 ___ST_R1_TO_R2 ___W_R3
3641 #if ___NB_ARG_REGS == 3
3642 #define ___PUSH_ARGS_IN_REGS(na) \
3643 switch (na) \
3645 case 0: break; \
3646 case 1: ___PUSH_R1_TO_R1 break; \
3647 case 2: ___PUSH_R1_TO_R2 break; \
3648 default: ___PUSH_R1_TO_R3 \
3650 #define ___POP_ARGS_IN_REGS(na) \
3651 switch (na) \
3653 case 0: break; \
3654 case 1: ___POP_R1_TO_R1 break; \
3655 case 2: ___POP_R2_TO_R1 break; \
3656 default: ___POP_R3_TO_R1 \
3658 #define ___PSSELF ___PSR4
3659 #define ___SELF ___R4
3660 #define ___LD_ARG_REGS ___LD_R1_TO_R3
3661 #define ___ST_ARG_REGS ___ST_R1_TO_R3
3662 #endif
3664 #if ___NB_GVM_REGS == 4
3666 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R3
3667 #define ___POP_REGS ___POP_R3_TO_R1 ___POP_R0
3669 #else
3671 #define ___PSR4 ___ps->r[4]
3672 #if ___MAX_LOCAL_GVM_REGS > 4
3673 #define ___D_R4 register ___WORD ___r4;
3674 #define ___R_R4 ___r4=___PSR4;
3675 #define ___W_R4 ___PSR4=___r4;
3676 #define ___R4 ___r4
3677 #else
3678 #define ___D_R4
3679 #define ___R_R4
3680 #define ___W_R4
3681 #define ___R4 ___PSR4
3682 #endif
3683 #define ___SET_R4(val)___R4=(val);
3684 #define ___PUSH_R1_TO_R4 ___PUSH_R1_TO_R3 ___PUSH(___R4)
3685 #define ___POP_R4_TO_R1 ___SET_R4(___POP)___POP_R3_TO_R1
3686 #define ___LD_R1_TO_R4 ___D_R4 ___LD_R1_TO_R3 ___R_R4
3687 #define ___ST_R1_TO_R4 ___ST_R1_TO_R3 ___W_R4
3689 #if ___NB_ARG_REGS == 4
3690 #define ___PUSH_ARGS_IN_REGS(na) \
3691 switch (na) \
3693 case 0: break; \
3694 case 1: ___PUSH_R1_TO_R1 break; \
3695 case 2: ___PUSH_R1_TO_R2 break; \
3696 case 3: ___PUSH_R1_TO_R3 break; \
3697 default: ___PUSH_R1_TO_R4 \
3699 #define ___POP_ARGS_IN_REGS(na) \
3700 switch (na) \
3702 case 0: break; \
3703 case 1: ___POP_R1_TO_R1 break; \
3704 case 2: ___POP_R2_TO_R1 break; \
3705 case 3: ___POP_R3_TO_R1 break; \
3706 default: ___POP_R4_TO_R1 \
3708 #define ___PSSELF ___PSR5
3709 #define ___SELF ___R5
3710 #define ___LD_ARG_REGS ___LD_R1_TO_R4
3711 #define ___ST_ARG_REGS ___ST_R1_TO_R4
3712 #endif
3714 #if ___NB_GVM_REGS == 5
3716 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R4
3717 #define ___POP_REGS ___POP_R4_TO_R1 ___POP_R0
3719 #else
3721 #define ___PSR5 ___ps->r[5]
3722 #if ___MAX_LOCAL_GVM_REGS > 5
3723 #define ___D_R5 register ___WORD ___r5;
3724 #define ___R_R5 ___r5=___PSR5;
3725 #define ___W_R5 ___PSR5=___r5;
3726 #define ___R5 ___r5
3727 #else
3728 #define ___D_R5
3729 #define ___R_R5
3730 #define ___W_R5
3731 #define ___R5 ___PSR5
3732 #endif
3733 #define ___SET_R5(val)___R5=(val);
3734 #define ___PUSH_R1_TO_R5 ___PUSH_R1_TO_R4 ___PUSH(___R5)
3735 #define ___POP_R5_TO_R1 ___SET_R5(___POP)___POP_R4_TO_R1
3736 #define ___LD_R1_TO_R5 ___D_R5 ___LD_R1_TO_R4 ___R_R5
3737 #define ___ST_R1_TO_R5 ___ST_R1_TO_R4 ___W_R5
3739 #if ___NB_ARG_REGS == 5
3740 #define ___PUSH_ARGS_IN_REGS(na) \
3741 switch (na) \
3743 case 0: break; \
3744 case 1: ___PUSH_R1_TO_R1 break; \
3745 case 2: ___PUSH_R1_TO_R2 break; \
3746 case 3: ___PUSH_R1_TO_R3 break; \
3747 case 4: ___PUSH_R1_TO_R4 break; \
3748 default: ___PUSH_R1_TO_R5 \
3750 #define ___POP_ARGS_IN_REGS(na) \
3751 switch (na) \
3753 case 0: break; \
3754 case 1: ___POP_R1_TO_R1 break; \
3755 case 2: ___POP_R2_TO_R1 break; \
3756 case 3: ___POP_R3_TO_R1 break; \
3757 case 4: ___POP_R4_TO_R1 break; \
3758 default: ___POP_R5_TO_R1 \
3760 #define ___PSSELF ___PSR6
3761 #define ___SELF ___R6
3762 #define ___LD_ARG_REGS ___LD_R1_TO_R5
3763 #define ___ST_ARG_REGS ___ST_R1_TO_R5
3764 #endif
3766 #if ___NB_GVM_REGS == 6
3768 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R5
3769 #define ___POP_REGS ___POP_R5_TO_R1 ___POP_R0
3771 #else
3773 #define ___PSR6 ___ps->r[6]
3774 #if ___MAX_LOCAL_GVM_REGS > 6
3775 #define ___D_R6 register ___WORD ___r6;
3776 #define ___R_R6 ___r6=___PSR6;
3777 #define ___W_R6 ___PSR6=___r6;
3778 #define ___R6 ___r6
3779 #else
3780 #define ___D_R6
3781 #define ___R_R6
3782 #define ___W_R6
3783 #define ___R6 ___PSR6
3784 #endif
3785 #define ___SET_R6(val)___R6=(val);
3786 #define ___PUSH_R1_TO_R6 ___PUSH_R1_TO_R5 ___PUSH(___R6)
3787 #define ___POP_R6_TO_R1 ___SET_R6(___POP)___POP_R5_TO_R1
3788 #define ___LD_R1_TO_R6 ___D_R6 ___LD_R1_TO_R5 ___R_R6
3789 #define ___ST_R1_TO_R6 ___ST_R1_TO_R5 ___W_R6
3791 #if ___NB_ARG_REGS == 6
3792 #define ___PUSH_ARGS_IN_REGS(na) \
3793 switch (na) \
3795 case 0: break; \
3796 case 1: ___PUSH_R1_TO_R1 break; \
3797 case 2: ___PUSH_R1_TO_R2 break; \
3798 case 3: ___PUSH_R1_TO_R3 break; \
3799 case 4: ___PUSH_R1_TO_R4 break; \
3800 case 5: ___PUSH_R1_TO_R5 break; \
3801 default: ___PUSH_R1_TO_R6 \
3803 #define ___POP_ARGS_IN_REGS(na) \
3804 switch (na) \
3806 case 0: break; \
3807 case 1: ___POP_R1_TO_R1 break; \
3808 case 2: ___POP_R2_TO_R1 break; \
3809 case 3: ___POP_R3_TO_R1 break; \
3810 case 4: ___POP_R4_TO_R1 break; \
3811 case 5: ___POP_R5_TO_R1 break; \
3812 default: ___POP_R6_TO_R1 \
3814 #define ___PSSELF ___PSR7
3815 #define ___SELF ___R7
3816 #define ___LD_ARG_REGS ___LD_R1_TO_R6
3817 #define ___ST_ARG_REGS ___ST_R1_TO_R6
3818 #endif
3820 #if ___NB_GVM_REGS == 7
3822 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R6
3823 #define ___POP_REGS ___POP_R6_TO_R1 ___POP_R0
3825 #else
3827 #define ___PSR7 ___ps->r[7]
3828 #if ___MAX_LOCAL_GVM_REGS > 7
3829 #define ___D_R7 register ___WORD ___r7;
3830 #define ___R_R7 ___r7=___PSR7;
3831 #define ___W_R7 ___PSR7=___r7;
3832 #define ___R7 ___r7
3833 #else
3834 #define ___D_R7
3835 #define ___R_R7
3836 #define ___W_R7
3837 #define ___R7 ___PSR7
3838 #endif
3839 #define ___SET_R7(val)___R7=(val);
3840 #define ___PUSH_R1_TO_R7 ___PUSH_R1_TO_R6 ___PUSH(___R7)
3841 #define ___POP_R7_TO_R1 ___SET_R7(___POP)___POP_R6_TO_R1
3842 #define ___LD_R1_TO_R7 ___D_R7 ___LD_R1_TO_R6 ___R_R7
3843 #define ___ST_R1_TO_R7 ___ST_R1_TO_R6 ___W_R7
3845 #if ___NB_ARG_REGS == 7
3846 #define ___PUSH_ARGS_IN_REGS(na) \
3847 switch (na) \
3849 case 0: break; \
3850 case 1: ___PUSH_R1_TO_R1 break; \
3851 case 2: ___PUSH_R1_TO_R2 break; \
3852 case 3: ___PUSH_R1_TO_R3 break; \
3853 case 4: ___PUSH_R1_TO_R4 break; \
3854 case 5: ___PUSH_R1_TO_R5 break; \
3855 case 6: ___PUSH_R1_TO_R6 break; \
3856 default: ___PUSH_R1_TO_R7 \
3858 #define ___POP_ARGS_IN_REGS(na) \
3859 switch (na) \
3861 case 0: break; \
3862 case 1: ___POP_R1_TO_R1 break; \
3863 case 2: ___POP_R2_TO_R1 break; \
3864 case 3: ___POP_R3_TO_R1 break; \
3865 case 4: ___POP_R4_TO_R1 break; \
3866 case 5: ___POP_R5_TO_R1 break; \
3867 case 6: ___POP_R6_TO_R1 break; \
3868 default: ___POP_R7_TO_R1 \
3870 #define ___PSSELF ___PSR8
3871 #define ___SELF ___R8
3872 #define ___LD_ARG_REGS ___LD_R1_TO_R7
3873 #define ___ST_ARG_REGS ___ST_R1_TO_R7
3874 #endif
3876 #if ___NB_GVM_REGS == 8
3878 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R7
3879 #define ___POP_REGS ___POP_R7_TO_R1 ___POP_R0
3881 #else
3883 #define ___PSR8 ___ps->r[8]
3884 #if ___MAX_LOCAL_GVM_REGS > 8
3885 #define ___D_R8 register ___WORD ___r8;
3886 #define ___R_R8 ___r8=___PSR8;
3887 #define ___W_R8 ___PSR8=___r8;
3888 #define ___R8 ___r8
3889 #else
3890 #define ___D_R8
3891 #define ___R_R8
3892 #define ___W_R8
3893 #define ___R8 ___PSR8
3894 #endif
3895 #define ___SET_R8(val)___R8=(val);
3896 #define ___PUSH_R1_TO_R8 ___PUSH_R1_TO_R7 ___PUSH(___R8)
3897 #define ___POP_R8_TO_R1 ___SET_R8(___POP)___POP_R7_TO_R1
3898 #define ___LD_R1_TO_R8 ___D_R8 ___LD_R1_TO_R7 ___R_R8
3899 #define ___ST_R1_TO_R8 ___ST_R1_TO_R7 ___W_R8
3901 #if ___NB_ARG_REGS == 8
3902 #define ___PUSH_ARGS_IN_REGS(na) \
3903 switch (na) \
3905 case 0: break; \
3906 case 1: ___PUSH_R1_TO_R1 break; \
3907 case 2: ___PUSH_R1_TO_R2 break; \
3908 case 3: ___PUSH_R1_TO_R3 break; \
3909 case 4: ___PUSH_R1_TO_R4 break; \
3910 case 5: ___PUSH_R1_TO_R5 break; \
3911 case 6: ___PUSH_R1_TO_R6 break; \
3912 case 7: ___PUSH_R1_TO_R7 break; \
3913 default: ___PUSH_R1_TO_R8 \
3915 #define ___POP_ARGS_IN_REGS(na) \
3916 switch (na) \
3918 case 0: break; \
3919 case 1: ___POP_R1_TO_R1 break; \
3920 case 2: ___POP_R2_TO_R1 break; \
3921 case 3: ___POP_R3_TO_R1 break; \
3922 case 4: ___POP_R4_TO_R1 break; \
3923 case 5: ___POP_R5_TO_R1 break; \
3924 case 6: ___POP_R6_TO_R1 break; \
3925 case 7: ___POP_R7_TO_R1 break; \
3926 default: ___POP_R8_TO_R1 \
3928 #define ___PSSELF ___PSR9
3929 #define ___SELF ___R9
3930 #define ___LD_ARG_REGS ___LD_R1_TO_R8
3931 #define ___ST_ARG_REGS ___ST_R1_TO_R8
3932 #endif
3934 #if ___NB_GVM_REGS == 9
3936 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R8
3937 #define ___POP_REGS ___POP_R8_TO_R1 ___POP_R0
3939 #else
3941 #define ___PSR9 ___ps->r[9]
3942 #if ___MAX_LOCAL_GVM_REGS > 9
3943 #define ___D_R9 register ___WORD ___r9;
3944 #define ___R_R9 ___r9=___PSR9;
3945 #define ___W_R9 ___PSR9=___r9;
3946 #define ___R9 ___r9
3947 #else
3948 #define ___D_R9
3949 #define ___R_R9
3950 #define ___W_R9
3951 #define ___R9 ___PSR9
3952 #endif
3953 #define ___SET_R9(val)___R9=(val);
3954 #define ___PUSH_R1_TO_R9 ___PUSH_R1_TO_R8 ___PUSH(___R9)
3955 #define ___POP_R9_TO_R1 ___SET_R9(___POP)___POP_R8_TO_R1
3956 #define ___LD_R1_TO_R9 ___D_R9 ___LD_R1_TO_R8 ___R_R9
3957 #define ___ST_R1_TO_R9 ___ST_R1_TO_R8 ___W_R9
3959 #if ___NB_ARG_REGS == 9
3960 #define ___PUSH_ARGS_IN_REGS(na) \
3961 switch (na) \
3963 case 0: break; \
3964 case 1: ___PUSH_R1_TO_R1 break; \
3965 case 2: ___PUSH_R1_TO_R2 break; \
3966 case 3: ___PUSH_R1_TO_R3 break; \
3967 case 4: ___PUSH_R1_TO_R4 break; \
3968 case 5: ___PUSH_R1_TO_R5 break; \
3969 case 6: ___PUSH_R1_TO_R6 break; \
3970 case 7: ___PUSH_R1_TO_R7 break; \
3971 case 8: ___PUSH_R1_TO_R8 break; \
3972 default: ___PUSH_R1_TO_R9 \
3974 #define ___POP_ARGS_IN_REGS(na) \
3975 switch (na) \
3977 case 0: break; \
3978 case 1: ___POP_R1_TO_R1 break; \
3979 case 2: ___POP_R2_TO_R1 break; \
3980 case 3: ___POP_R3_TO_R1 break; \
3981 case 4: ___POP_R4_TO_R1 break; \
3982 case 5: ___POP_R5_TO_R1 break; \
3983 case 6: ___POP_R6_TO_R1 break; \
3984 case 7: ___POP_R7_TO_R1 break; \
3985 case 8: ___POP_R8_TO_R1 break; \
3986 default: ___POP_R9_TO_R1 \
3988 #define ___PSSELF ___PSR10
3989 #define ___SELF ___R10
3990 #define ___LD_ARG_REGS ___LD_R1_TO_R9
3991 #define ___ST_ARG_REGS ___ST_R1_TO_R9
3992 #endif
3994 #if ___NB_GVM_REGS == 10
3996 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R9
3997 #define ___POP_REGS ___POP_R9_TO_R1 ___POP_R0
3999 #else
4001 #define ___PSR10 ___ps->r[10]
4002 #if ___MAX_LOCAL_GVM_REGS > 10
4003 #define ___D_R10 register ___WORD ___r10;
4004 #define ___R_R10 ___r10=___PSR10;
4005 #define ___W_R10 ___PSR10=___r10;
4006 #define ___R10 ___r10
4007 #else
4008 #define ___D_R10
4009 #define ___R_R10
4010 #define ___W_R10
4011 #define ___R10 ___PSR10
4012 #endif
4013 #define ___SET_R10(val)___R10=(val);
4014 #define ___PUSH_R1_TO_R10 ___PUSH_R1_TO_R9 ___PUSH(___R10)
4015 #define ___POP_R10_TO_R1 ___SET_R10(___POP)___POP_R9_TO_R1
4016 #define ___LD_R1_TO_R10 ___D_R10 ___LD_R1_TO_R9 ___R_R10
4017 #define ___ST_R1_TO_R10 ___ST_R1_TO_R9 ___W_R10
4019 #if ___NB_ARG_REGS == 10
4020 #define ___PUSH_ARGS_IN_REGS(na) \
4021 switch (na) \
4023 case 0: break; \
4024 case 1: ___PUSH_R1_TO_R1 break; \
4025 case 2: ___PUSH_R1_TO_R2 break; \
4026 case 3: ___PUSH_R1_TO_R3 break; \
4027 case 4: ___PUSH_R1_TO_R4 break; \
4028 case 5: ___PUSH_R1_TO_R5 break; \
4029 case 6: ___PUSH_R1_TO_R6 break; \
4030 case 7: ___PUSH_R1_TO_R7 break; \
4031 case 8: ___PUSH_R1_TO_R8 break; \
4032 case 9: ___PUSH_R1_TO_R9 break; \
4033 default: ___PUSH_R1_TO_R10 \
4035 #define ___POP_ARGS_IN_REGS(na) \
4036 switch (na) \
4038 case 0: break; \
4039 case 1: ___POP_R1_TO_R1 break; \
4040 case 2: ___POP_R2_TO_R1 break; \
4041 case 3: ___POP_R3_TO_R1 break; \
4042 case 4: ___POP_R4_TO_R1 break; \
4043 case 5: ___POP_R5_TO_R1 break; \
4044 case 6: ___POP_R6_TO_R1 break; \
4045 case 7: ___POP_R7_TO_R1 break; \
4046 case 8: ___POP_R8_TO_R1 break; \
4047 case 9: ___POP_R9_TO_R1 break; \
4048 default: ___POP_R10_TO_R1 \
4050 #define ___PSSELF ___PSR11
4051 #define ___SELF ___R11
4052 #define ___LD_ARG_REGS ___LD_R1_TO_R10
4053 #define ___ST_ARG_REGS ___ST_R1_TO_R10
4054 #endif
4056 #if ___NB_GVM_REGS == 11
4058 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R10
4059 #define ___POP_REGS ___POP_R10_TO_R1 ___POP_R0
4061 #else
4063 #define ___PSR11 ___ps->r[11]
4064 #if ___MAX_LOCAL_GVM_REGS > 11
4065 #define ___D_R11 register ___WORD ___r11;
4066 #define ___R_R11 ___r11=___PSR11;
4067 #define ___W_R11 ___PSR11=___r11;
4068 #define ___R11 ___r11
4069 #else
4070 #define ___D_R11
4071 #define ___R_R11
4072 #define ___W_R11
4073 #define ___R11 ___PSR11
4074 #endif
4075 #define ___SET_R11(val)___R11=(val);
4076 #define ___PUSH_R1_TO_R11 ___PUSH_R1_TO_R10 ___PUSH(___R11)
4077 #define ___POP_R11_TO_R1 ___SET_R11(___POP)___POP_R10_TO_R1
4078 #define ___LD_R1_TO_R11 ___D_R11 ___LD_R1_TO_R10 ___R_R11
4079 #define ___ST_R1_TO_R11 ___ST_R1_TO_R10 ___W_R11
4081 #if ___NB_ARG_REGS == 11
4082 #define ___PUSH_ARGS_IN_REGS(na) \
4083 switch (na) \
4085 case 0: break; \
4086 case 1: ___PUSH_R1_TO_R1 break; \
4087 case 2: ___PUSH_R1_TO_R2 break; \
4088 case 3: ___PUSH_R1_TO_R3 break; \
4089 case 4: ___PUSH_R1_TO_R4 break; \
4090 case 5: ___PUSH_R1_TO_R5 break; \
4091 case 6: ___PUSH_R1_TO_R6 break; \
4092 case 7: ___PUSH_R1_TO_R7 break; \
4093 case 8: ___PUSH_R1_TO_R8 break; \
4094 case 9: ___PUSH_R1_TO_R9 break; \
4095 case 10: ___PUSH_R1_TO_R10 break; \
4096 default: ___PUSH_R1_TO_R11 \
4098 #define ___POP_ARGS_IN_REGS(na) \
4099 switch (na) \
4101 case 0: break; \
4102 case 1: ___POP_R1_TO_R1 break; \
4103 case 2: ___POP_R2_TO_R1 break; \
4104 case 3: ___POP_R3_TO_R1 break; \
4105 case 4: ___POP_R4_TO_R1 break; \
4106 case 5: ___POP_R5_TO_R1 break; \
4107 case 6: ___POP_R6_TO_R1 break; \
4108 case 7: ___POP_R7_TO_R1 break; \
4109 case 8: ___POP_R8_TO_R1 break; \
4110 case 9: ___POP_R9_TO_R1 break; \
4111 case 10: ___POP_R10_TO_R1 break; \
4112 default: ___POP_R11_TO_R1 \
4114 #define ___PSSELF ___PSR12
4115 #define ___SELF ___R12
4116 #define ___LD_ARG_REGS ___LD_R1_TO_R11
4117 #define ___ST_ARG_REGS ___ST_R1_TO_R11
4118 #endif
4120 #if ___NB_GVM_REGS == 12
4122 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R11
4123 #define ___POP_REGS ___POP_R11_TO_R1 ___POP_R0
4125 #else
4127 #define ___PSR12 ___ps->r[12]
4128 #if ___MAX_LOCAL_GVM_REGS > 12
4129 #define ___D_R12 register ___WORD ___r12;
4130 #define ___R_R12 ___r12=___PSR12;
4131 #define ___W_R12 ___PSR12=___r12;
4132 #define ___R12 ___r12
4133 #else
4134 #define ___D_R12
4135 #define ___R_R12
4136 #define ___W_R12
4137 #define ___R12 ___PSR12
4138 #endif
4139 #define ___SET_R12(val)___R12=(val);
4140 #define ___PUSH_R1_TO_R12 ___PUSH_R1_TO_R11 ___PUSH(___R12)
4141 #define ___POP_R12_TO_R1 ___SET_R12(___POP)___POP_R11_TO_R1
4142 #define ___LD_R1_TO_R12 ___D_R12 ___LD_R1_TO_R11 ___R_R12
4143 #define ___ST_R1_TO_R12 ___ST_R1_TO_R11 ___W_R12
4145 #if ___NB_ARG_REGS == 12
4146 #define ___PUSH_ARGS_IN_REGS(na) \
4147 switch (na) \
4149 case 0: break; \
4150 case 1: ___PUSH_R1_TO_R1 break; \
4151 case 2: ___PUSH_R1_TO_R2 break; \
4152 case 3: ___PUSH_R1_TO_R3 break; \
4153 case 4: ___PUSH_R1_TO_R4 break; \
4154 case 5: ___PUSH_R1_TO_R5 break; \
4155 case 6: ___PUSH_R1_TO_R6 break; \
4156 case 7: ___PUSH_R1_TO_R7 break; \
4157 case 8: ___PUSH_R1_TO_R8 break; \
4158 case 9: ___PUSH_R1_TO_R9 break; \
4159 case 10: ___PUSH_R1_TO_R10 break; \
4160 case 11: ___PUSH_R1_TO_R11 break; \
4161 default: ___PUSH_R1_TO_R12 \
4163 #define ___POP_ARGS_IN_REGS(na) \
4164 switch (na) \
4166 case 0: break; \
4167 case 1: ___POP_R1_TO_R1 break; \
4168 case 2: ___POP_R2_TO_R1 break; \
4169 case 3: ___POP_R3_TO_R1 break; \
4170 case 4: ___POP_R4_TO_R1 break; \
4171 case 5: ___POP_R5_TO_R1 break; \
4172 case 6: ___POP_R6_TO_R1 break; \
4173 case 7: ___POP_R7_TO_R1 break; \
4174 case 8: ___POP_R8_TO_R1 break; \
4175 case 9: ___POP_R9_TO_R1 break; \
4176 case 10: ___POP_R10_TO_R1 break; \
4177 case 11: ___POP_R11_TO_R1 break; \
4178 default: ___POP_R12_TO_R1 \
4180 #define ___PSSELF ___PSR13
4181 #define ___SELF ___R13
4182 #define ___LD_ARG_REGS ___LD_R1_TO_R12
4183 #define ___ST_ARG_REGS ___ST_R1_TO_R12
4184 #endif
4186 #if ___NB_GVM_REGS == 13
4188 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R12
4189 #define ___POP_REGS ___POP_R12_TO_R1 ___POP_R0
4191 #else
4193 #define ___PSR13 ___ps->r[13]
4194 #if ___MAX_LOCAL_GVM_REGS > 13
4195 #define ___D_R13 register ___WORD ___r13;
4196 #define ___R_R13 ___r13=___PSR13;
4197 #define ___W_R13 ___PSR13=___r13;
4198 #define ___R13 ___r13
4199 #else
4200 #define ___D_R13
4201 #define ___R_R13
4202 #define ___W_R13
4203 #define ___R13 ___PSR13
4204 #endif
4205 #define ___SET_R13(val)___R13=(val);
4206 #define ___PUSH_R1_TO_R13 ___PUSH_R1_TO_R12 ___PUSH(___R13)
4207 #define ___POP_R13_TO_R1 ___SET_R13(___POP)___POP_R12_TO_R1
4208 #define ___LD_R1_TO_R13 ___D_R13 ___LD_R1_TO_R12 ___R_R13
4209 #define ___ST_R1_TO_R13 ___ST_R1_TO_R12 ___W_R13
4211 #if ___NB_GVM_REGS == 14
4213 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R13
4214 #define ___POP_REGS ___POP_R13_TO_R1 ___POP_R0
4216 #else
4218 #define ___PSR14 ___ps->r[14]
4219 #if ___MAX_LOCAL_GVM_REGS > 14
4220 #define ___D_R14 register ___WORD ___r14;
4221 #define ___R_R14 ___r14=___PSR14;
4222 #define ___W_R14 ___PSR14=___r14;
4223 #define ___R14 ___r14
4224 #else
4225 #define ___D_R14
4226 #define ___R_R14
4227 #define ___W_R14
4228 #define ___R14 ___PSR14
4229 #endif
4230 #define ___SET_R14(val)___R14=(val);
4231 #define ___PUSH_R1_TO_R14 ___PUSH_R1_TO_R13 ___PUSH(___R14)
4232 #define ___POP_R14_TO_R1 ___SET_R14(___POP)___POP_R13_TO_R1
4233 #define ___LD_R1_TO_R14 ___D_R14 ___LD_R1_TO_R13 ___R_R14
4234 #define ___ST_R1_TO_R14 ___ST_R1_TO_R13 ___W_R14
4236 #if ___NB_GVM_REGS == 15
4238 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R14
4239 #define ___POP_REGS ___POP_R14_TO_R1 ___POP_R0
4241 #else
4243 #define ___PSR15 ___ps->r[15]
4244 #if ___MAX_LOCAL_GVM_REGS > 15
4245 #define ___D_R15 register ___WORD ___r15;
4246 #define ___R_R15 ___r15=___PSR15;
4247 #define ___W_R15 ___PSR15=___r15;
4248 #define ___R15 ___r15
4249 #else
4250 #define ___D_R15
4251 #define ___R_R15
4252 #define ___W_R15
4253 #define ___R15 ___PSR15
4254 #endif
4255 #define ___SET_R15(val)___R15=(val);
4256 #define ___PUSH_R1_TO_R15 ___PUSH_R1_TO_R14 ___PUSH(___R15)
4257 #define ___POP_R15_TO_R1 ___SET_R15(___POP)___POP_R14_TO_R1
4258 #define ___LD_R1_TO_R15 ___D_R15 ___LD_R1_TO_R14 ___R_R15
4259 #define ___ST_R1_TO_R15 ___ST_R1_TO_R14 ___W_R15
4261 #if ___NB_GVM_REGS == 16
4263 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R15
4264 #define ___POP_REGS ___POP_R15_TO_R1 ___POP_R0
4266 #else
4268 #define ___PSR16 ___ps->r[16]
4269 #if ___MAX_LOCAL_GVM_REGS > 16
4270 #define ___D_R16 register ___WORD ___r16;
4271 #define ___R_R16 ___r16=___PSR16;
4272 #define ___W_R16 ___PSR16=___r16;
4273 #define ___R16 ___r16
4274 #else
4275 #define ___D_R16
4276 #define ___R_R16
4277 #define ___W_R16
4278 #define ___R16 ___PSR16
4279 #endif
4280 #define ___SET_R16(val)___R16=(val);
4281 #define ___PUSH_R1_TO_R16 ___PUSH_R1_TO_R15 ___PUSH(___R16)
4282 #define ___POP_R16_TO_R1 ___SET_R16(___POP)___POP_R15_TO_R1
4283 #define ___LD_R1_TO_R16 ___D_R16 ___LD_R1_TO_R15 ___R_R16
4284 #define ___ST_R1_TO_R16 ___ST_R1_TO_R15 ___W_R16
4286 #if ___NB_GVM_REGS == 17
4288 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R16
4289 #define ___POP_REGS ___POP_R16_TO_R1 ___POP_R0
4291 #else
4293 #define ___PSR17 ___ps->r[17]
4294 #if ___MAX_LOCAL_GVM_REGS > 17
4295 #define ___D_R17 register ___WORD ___r17;
4296 #define ___R_R17 ___r17=___PSR17;
4297 #define ___W_R17 ___PSR17=___r17;
4298 #define ___R17 ___r17
4299 #else
4300 #define ___D_R17
4301 #define ___R_R17
4302 #define ___W_R17
4303 #define ___R17 ___PSR17
4304 #endif
4305 #define ___SET_R17(val)___R17=(val);
4306 #define ___PUSH_R1_TO_R17 ___PUSH_R1_TO_R16 ___PUSH(___R17)
4307 #define ___POP_R17_TO_R1 ___SET_R17(___POP)___POP_R16_TO_R1
4308 #define ___LD_R1_TO_R17 ___D_R17 ___LD_R1_TO_R16 ___R_R17
4309 #define ___ST_R1_TO_R17 ___ST_R1_TO_R16 ___W_R17
4311 #if ___NB_GVM_REGS == 18
4313 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R17
4314 #define ___POP_REGS ___POP_R17_TO_R1 ___POP_R0
4316 #else
4318 #define ___PSR18 ___ps->r[18]
4319 #if ___MAX_LOCAL_GVM_REGS > 18
4320 #define ___D_R18 register ___WORD ___r18;
4321 #define ___R_R18 ___r18=___PSR18;
4322 #define ___W_R18 ___PSR18=___r18;
4323 #define ___R18 ___r18
4324 #else
4325 #define ___D_R18
4326 #define ___R_R18
4327 #define ___W_R18
4328 #define ___R18 ___PSR18
4329 #endif
4330 #define ___SET_R18(val)___R18=(val);
4331 #define ___PUSH_R1_TO_R18 ___PUSH_R1_TO_R17 ___PUSH(___R18)
4332 #define ___POP_R18_TO_R1 ___SET_R18(___POP)___POP_R17_TO_R1
4333 #define ___LD_R1_TO_R18 ___D_R18 ___LD_R1_TO_R17 ___R_R18
4334 #define ___ST_R1_TO_R18 ___ST_R1_TO_R17 ___W_R18
4336 #if ___NB_GVM_REGS == 19
4338 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R18
4339 #define ___POP_REGS ___POP_R18_TO_R1 ___POP_R0
4341 #else
4343 #define ___PSR19 ___ps->r[19]
4344 #if ___MAX_LOCAL_GVM_REGS > 19
4345 #define ___D_R19 register ___WORD ___r19;
4346 #define ___R_R19 ___r19=___PSR19;
4347 #define ___W_R19 ___PSR19=___r19;
4348 #define ___R19 ___r19
4349 #else
4350 #define ___D_R19
4351 #define ___R_R19
4352 #define ___W_R19
4353 #define ___R19 ___PSR19
4354 #endif
4355 #define ___SET_R19(val)___R19=(val);
4356 #define ___PUSH_R1_TO_R19 ___PUSH_R1_TO_R18 ___PUSH(___R19)
4357 #define ___POP_R19_TO_R1 ___SET_R19(___POP)___POP_R18_TO_R1
4358 #define ___LD_R1_TO_R19 ___D_R19 ___LD_R1_TO_R18 ___R_R19
4359 #define ___ST_R1_TO_R19 ___ST_R1_TO_R18 ___W_R19
4361 #if ___NB_GVM_REGS == 20
4363 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R19
4364 #define ___POP_REGS ___POP_R19_TO_R1 ___POP_R0
4366 #else
4368 #define ___PSR20 ___ps->r[20]
4369 #if ___MAX_LOCAL_GVM_REGS > 20
4370 #define ___D_R20 register ___WORD ___r20;
4371 #define ___R_R20 ___r20=___PSR20;
4372 #define ___W_R20 ___PSR20=___r20;
4373 #define ___R20 ___r20
4374 #else
4375 #define ___D_R20
4376 #define ___R_R20
4377 #define ___W_R20
4378 #define ___R20 ___PSR20
4379 #endif
4380 #define ___SET_R20(val)___R20=(val);
4381 #define ___PUSH_R1_TO_R20 ___PUSH_R1_TO_R19 ___PUSH(___R20)
4382 #define ___POP_R20_TO_R1 ___SET_R20(___POP)___POP_R19_TO_R1
4383 #define ___LD_R1_TO_R20 ___D_R20 ___LD_R1_TO_R19 ___R_R20
4384 #define ___ST_R1_TO_R20 ___ST_R1_TO_R19 ___W_R20
4386 #if ___NB_GVM_REGS == 21
4388 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R20
4389 #define ___POP_REGS ___POP_R20_TO_R1 ___POP_R0
4391 #else
4393 #define ___PSR21 ___ps->r[21]
4394 #if ___MAX_LOCAL_GVM_REGS > 21
4395 #define ___D_R21 register ___WORD ___r21;
4396 #define ___R_R21 ___r21=___PSR21;
4397 #define ___W_R21 ___PSR21=___r21;
4398 #define ___R21 ___r21
4399 #else
4400 #define ___D_R21
4401 #define ___R_R21
4402 #define ___W_R21
4403 #define ___R21 ___PSR21
4404 #endif
4405 #define ___SET_R21(val)___R21=(val);
4406 #define ___PUSH_R1_TO_R21 ___PUSH_R1_TO_R20 ___PUSH(___R21)
4407 #define ___POP_R21_TO_R1 ___SET_R21(___POP)___POP_R20_TO_R1
4408 #define ___LD_R1_TO_R21 ___D_R21 ___LD_R1_TO_R20 ___R_R21
4409 #define ___ST_R1_TO_R21 ___ST_R1_TO_R20 ___W_R21
4411 #if ___NB_GVM_REGS == 22
4413 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R21
4414 #define ___POP_REGS ___POP_R21_TO_R1 ___POP_R0
4416 #else
4418 #define ___PSR22 ___ps->r[22]
4419 #if ___MAX_LOCAL_GVM_REGS > 22
4420 #define ___D_R22 register ___WORD ___r22;
4421 #define ___R_R22 ___r22=___PSR22;
4422 #define ___W_R22 ___PSR22=___r22;
4423 #define ___R22 ___r22
4424 #else
4425 #define ___D_R22
4426 #define ___R_R22
4427 #define ___W_R22
4428 #define ___R22 ___PSR22
4429 #endif
4430 #define ___SET_R22(val)___R22=(val);
4431 #define ___PUSH_R1_TO_R22 ___PUSH_R1_TO_R21 ___PUSH(___R22)
4432 #define ___POP_R22_TO_R1 ___SET_R22(___POP)___POP_R21_TO_R1
4433 #define ___LD_R1_TO_R22 ___D_R22 ___LD_R1_TO_R21 ___R_R22
4434 #define ___ST_R1_TO_R22 ___ST_R1_TO_R21 ___W_R22
4436 #if ___NB_GVM_REGS == 23
4438 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R22
4439 #define ___POP_REGS ___POP_R22_TO_R1 ___POP_R0
4441 #else
4443 #define ___PSR23 ___ps->r[23]
4444 #if ___MAX_LOCAL_GVM_REGS > 23
4445 #define ___D_R23 register ___WORD ___r23;
4446 #define ___R_R23 ___r23=___PSR23;
4447 #define ___W_R23 ___PSR23=___r23;
4448 #define ___R23 ___r23
4449 #else
4450 #define ___D_R23
4451 #define ___R_R23
4452 #define ___W_R23
4453 #define ___R23 ___PSR23
4454 #endif
4455 #define ___SET_R23(val)___R23=(val);
4456 #define ___PUSH_R1_TO_R23 ___PUSH_R1_TO_R22 ___PUSH(___R23)
4457 #define ___POP_R23_TO_R1 ___SET_R23(___POP)___POP_R22_TO_R1
4458 #define ___LD_R1_TO_R23 ___D_R23 ___LD_R1_TO_R22 ___R_R23
4459 #define ___ST_R1_TO_R23 ___ST_R1_TO_R22 ___W_R23
4461 #if ___NB_GVM_REGS == 24
4463 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R23
4464 #define ___POP_REGS ___POP_R23_TO_R1 ___POP_R0
4466 #else
4468 #define ___PSR24 ___ps->r[24]
4469 #if ___MAX_LOCAL_GVM_REGS > 24
4470 #define ___D_R24 register ___WORD ___r24;
4471 #define ___R_R24 ___r24=___PSR24;
4472 #define ___W_R24 ___PSR24=___r24;
4473 #define ___R24 ___r24
4474 #else
4475 #define ___D_R24
4476 #define ___R_R24
4477 #define ___W_R24
4478 #define ___R24 ___PSR24
4479 #endif
4480 #define ___SET_R24(val)___R24=(val);
4481 #define ___PUSH_R1_TO_R24 ___PUSH_R1_TO_R23 ___PUSH(___R24)
4482 #define ___POP_R24_TO_R1 ___SET_R24(___POP)___POP_R23_TO_R1
4483 #define ___LD_R1_TO_R24 ___D_R24 ___LD_R1_TO_R23 ___R_R24
4484 #define ___ST_R1_TO_R24 ___ST_R1_TO_R23 ___W_R24
4486 #if ___NB_GVM_REGS == 25
4488 #define ___PUSH_REGS ___PUSH_R0 ___PUSH_R1_TO_R24
4489 #define ___POP_REGS ___POP_R24_TO_R1 ___POP_R0
4491 #endif
4492 #endif
4493 #endif
4494 #endif
4495 #endif
4496 #endif
4497 #endif
4498 #endif
4499 #endif
4500 #endif
4501 #endif
4502 #endif
4503 #endif
4504 #endif
4505 #endif
4506 #endif
4507 #endif
4508 #endif
4509 #endif
4510 #endif
4511 #endif
4512 #endif
4513 #endif
4514 #endif
4516 /*---------------------------------------------------------------------------*/
4518 /* Labels and switches */
4520 #define ___NOT(x)!x
4521 #define ___AND(x,y)(x&&y)
4523 #define ___MLBL(n)___lp+((n)*___LS*___WS)
4524 #define ___LBL(n)___start+((___PH_LBL0-___HOST_LBL0+n)*___LS*___WS)
4525 #define ___DEF_SLBL(n,lbl)___DEF_SW(n)___DEF_GLBL(lbl)
4526 #define ___DEF_GLBL(lbl)lbl:
4527 #define ___GOTO(lbl)goto lbl;
4528 #define ___IF_GOTO(test,lbl)if (test) ___GOTO(lbl)
4529 #define ___JUMPINT(nargs,prc,lbl)___SM(___GOTO(lbl),{nargs ___JUMP(prc)})
4530 #define ___JUMPEXTPRM(nargs,val){nargs ___JUMPEXT(val)}
4531 #define ___JUMPEXTNOTSAFE(nargs,val) \
4532 {nargs ___SELF=val; \
4533 ___JUMPEXT(((___label_struct*)(___SELF-___tSUBTYPED))->entry_or_descr)}
4534 #define ___JUMPPRM(nargs,val){nargs ___JUMP(val)}
4536 #define ___JUMPNOTSAFE(nargs,val) \
4537 {nargs ___SELF=val; \
4538 ___JUMP(((___label_struct*)(___SELF-___tSUBTYPED))->entry_or_descr)}
4540 #define ___JUMPSAFE(nargs,val) ___JUMPNOTSAFE(nargs,val) /***************/
4542 #define ___JUMPGENNOTSAFE(nargs,val)___JUMPNOTSAFE(nargs,val)
4543 #define ___JUMPGLONOTSAFE(nargs,i,glo)___JUMPNOTSAFE(nargs,___GLO(i,glo))
4544 #define ___JUMPGENSAFE(nargs,val) \
4545 {nargs ___SELF=val; \
4546 if (___EXPECT_TRUE(___PROCEDUREP(___SELF))) \
4547 ___JUMP(((___label_struct*)(___SELF-___tSUBTYPED))->entry_or_descr) \
4548 ___ps->temp1=___SELF;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_not_proc)}
4549 #define ___JUMPGLOSAFE(nargs,i,glo) \
4550 {nargs ___SELF=___GLO(i,glo); \
4551 if (___EXPECT_TRUE(___PROCEDUREP(___SELF))) \
4552 ___JUMP(((___label_struct*)(___SELF-___tSUBTYPED))->entry_or_descr) \
4553 ___ps->temp4=(___WORD)&___GLOSTRUCT(i,glo);___JUMPEXTPRM(___NOTHING,___GSTATE->handler_not_proc_glo)}
4555 #ifdef ___NOT_SAFE_CALLS
4556 #undef ___JUMPGENSAFE
4557 #undef ___JUMPGLOSAFE
4558 #define ___JUMPGENSAFE(nargs,val)___JUMPGENNOTSAFE(nargs,val)
4559 #define ___JUMPGLOSAFE(nargs,i,glo)___JUMPGLONOTSAFE(nargs,i,glo)
4560 #endif
4562 #ifdef ___SAFE_CALLS
4563 #undef ___JUMPGENNOTSAFE
4564 #undef ___JUMPGLONOTSAFE
4565 #define ___JUMPGENNOTSAFE(nargs,val)___JUMPGENSAFE(nargs,val)
4566 #define ___JUMPGLONOTSAFE(nargs,i,glo)___JUMPGLOSAFE(nargs,i,glo)
4567 #endif
4569 #define ___BEGIN_SWITCH(x) switch (x) {
4570 #define ___SWITCH_CASE_GOTO(obj,lbl) case (obj): ___GOTO(lbl)
4571 #define ___END_SWITCH }
4573 #define ___BEGIN_SWITCH_FIXNUM(x) { ___SCMOBJ ___sw = (x); \
4574 if (___EXPECT_TRUE(___FIXNUMP(___sw))) switch(___INT(___sw)) {
4575 #define ___SWITCH_FIXNUM_CASE_GOTO(obj,lbl) case (___INT(obj)): ___GOTO(lbl)
4576 #define ___END_SWITCH_FIXNUM }}
4578 #define ___BEGIN_SWITCH_CHAR(x) { ___SCMOBJ ___sw = (x); \
4579 if (___EXPECT_TRUE(___CHARP(___sw))) switch(___INT(___sw)) {
4580 #define ___SWITCH_CHAR_CASE_GOTO(obj,lbl) case (___INT(obj)): ___GOTO(lbl)
4581 #define ___END_SWITCH_CHAR }}
4583 #define ___BEGIN_SWITCH_SYMKEY(x,mod,guard) { ___SCMOBJ ___sw = (x); \
4584 if (___EXPECT_TRUE(guard(___sw))) switch(___INT(___FIELD(___sw,___SYMKEY_HASH)) & ((mod)-1)) {
4585 #define ___SWITCH_SYMKEY_CASE(hash) case (hash):
4586 #define ___SWITCH_SYMKEY_CASE_GOTO(obj,lbl) ___IF_GOTO(___EQP(___sw,obj),lbl)
4587 #define ___END_SWITCH_SYMKEY }}
4589 /*---------------------------------------------------------------------------*/
4591 #define ___PRC(i)___start+((i-___HOST_LBL0)*___LS*___WS)
4593 #define ___SET_NARGS(n)___ps->na=n;
4595 #define ___IF_NARGS_EQ(n,code)if (___EXPECT_TRUE(___ps->na==n)) {code} else
4597 #define ___WRONG_NARGS(lbl,nb_req,nb_opt,nb_key) \
4598 {___ps->temp1=___LBL(lbl); \
4599 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_wrong_nargs)}
4601 #define ___GET_REST(lbl,nb_req,nb_opt,nb_key) \
4602 if (___ps->na>=0){___ps->temp1=___LBL(lbl); \
4603 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_rest)}
4605 #define ___GET_KEY(lbl,nb_req,nb_opt,nb_key,key_descr) \
4606 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4607 ___ps->temp3=key_descr;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key)}
4609 #define ___GET_REST_KEY(lbl,nb_req,nb_opt,nb_key,key_descr) \
4610 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4611 ___ps->temp3=key_descr;___ps->temp4=1; \
4612 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key_rest)}
4614 #define ___GET_KEY_REST(lbl,nb_req,nb_opt,nb_key,key_descr) \
4615 if (___ps->na>=0){___ps->temp1=___LBL(lbl);___ps->temp2=nb_req+nb_opt; \
4616 ___ps->temp3=key_descr;___ps->temp4=0; \
4617 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_get_key_rest)}
4619 #define ___BOOLEAN(x)(x)?___TRU:___FAL
4620 #define ___EXPR(x)x;
4622 #define ___ALLOC_CLO(n)(___ALLOC(n+2),___TAG((___hp-n-2),___tSUBTYPED))
4623 #define ___BEGIN_SETUP_CLO(n,clo,lbl) \
4624 {___WORD *___ptr=___UNTAG_AS(clo,___tSUBTYPED); \
4625 ___ptr[0]=___MAKE_HD_WORDS((n+1),___sPROCEDURE); ___ptr[1]=___LBL(lbl);
4626 #define ___ADD_CLO_ELEM(i,val)___ptr[i+2]=(val);
4627 #define ___END_SETUP_CLO(n) }
4628 #define ___CLO(x,y)___BODY_AS(x,___tSUBTYPED)[y]
4629 #define ___SET_CLO(x,y,z)___BODY_AS(x,___tSUBTYPED)[y]=z;
4631 #define ___BEGIN_ALLOC_LIST(n,last)___ALLOC_PAIR(last,___NUL)
4632 #define ___ADD_LIST_ELEM(i,val)___ALLOC_PAIR(val,___TAG((___hp-___PAIR_SIZE-1),___tPAIR))
4633 #define ___END_ALLOC_LIST(n)
4634 #define ___GET_LIST(n) ___TAG((___hp-___PAIR_SIZE-1),___tPAIR)
4636 #define ___BEGIN_ALLOC_STRING(n) \
4637 ___hp[0]=___MAKE_HD_BYTES(n<<___LCS,___sSTRING);
4638 #define ___ADD_STRING_ELEM(i,val)___CS_SELECT( \
4639 ___STORE_U8(___hp+1,i,___INT(val)), \
4640 ___STORE_U16(___hp+1,i,___INT(val)), \
4641 ___STORE_U32(___hp+1,i,___INT(val)));
4642 #define ___END_ALLOC_STRING(n)___ALLOC(___WORDS(n<<___LCS)+1);
4643 #define ___GET_STRING(n)___TAG((___hp-___WORDS(n<<___LCS)-1),___tSUBTYPED)
4645 #define ___BEGIN_ALLOC_S8VECTOR(n) \
4646 ___hp[0]=___MAKE_HD_BYTES(n,___sS8VECTOR);
4647 #define ___ADD_S8VECTOR_ELEM(i,val)___STORE_S8(___hp+1,i,___INT(val));
4648 #define ___END_ALLOC_S8VECTOR(n)___ALLOC(___WORDS(n)+1);
4649 #define ___GET_S8VECTOR(n)___TAG((___hp-___WORDS(n)-1),___tSUBTYPED)
4651 #define ___BEGIN_ALLOC_U8VECTOR(n) \
4652 ___hp[0]=___MAKE_HD_BYTES(n,___sU8VECTOR);
4653 #define ___ADD_U8VECTOR_ELEM(i,val)___STORE_U8(___hp+1,i,___INT(val));
4654 #define ___END_ALLOC_U8VECTOR(n)___ALLOC(___WORDS(n)+1);
4655 #define ___GET_U8VECTOR(n)___TAG((___hp-___WORDS(n)-1),___tSUBTYPED)
4657 #define ___BEGIN_ALLOC_S16VECTOR(n) \
4658 ___hp[0]=___MAKE_HD_BYTES(n<<1,___sS16VECTOR);
4659 #define ___ADD_S16VECTOR_ELEM(i,val)___STORE_S16(___hp+1,i,___INT(val));
4660 #define ___END_ALLOC_S16VECTOR(n)___ALLOC(___WORDS(n<<1)+1);
4661 #define ___GET_S16VECTOR(n)___TAG((___hp-___WORDS(n<<1)-1),___tSUBTYPED)
4663 #define ___BEGIN_ALLOC_U16VECTOR(n) \
4664 ___hp[0]=___MAKE_HD_BYTES(n<<1,___sU16VECTOR);
4665 #define ___ADD_U16VECTOR_ELEM(i,val)___STORE_U16(___hp+1,i,___INT(val));
4666 #define ___END_ALLOC_U16VECTOR(n)___ALLOC(___WORDS(n<<1)+1);
4667 #define ___GET_U16VECTOR(n)___TAG((___hp-___WORDS(n<<1)-1),___tSUBTYPED)
4669 #define ___BEGIN_ALLOC_S32VECTOR(n) \
4670 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sS32VECTOR);
4671 #define ___ADD_S32VECTOR_ELEM(i,val)___STORE_S32(___hp+1,i,___S32UNBOX(val));
4672 #define ___END_ALLOC_S32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4673 #define ___GET_S32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4675 #define ___BEGIN_ALLOC_U32VECTOR(n) \
4676 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sU32VECTOR);
4677 #define ___ADD_U32VECTOR_ELEM(i,val)___STORE_U32(___hp+1,i,___U32UNBOX(val));
4678 #define ___END_ALLOC_U32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4679 #define ___GET_U32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4681 #if ___SCMOBJ_WIDTH == 32
4683 #define ___BEGIN_ALLOC_S64VECTOR(n) \
4684 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4685 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sS64VECTOR);
4686 #define ___ADD_S64VECTOR_ELEM(i,val)___STORE_S64(___ptr,i,___S64UNBOX(val));
4687 #define ___END_ALLOC_S64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4688 #define ___GET_S64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4690 #define ___BEGIN_ALLOC_U64VECTOR(n) \
4691 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4692 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sU64VECTOR);
4693 #define ___ADD_U64VECTOR_ELEM(i,val)___STORE_U64(___ptr,i,___U64UNBOX(val));
4694 #define ___END_ALLOC_U64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4695 #define ___GET_U64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4697 #else
4699 #define ___BEGIN_ALLOC_S64VECTOR(n) \
4700 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sS64VECTOR);
4701 #define ___ADD_S64VECTOR_ELEM(i,val)___STORE_S64(___hp+1,i,___S64UNBOX(val));
4702 #define ___END_ALLOC_S64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4703 #define ___GET_S64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4705 #define ___BEGIN_ALLOC_U64VECTOR(n) \
4706 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sU64VECTOR);
4707 #define ___ADD_U64VECTOR_ELEM(i,val)___STORE_U64(___hp+1,i,___U64UNBOX(val));
4708 #define ___END_ALLOC_U64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4709 #define ___GET_U64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4711 #endif
4713 #define ___BEGIN_ALLOC_F32VECTOR(n) \
4714 ___hp[0]=___MAKE_HD_BYTES(n<<2,___sF32VECTOR);
4715 #ifdef ___F32
4716 #define ___ADD_F32VECTOR_ELEM(i,val)((___F32*)(___hp+1))[i]=(val);
4717 #else
4718 #define ___ADD_F32VECTOR_ELEM(i,val);
4719 #endif
4720 #define ___END_ALLOC_F32VECTOR(n)___ALLOC(___WORDS(n<<2)+1);
4721 #define ___GET_F32VECTOR(n)___TAG((___hp-___WORDS(n<<2)-1),___tSUBTYPED)
4723 #if ___SCMOBJ_WIDTH == 32
4725 #define ___BEGIN_ALLOC_F64VECTOR(n) \
4726 {___WORD *___ptr = (___WORD*)((___WORD)(___hp+2)&~7); \
4727 ___ptr[-1]=___MAKE_HD_BYTES(n<<3,___sF64VECTOR);
4728 #define ___ADD_F64VECTOR_ELEM(i,val)((___F64*)___ptr)[i]=(val);
4729 #define ___END_ALLOC_F64VECTOR(n)___ALLOC(___WORDS(n<<3)+2);}
4730 #define ___GET_F64VECTOR(n)___TAG((((___WORD*)((___WORD)(___hp-___WORDS(n<<3))&~7))-1),___tSUBTYPED)
4732 #else
4734 #define ___BEGIN_ALLOC_F64VECTOR(n) \
4735 ___hp[0]=___MAKE_HD_BYTES(n<<3,___sF64VECTOR);
4736 #define ___ADD_F64VECTOR_ELEM(i,val)((___F64*)(___hp+1))[i]=(val);
4737 #define ___END_ALLOC_F64VECTOR(n)___ALLOC(___WORDS(n<<3)+1);
4738 #define ___GET_F64VECTOR(n)___TAG((___hp-___WORDS(n<<3)-1),___tSUBTYPED)
4740 #endif
4742 #define ___BEGIN_ALLOC_VECTOR(n)___hp[0]=___MAKE_HD_WORDS(n,___sVECTOR);
4743 #define ___ADD_VECTOR_ELEM(i,val)___hp[i+1]=(val);
4744 #define ___END_ALLOC_VECTOR(n)___ALLOC(n+1);
4745 #define ___GET_VECTOR(n)___TAG((___hp-n-1),___tSUBTYPED)
4747 #define ___BEGIN_ALLOC_STRUCTURE(n)___hp[0]=___MAKE_HD_WORDS(n,___sSTRUCTURE);
4748 #define ___ADD_STRUCTURE_ELEM(i,val)___hp[i+1]=(val);
4749 #define ___END_ALLOC_STRUCTURE(n)___ALLOC(n+1);
4750 #define ___GET_STRUCTURE(n)___TAG((___hp-n-1),___tSUBTYPED)
4752 #define ___BEGIN_ALLOC_VALUES(n)___hp[0]=___MAKE_HD_WORDS(n,___sBOXVALUES);
4753 #define ___ADD_VALUES_ELEM(i,val)___hp[i+1]=(val);
4754 #define ___END_ALLOC_VALUES(n)___ALLOC(n+1);
4755 #define ___GET_VALUES(n)___TAG((___hp-n-1),___tSUBTYPED)
4757 #ifdef ___DEBUG_STACK_LIMIT
4758 #define ___POLL(n) \
4759 if (___EXPECT_FALSE(___fp<___ps->stack_trip)) \
4760 {___ps->temp1=___LBL(n); \
4761 ___ps->poll_file=__FILE__; \
4762 ___ps->poll_line=__LINE__; \
4763 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_stack_limit) \
4765 #else
4766 #define ___POLL(n) \
4767 if (___EXPECT_FALSE(___fp<___ps->stack_trip)) \
4768 {___ps->temp1=___LBL(n); \
4769 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_stack_limit) \
4771 #endif
4773 #define ___TASK_PUSH(i)
4774 #define ___TASK_POP(n)
4776 #ifdef ___DEBUG_HEAP_LIMIT
4777 #define ___CHECK_HEAP(n,m) \
4778 if (___EXPECT_FALSE(___hp>___ps->heap_limit)) \
4779 {___ps->temp1=___LBL(n); \
4780 ___ps->check_heap_file=__FILE__; \
4781 ___ps->check_heap_line=__LINE__; \
4782 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_heap_limit) \
4784 #else
4785 #define ___CHECK_HEAP(n,m) \
4786 if (___EXPECT_FALSE(___hp>___ps->heap_limit)) \
4787 {___ps->temp1=___LBL(n); \
4788 ___JUMPEXTPRM(___NOTHING,___GSTATE->handler_heap_limit) \
4790 #endif
4792 #define ___FORCE1(n,src) \
4793 if (___TYP((___temp=(src)))==___tSUBTYPED&&___SUBTYPE(___temp)==___sPROMISE<<___TB){___ps->temp1=___LBL(n);___ps->temp2=___temp;___JUMPEXTPRM(___NOTHING,___GSTATE->handler_force);
4794 #define ___FORCE2 ___temp=___ps->temp2;}
4795 #define ___FORCE3 ___temp
4797 #define ___NB_INTRS 8
4798 #define ___INTR_USER 0
4799 #define ___INTR_HEARTBEAT 1
4800 #define ___INTR_GC 2
4801 #define ___INTR_TERMINATE 3
4802 #define ___INTR_4 4
4803 #define ___INTR_5 5
4804 #define ___INTR_6 6
4805 #define ___INTR_7 7
4807 #define ___MODULE_KIND 0
4808 #define ___LINKFILE_KIND 1
4810 #define ___CLIBEXT(f)f
4811 #define ___SETJMP(jmpbuf)setjmp (jmpbuf)
4812 #define ___LONGJMP(jmpbuf,val)longjmp (jmpbuf,val)
4813 #define ___EXT(f)f
4815 #ifdef ___BIND_LATE
4817 #ifndef ___CAN_IMPORT_CLIB_DYNAMICALLY
4818 #undef ___CLIBEXT
4819 #define ___CLIBEXT(f)(___GSTATE->f)
4820 #undef ___LOCAL_GSTATE
4821 #define ___LOCAL_GSTATE
4822 #endif
4824 #ifndef ___CAN_IMPORT_SETJMP_DYNAMICALLY
4825 #undef ___SETJMP
4826 #define ___SETJMP(x)(___GSTATE->setjmp) (x)
4827 #endif
4829 #ifndef ___CAN_IMPORT_DYNAMICALLY
4830 #undef ___EXT
4831 #define ___EXT(f)(___GSTATE->f)
4832 #undef ___LOCAL_GSTATE
4833 #define ___LOCAL_GSTATE
4834 #endif
4836 #endif
4838 #ifdef ___LOCAL_GSTATE
4840 #define ___GSTATE ___local_gstate
4841 #define ___GSTATE_DECL ___LOCAL ___global_state_struct *___local_gstate;
4842 #define ___SET_LOCAL_GSTATE(gs) ___local_gstate = gs;
4844 #else
4846 #define ___GSTATE (&___gstate)
4847 #define ___GSTATE_DECL ___IMP_DATA(___global_state_struct,___gstate);
4848 #define ___SET_LOCAL_GSTATE(gs)
4850 #endif
4852 #define ___PSTATE (&___GSTATE->pstate)
4854 #ifdef ___BIND_LATE
4856 #define ___NEED_SYM(sym)
4857 #define ___NEED_KEY(key)
4858 #define ___NEED_GLO(glo)
4860 #define ___BEGIN_SYM1 ___LOCAL ___UTF_8STRING ___sym_names[]={
4861 #define ___DEF_SYM1(i,sym,str)str,
4862 #define ___END_SYM1 0};
4864 #define ___DEF_SYM2(i,sym,str)
4866 #define ___BEGIN_KEY1 ___LOCAL ___UTF_8STRING ___key_names[]={
4867 #define ___DEF_KEY1(i,key,str)str,
4868 #define ___END_KEY1 0};
4870 #define ___DEF_KEY2(i,key,str)
4872 #define ___BEGIN_GLO ___LOCAL ___UTF_8STRING ___glo_names[]={
4873 #define ___DEF_GLO(i,str)str,
4874 #define ___END_GLO 0};
4876 #define ___BEGIN_OLD_KEY
4877 #define ___DEF_OLD_KEY(key)
4878 #define ___END_OLD_KEY
4880 #define ___BEGIN_OLD_SYM_GLO
4881 #define ___DEF_OLD_SYM_GLO(sym,glo)
4882 #define ___END_OLD_SYM_GLO
4884 #define ___BEGIN_NEW_KEY
4885 #define ___DEF_NEW_KEY(prevkey,key,str,hash)
4886 #define ___END_NEW_KEY
4888 #define ___BEGIN_NEW_SYM_GLO
4889 #define ___DEF_NEW_SYM_GLO_SUP(prevsym,sym,str,hash,glo)
4890 #define ___DEF_NEW_SYM_GLO(prevsym,sym,str,hash,glo)
4891 #define ___END_NEW_SYM_GLO(prevsym,prevkey)___LINKFILE_DESCR(0,0)
4893 #define ___DEF_SUB_NSTR(id,n)
4894 #define ___NSTR0
4895 #define ___NSTR1(a)
4896 #define ___NSTR2(a,b)
4897 #define ___NSTR3(a,b,c)
4898 #define ___NSTR4(a,b,c,d)
4899 #define ___NSTR5(a,b,c,d,e)
4900 #define ___NSTR6(a,b,c,d,e,f)
4901 #define ___NSTR7(a,b,c,d,e,f,g)
4902 #define ___NSTR8(a,b,c,d,e,f,g,h)
4904 #else
4906 #define ___NEED_SYM(sym)___IMP_DATA(___symkey_struct,sym);
4907 #define ___NEED_KEY(key)___IMP_DATA(___symkey_struct,key);
4908 #define ___NEED_GLO(glo)___IMP_DATA(___glo_struct,glo);
4910 #ifndef ___IMPORTED_ADR_IS_CONST
4912 #define ___BEGIN_SYM1 ___LOCAL ___FAKEWORD ___sym_tbl[___SYM_COUNT];
4913 #define ___DEF_SYM1(i,sym,str)
4914 #define ___END_SYM1
4916 #define ___DEF_SYM2(i,sym,str)___sym_tbl[i]=(___FAKEWORD)(sym);
4918 #define ___BEGIN_KEY1 ___LOCAL ___FAKEWORD ___key_tbl[___KEY_COUNT];
4919 #define ___DEF_KEY1(i,key,str)
4920 #define ___END_KEY1
4922 #define ___DEF_KEY2(i,key,str)___key_tbl[i]=(___FAKEWORD)(key);
4924 #else
4926 #define ___BEGIN_SYM1 ___LOCAL ___FAKEWORD ___sym_tbl[]={
4927 #define ___DEF_SYM1(i,sym,str)(___FAKEWORD)(sym),
4928 #define ___END_SYM1 0};
4930 #define ___DEF_SYM2(i,sym,str)
4932 #define ___BEGIN_KEY1 ___LOCAL ___FAKEWORD ___key_tbl[]={
4933 #define ___DEF_KEY1(i,key,str)(___FAKEWORD)(key),
4934 #define ___END_KEY1 0};
4936 #define ___DEF_KEY2(i,key,str)
4938 #endif
4940 #define ___BEGIN_GLO
4941 #define ___DEF_GLO(i,str)
4942 #define ___END_GLO
4944 #define ___BEGIN_OLD_KEY
4945 #define ___DEF_OLD_KEY(key)
4946 #define ___END_OLD_KEY
4948 #define ___BEGIN_OLD_SYM_GLO
4949 #define ___DEF_OLD_SYM_GLO(sym,glo)
4950 #define ___END_OLD_SYM_GLO
4952 #define ___BEGIN_NEW_KEY
4953 #define ___DEF_NEW_KEY(prevkey,key,str,hash) \
4954 ___EXP_DATA(___symkey_struct,key)={(___FAKEWORD)prevkey,(___FAKEWORD)str,0,0,0 ___PADDING};
4955 #define ___END_NEW_KEY
4957 #define ___BEGIN_NEW_SYM_GLO
4958 #define ___DEF_NEW_SYM_GLO_SUP(prevsym,sym,str,hash,glo) \
4959 ___EXP_DATA(___glo_struct,glo) = {___UNB2, ___FIX(hash), 0}; \
4960 ___EXP_DATA(___symkey_struct,sym)={(___FAKEWORD)prevsym,(___FAKEWORD)str,0,0,(___FAKEWORD)&glo ___PADDING};
4961 #define ___DEF_NEW_SYM_GLO(prevsym,sym,str,hash,glo) \
4962 ___EXP_DATA(___glo_struct,glo) = {___UNB1, ___FIX(hash), 0}; \
4963 ___EXP_DATA(___symkey_struct,sym)={(___FAKEWORD)prevsym,(___FAKEWORD)str,0,0,(___FAKEWORD)&glo ___PADDING};
4964 #define ___END_NEW_SYM_GLO(prevsym,prevkey)___LINKFILE_DESCR(prevsym,prevkey)
4966 #define ___DEF_SUB_NSTR(id,n) ___DEF_SUB_STR(id,n)
4967 #define ___NSTR0 ___STR0
4968 #define ___NSTR1(a) ___STR1(a)
4969 #define ___NSTR2(a,b) ___STR2(a,b)
4970 #define ___NSTR3(a,b,c) ___STR3(a,b,c)
4971 #define ___NSTR4(a,b,c,d) ___STR4(a,b,c,d)
4972 #define ___NSTR5(a,b,c,d,e) ___STR5(a,b,c,d,e)
4973 #define ___NSTR6(a,b,c,d,e,f) ___STR6(a,b,c,d,e,f)
4974 #define ___NSTR7(a,b,c,d,e,f,g) ___STR7(a,b,c,d,e,f,g)
4975 #define ___NSTR8(a,b,c,d,e,f,g,h) ___STR8(a,b,c,d,e,f,g,h)
4977 #endif
4979 #define ___BEGIN_CNS \
4980 ___LOCAL ___WORD ___cns_tbl[]={
4981 #define ___DEF_CNS(car,cdr)___MAKE_HD((___PAIR_SIZE<<___LWS),___sPAIR,___PERM),cdr,car
4982 #define ___END_CNS ___PADDING};
4984 #define ___BEGIN_SUB \
4985 ___LOCAL ___FAKEWORD ___sub_tbl[]={
4986 #define ___DEF_SUB(id)___CAST_WORDSTAR_TO_FAKEWORD(id)
4987 #define ___END_SUB };
4989 #define ___DEF_SUB_VEC(id,n) \
4990 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sVECTOR,___PERM)
4992 #define ___DEF_SUB_STRUCT(id,n) \
4993 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sSTRUCTURE,___PERM)/*****************/
4995 #define ___DEF_SUB_STRUCTURE(id,n) \
4996 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sSTRUCTURE,___PERM)
4998 #define ___DEF_SUB_BOX(id,n) \
4999 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LWS),___sBOXVALUES,___PERM)
5001 #define ___DEF_SUB_STR(id,n) \
5002 ___LOCAL ___WORD id[]={___MAKE_HD((n<<___LCS),___sSTRING,___PERM)
5004 #define ___DEF_SUB_RAT(id,num,den) \
5005 ___LOCAL ___WORD id[]={___MAKE_HD((___RATNUM_SIZE<<___LWS),___sRATNUM,___PERM),num,den ___PADDING};
5007 #define ___DEF_SUB_FLO(id,hi,lo) \
5008 ___LOCAL ___WORD id[]={___MAKE_HD((___FLONUM_SIZE<<___LWS),___sFLONUM,___PERM) \
5009 ___F64VEC1(hi,lo)___F64VEC0
5011 #define ___DEF_SUB_CPX(id,real,imag) \
5012 ___LOCAL ___WORD id[]={___MAKE_HD((___CPXNUM_SIZE<<___LWS),___sCPXNUM,___PERM),real,imag ___PADDING};
5014 #define ___DEF_SUB_S8VEC(id,n) \
5015 ___LOCAL ___WORD id[]={___MAKE_HD(n,___sS8VECTOR,___PERM)
5017 #define ___DEF_SUB_U8VEC(id,n) \
5018 ___LOCAL ___WORD id[]={___MAKE_HD(n,___sU8VECTOR,___PERM)
5020 #define ___DEF_SUB_S16VEC(id,n) \
5021 ___LOCAL ___WORD id[]={___MAKE_HD((n<<1),___sS16VECTOR,___PERM)
5023 #define ___DEF_SUB_U16VEC(id,n) \
5024 ___LOCAL ___WORD id[]={___MAKE_HD((n<<1),___sU16VECTOR,___PERM)
5026 #define ___DEF_SUB_S32VEC(id,n) \
5027 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sS32VECTOR,___PERM)
5029 #define ___DEF_SUB_U32VEC(id,n) \
5030 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sU32VECTOR,___PERM)
5032 #define ___DEF_SUB_S64VEC(id,n) \
5033 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sS64VECTOR,___PERM)
5035 #define ___DEF_SUB_U64VEC(id,n) \
5036 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sU64VECTOR,___PERM)
5038 #define ___DEF_SUB_F32VEC(id,n) \
5039 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sF32VECTOR,___PERM)
5041 #define ___DEF_SUB_F64VEC(id,n) \
5042 ___LOCAL ___WORD id[]={___MAKE_HD((n<<3),___sF64VECTOR,___PERM)
5044 #if ___SCMOBJ_WIDTH == 32
5046 #ifdef ___BIG_ENDIAN
5048 #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)
5050 #define ___P2U16(a,b)((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b)
5052 #define ___P1U32(a)a
5054 #define ___P1U64(hi,lo)hi,lo
5056 #else
5058 #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)
5060 #define ___P2U16(b,a)((___WORD)___CAST_U16(a)<<16)+(___WORD)___CAST_U16(b)
5062 #define ___P1U32(a)a
5064 #define ___P1U64(hi,lo)lo,hi
5066 #endif
5068 #define ___S8VEC0 ___PADDING};
5069 #define ___S8VEC1(a),___P4U8(a,0,0,0) ___PADDING};
5070 #define ___S8VEC2(a,b),___P4U8(a,b,0,0) ___PADDING};
5071 #define ___S8VEC3(a,b,c),___P4U8(a,b,c,0) ___PADDING};
5072 #define ___S8VEC4(a,b,c,d),___P4U8(a,b,c,d) ___PADDING};
5073 #define ___S8VEC5(a,b,c,d,e),___P4U8(a,b,c,d),___P4U8(e,0,0,0) ___PADDING};
5074 #define ___S8VEC6(a,b,c,d,e,f),___P4U8(a,b,c,d),___P4U8(e,f,0,0) ___PADDING};
5075 #define ___S8VEC7(a,b,c,d,e,f,g),___P4U8(a,b,c,d),___P4U8(e,f,g,0) ___PADDING};
5076 #define ___S8VEC8(a,b,c,d,e,f,g,h),___P4U8(a,b,c,d),___P4U8(e,f,g,h)
5078 #define ___U8VEC0 ___PADDING};
5079 #define ___U8VEC1(a),___P4U8(a,0,0,0) ___PADDING};
5080 #define ___U8VEC2(a,b),___P4U8(a,b,0,0) ___PADDING};
5081 #define ___U8VEC3(a,b,c),___P4U8(a,b,c,0) ___PADDING};
5082 #define ___U8VEC4(a,b,c,d),___P4U8(a,b,c,d) ___PADDING};
5083 #define ___U8VEC5(a,b,c,d,e),___P4U8(a,b,c,d),___P4U8(e,0,0,0) ___PADDING};
5084 #define ___U8VEC6(a,b,c,d,e,f),___P4U8(a,b,c,d),___P4U8(e,f,0,0) ___PADDING};
5085 #define ___U8VEC7(a,b,c,d,e,f,g),___P4U8(a,b,c,d),___P4U8(e,f,g,0) ___PADDING};
5086 #define ___U8VEC8(a,b,c,d,e,f,g,h),___P4U8(a,b,c,d),___P4U8(e,f,g,h)
5088 #define ___S16VEC0 ___PADDING};
5089 #define ___S16VEC1(a),___P2U16(a,0) ___PADDING};
5090 #define ___S16VEC2(a,b),___P2U16(a,b) ___PADDING};
5091 #define ___S16VEC3(a,b,c),___P2U16(a,b),___P2U16(c,0) ___PADDING};
5092 #define ___S16VEC4(a,b,c,d),___P2U16(a,b),___P2U16(c,d)
5094 #define ___U16VEC0 ___PADDING};
5095 #define ___U16VEC1(a),___P2U16(a,0) ___PADDING};
5096 #define ___U16VEC2(a,b),___P2U16(a,b) ___PADDING};
5097 #define ___U16VEC3(a,b,c),___P2U16(a,b),___P2U16(c,0) ___PADDING};
5098 #define ___U16VEC4(a,b,c,d),___P2U16(a,b),___P2U16(c,d)
5100 #define ___S32VEC0 ___PADDING};
5101 #define ___S32VEC1(a),___P1U32(a) ___PADDING};
5102 #define ___S32VEC2(a,b),___P1U32(a),___P1U32(b)
5104 #define ___U32VEC0 ___PADDING};
5105 #define ___U32VEC1(a),___P1U32(a) ___PADDING};
5106 #define ___U32VEC2(a,b),___P1U32(a),___P1U32(b)
5108 #else
5110 #ifdef ___BIG_ENDIAN
5112 #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)
5114 #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)
5116 #define ___P2U32(a,b)((___WORD)___CAST_U32(a)<<32)+(___WORD)___CAST_U32(b)
5118 #else
5120 #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)
5122 #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)
5124 #define ___P2U32(b,a)((___WORD)___CAST_U32(a)<<32)+(___WORD)___CAST_U32(b)
5126 #endif
5128 #define ___P1U64(hi,lo)((___WORD)(hi)<<32)+___CAST_U32(lo)
5130 #define ___S8VEC0 ___PADDING};
5131 #define ___S8VEC1(a),___P8U8(a,0,0,0,0,0,0,0) ___PADDING};
5132 #define ___S8VEC2(a,b),___P8U8(a,b,0,0,0,0,0,0) ___PADDING};
5133 #define ___S8VEC3(a,b,c),___P8U8(a,b,c,0,0,0,0,0) ___PADDING};
5134 #define ___S8VEC4(a,b,c,d),___P8U8(a,b,c,d,0,0,0,0) ___PADDING};
5135 #define ___S8VEC5(a,b,c,d,e),___P8U8(a,b,c,d,e,0,0,0) ___PADDING};
5136 #define ___S8VEC6(a,b,c,d,e,f),___P8U8(a,b,c,d,e,f,0,0) ___PADDING};
5137 #define ___S8VEC7(a,b,c,d,e,f,g),___P8U8(a,b,c,d,e,f,g,0) ___PADDING};
5138 #define ___S8VEC8(a,b,c,d,e,f,g,h),___P8U8(a,b,c,d,e,f,g,h)
5140 #define ___U8VEC0 ___PADDING};
5141 #define ___U8VEC1(a),___P8U8(a,0,0,0,0,0,0,0) ___PADDING};
5142 #define ___U8VEC2(a,b),___P8U8(a,b,0,0,0,0,0,0) ___PADDING};
5143 #define ___U8VEC3(a,b,c),___P8U8(a,b,c,0,0,0,0,0) ___PADDING};
5144 #define ___U8VEC4(a,b,c,d),___P8U8(a,b,c,d,0,0,0,0) ___PADDING};
5145 #define ___U8VEC5(a,b,c,d,e),___P8U8(a,b,c,d,e,0,0,0) ___PADDING};
5146 #define ___U8VEC6(a,b,c,d,e,f),___P8U8(a,b,c,d,e,f,0,0) ___PADDING};
5147 #define ___U8VEC7(a,b,c,d,e,f,g),___P8U8(a,b,c,d,e,f,g,0) ___PADDING};
5148 #define ___U8VEC8(a,b,c,d,e,f,g,h),___P8U8(a,b,c,d,e,f,g,h)
5150 #define ___S16VEC0 ___PADDING};
5151 #define ___S16VEC1(a),___P4U16(a,0,0,0) ___PADDING};
5152 #define ___S16VEC2(a,b),___P4U16(a,b,0,0) ___PADDING};
5153 #define ___S16VEC3(a,b,c),___P4U16(a,b,c,0) ___PADDING};
5154 #define ___S16VEC4(a,b,c,d),___P4U16(a,b,c,d)
5156 #define ___U16VEC0 ___PADDING};
5157 #define ___U16VEC1(a),___P4U16(a,0,0,0) ___PADDING};
5158 #define ___U16VEC2(a,b),___P4U16(a,b,0,0) ___PADDING};
5159 #define ___U16VEC3(a,b,c),___P4U16(a,b,c,0) ___PADDING};
5160 #define ___U16VEC4(a,b,c,d),___P4U16(a,b,c,d)
5162 #define ___S32VEC0 ___PADDING};
5163 #define ___S32VEC1(a),___P2U32(a,0) ___PADDING};
5164 #define ___S32VEC2(a,b),___P2U32(a,b)
5166 #define ___U32VEC0 ___PADDING};
5167 #define ___U32VEC1(a),___P2U32(a,0) ___PADDING};
5168 #define ___U32VEC2(a,b),___P2U32(a,b)
5170 #endif
5172 #define ___S64VEC0 ___PADDING_64};
5173 #define ___S64VEC1(hi,lo),___P1U64(hi,lo)
5175 #define ___U64VEC0 ___PADDING_64};
5176 #define ___U64VEC1(hi,lo),___P1U64(hi,lo)
5178 #define ___STR0 ___CS_SELECT( \
5179 ___U8VEC0, \
5180 ___U16VEC0, \
5181 ___U32VEC0)
5183 #define ___STR1(a)___CS_SELECT( \
5184 ___U8VEC1(a), \
5185 ___U16VEC1(a), \
5186 ___U32VEC1(a))
5188 #define ___STR2(a,b)___CS_SELECT( \
5189 ___U8VEC2(a,b), \
5190 ___U16VEC2(a,b), \
5191 ___U32VEC2(a,b)___U32VEC0)
5193 #define ___STR3(a,b,c)___CS_SELECT( \
5194 ___U8VEC3(a,b,c), \
5195 ___U16VEC3(a,b,c), \
5196 ___U32VEC2(a,b)___U32VEC1(c))
5198 #define ___STR4(a,b,c,d)___CS_SELECT( \
5199 ___U8VEC4(a,b,c,d), \
5200 ___U16VEC4(a,b,c,d)___U16VEC0, \
5201 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC0)
5203 #define ___STR5(a,b,c,d,e)___CS_SELECT( \
5204 ___U8VEC5(a,b,c,d,e), \
5205 ___U16VEC4(a,b,c,d)___U16VEC1(e), \
5206 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC1(e))
5208 #define ___STR6(a,b,c,d,e,f)___CS_SELECT( \
5209 ___U8VEC6(a,b,c,d,e,f), \
5210 ___U16VEC4(a,b,c,d)___U16VEC2(e,f), \
5211 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC0)
5213 #define ___STR7(a,b,c,d,e,f,g)___CS_SELECT( \
5214 ___U8VEC7(a,b,c,d,e,f,g), \
5215 ___U16VEC4(a,b,c,d)___U16VEC3(e,f,g), \
5216 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC1(g))
5218 #define ___STR8(a,b,c,d,e,f,g,h)___CS_SELECT( \
5219 ___U8VEC8(a,b,c,d,e,f,g,h), \
5220 ___U16VEC4(a,b,c,d)___U16VEC4(e,f,g,h), \
5221 ___U32VEC2(a,b)___U32VEC2(c,d)___U32VEC2(e,f)___U32VEC2(g,h))
5223 #if ___BIG_ABASE_WIDTH == 32
5225 #define ___DEF_SUB_BIG(id,n) \
5226 ___LOCAL ___WORD id[]={___MAKE_HD((n<<2),___sBIGNUM,___PERM)
5228 #define ___BIG0 ___U32VEC0
5229 #define ___BIG1(a)___U32VEC1(a)
5230 #define ___BIG2(a,b)___U32VEC2(a,b)
5232 #else
5234 #define ___DEF_SUB_BIG(id,n) \
5235 ___LOCAL ___WORD id[]={___MAKE_HD((((n+1)>>1)<<3),___sBIGNUM,___PERM)
5237 #define ___BIG0 ___U64VEC0
5238 #define ___BIG1(a)___BIG2(a,(___WORD)((a) & -0x80000000)?-1:0)___U64VEC0
5239 #define ___BIG2(a,b)___U64VEC1(b,a)
5241 #endif
5243 #define ___DEF_SUB_BIGFIX(id,n)___DEF_SUB_BIG(id,n)
5245 #define ___BIGFIX0 ___BIG0
5246 #define ___BIGFIX1(a)___BIG1(a)
5247 #define ___BIGFIX2(a,b)___BIG2(a,b)
5249 #define ___F32VEC0 ___U32VEC0
5250 #define ___F32VEC1(a)___U32VEC1(a)
5251 #define ___F32VEC2(a,b)___U32VEC2(a,b)
5253 #define ___F64VEC0 ___U64VEC0
5254 #ifdef ___CRAY_FP_FORMAT
5255 #define ___F64VEC1(hi,lo)___U64VEC1( \
5256 ((hi&0x7ff00000==0)?hi: \
5257 ((hi&0x80000000)+((hi>>4)&0x7ff0000)+0x3c028000+((hi>>5)&0x7fff))), \
5258 ((hi&0x7ff00000==0)?0: \
5259 (((hi<<27)&0xf8000000)|((lo>>5)&0x7ffffff))))
5260 #else
5261 #define ___F64VEC1(hi,lo)___U64VEC1(hi,lo)
5262 #endif
5264 #define ___VEC0 ___PADDING};
5265 #define ___VEC1(a),a
5267 #define ___CEILING_DIV(n,m)(((n)+(m)-1)/(m))
5268 #define ___ROUND_TO_MULT(n,m)(___CEILING_DIV(n,m)*(m))
5269 #define ___BREAK_FRAME_NEXT 1/********************should be 0*/
5270 #define ___BREAK_FRAME_SPACE ___ROUND_TO_MULT(1,___FRAME_ALIGN)
5272 #define ___FRAME_SPACE(n)___ROUND_TO_MULT((n)+___FRAME_RESERVE,___FRAME_ALIGN)
5273 #define ___FRAME_RESERVE 1
5274 #define ___FRAME_ALIGN 4
5276 #define ___BEGIN_LBL \
5277 ___LOCAL ___label_struct ___lbl_tbl[]={
5278 #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))}
5279 #define ___DEF_LBL_PROC(id,nbp,nbc){___PRD(nbp,nbc),0,0,___CAST_HOST_TO_FAKEHOST(___SM(___MH_PROC,id))}
5280 #define ___DEF_LBL_RET(id,frm){___MAKE_HD((3<<___LWS),___sRETURN,___PERM),frm,0,___CAST_HOST_TO_FAKEHOST(___SM(___MH_PROC,id))}
5282 #define ___END_LBL ___PADDING_LBL};
5284 #ifdef ___OFD_COUNT
5285 #define ___OFD_TBL ___ofd_tbl,sizeof(___ofd_tbl)/sizeof(___WORD)
5286 #else
5287 #define ___OFD_TBL 0,0
5288 #endif
5290 #define ___BEGIN_OFD \
5291 ___LOCAL ___WORD ___ofd_tbl[]={
5292 #define ___END_OFD ___PADDING};
5294 #define ___DEF_OFD(kind,fs,link)(link<<16)+(fs<<2)+kind
5295 #define ___OFD_KIND(x)((x)&((1<<2)-1))
5296 #define ___OFD_FS(x)(((x)>>2)&((1<<14)-1))
5297 #define ___OFD_LINK(x)(((x)>>16)&((1<<14)-1))
5299 #define ___GCMAP0
5300 #define ___GCMAP1(a),a
5301 #if ___SCMOBJ_WIDTH == 32
5302 #define ___GCMAP2(a,b),a,b
5303 #else
5304 #define ___GCMAP2(a,b),((___WORD)b<<32)+___CAST_U32(a)
5305 #endif
5307 #define ___U64VEC0 ___PADDING_64};
5308 #define ___U64VEC1(hi,lo),___P1U64(hi,lo)
5310 #define ___PRD(nbparms,nbclosed) \
5311 ___MAKE_HD((nbclosed<<12)+nbparms,___sPROCEDURE,___PERM)
5312 #define ___PRD_NBPARMS(x)(((x)>>(___SB+___HTB))&((1<<12)-1))
5313 #define ___PRD_NBCLOSED(x)(((x)>>(___SB+___HTB+12))&((1<<12)-1))
5315 #define ___IFD(kind,fs,link,gcmap)(gcmap<<12)+(link<<7)+(fs<<2)+kind
5316 #define ___OFD(kind,fs,link,gcmap)___IFD(kind,0,0,0)
5317 #define ___IS_IFD(x)((x)&3)
5319 #define ___IFD_KIND(x)((x)&((1<<2)-1))
5320 #define ___IFD_FS(x)(((x)>>2)&((1<<5)-1))
5321 #define ___IFD_LINK(x)(((x)>>7)&((1<<5)-1))
5322 #define ___IFD_GCMAP(x)(((x)>>12)&((1<<20)-1))
5325 #define ___RETI_CFS_TO_FS(fs) \
5326 ___ROUND_TO_MULT(fs,___FRAME_ALIGN)+___FRAME_SPACE(___NB_GVM_REGS+1)-___FRAME_RESERVE
5328 #define ___RETI_GET_CFS(ra,fs) \
5329 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5330 if (___IS_IFD(descr)) \
5331 fs = ___IFD_FS(descr); \
5332 else \
5333 fs = ___OFD_FS(*(___WORD*)descr); }
5335 #define ___RETI_GET_FS(ra,fs) \
5336 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5337 if (___IS_IFD(descr)) \
5338 fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); \
5339 else \
5340 fs = ___RETI_CFS_TO_FS(___OFD_FS(*(___WORD*)descr)); }
5342 #define ___RETN_GET_FS(ra,fs) \
5343 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5344 if (___IS_IFD(descr)) \
5345 fs = ___IFD_FS(descr); \
5346 else \
5347 fs = ___OFD_FS(*(___WORD*)descr); }
5349 #define ___RETI_GET_FS_LINK(ra,fs,link) \
5350 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5351 if (___IS_IFD(descr)) \
5352 { fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); link = ___IFD_LINK(descr); } \
5353 else \
5354 { descr = *(___WORD*)descr; \
5355 fs = ___RETI_CFS_TO_FS(___OFD_FS(descr)); link = ___OFD_LINK(descr); } }
5357 #define ___RETN_GET_FS_LINK(ra,fs,link) \
5358 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5359 if (___IS_IFD(descr)) \
5360 { fs = ___IFD_FS(descr); link = ___IFD_LINK(descr); } \
5361 else \
5362 { descr = *(___WORD*)descr; \
5363 fs = ___OFD_FS(descr); link = ___OFD_LINK(descr); } }
5365 #define ___RETI_GET_FS_LINK_GCMAP(ra,fs,link,firstgcmap,nextgcmap) \
5366 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5367 if (___IS_IFD(descr)) \
5368 { fs = ___RETI_CFS_TO_FS(___IFD_FS(descr)); link = ___IFD_LINK(descr); \
5369 firstgcmap = ___IFD_GCMAP(descr); } \
5370 else \
5371 { nextgcmap = (___WORD*)descr; descr = *nextgcmap++; firstgcmap = *nextgcmap++; \
5372 fs = ___RETI_CFS_TO_FS(___OFD_FS(descr)); link = ___OFD_LINK(descr); } }
5374 #define ___RETN_GET_FS_LINK_GCMAP(ra,fs,link,firstgcmap,nextgcmap) \
5375 { ___WORD descr = ((___label_struct*)((ra)-___tSUBTYPED))->entry_or_descr; \
5376 if (___IS_IFD(descr)) \
5377 { firstgcmap = ___IFD_GCMAP(descr); \
5378 fs = ___IFD_FS(descr); link = ___IFD_LINK(descr); } \
5379 else \
5380 { nextgcmap = (___WORD*)descr; descr = *nextgcmap++; firstgcmap = *nextgcmap++; \
5381 fs = ___OFD_FS(descr); link = ___OFD_LINK(descr); } }
5386 #define ___RETN 1
5387 #define ___RETI 2
5388 #define ___RETT 3
5390 #ifdef ___GLO_COUNT
5391 #ifdef ___BIND_LATE
5392 #define ___GLO_DECL ___LOCAL ___FAKEWORD ___glo_tbl[___GLO_COUNT];
5393 #define ___GLO_TBL ___glo_tbl,___GLO_COUNT,___SUP_COUNT,___glo_names
5394 #else
5395 #define ___GLO_DECL
5396 #define ___GLO_TBL 0,0,0,0
5397 #endif
5398 #else
5399 #define ___GLO_DECL
5400 #define ___GLO_TBL 0,0,0,0
5401 #endif
5403 #ifdef ___SYM_COUNT
5404 #ifdef ___BIND_LATE
5405 #define ___SYM_DECL ___LOCAL ___FAKEWORD ___sym_tbl[___SYM_COUNT];
5406 #define ___SYM_TBL ___sym_tbl,___SYM_COUNT,___sym_names
5407 #else
5408 #define ___SYM_DECL
5409 #define ___SYM_TBL ___sym_tbl,___SYM_COUNT,0
5410 #endif
5411 #else
5412 #define ___SYM_DECL
5413 #define ___SYM_TBL 0,0,0
5414 #endif
5416 #ifdef ___KEY_COUNT
5417 #ifdef ___BIND_LATE
5418 #define ___KEY_DECL ___LOCAL ___FAKEWORD ___key_tbl[___KEY_COUNT];
5419 #define ___KEY_TBL ___key_tbl,___KEY_COUNT,___key_names
5420 #else
5421 #define ___KEY_DECL
5422 #define ___KEY_TBL ___key_tbl,___KEY_COUNT,0
5423 #endif
5424 #else
5425 #define ___KEY_DECL
5426 #define ___KEY_TBL 0,0,0
5427 #endif
5429 #ifdef ___LBL_COUNT
5430 #define ___LBL_TBL &___lp,___lbl_tbl,___LBL_COUNT
5431 #else
5432 #define ___LBL_TBL 0,0,0
5433 #endif
5435 #ifdef ___CNS_COUNT
5436 #define ___CNS_TBL ___cns_tbl,___CNS_COUNT
5437 #else
5438 #define ___CNS_TBL 0,0
5439 #endif
5441 #ifdef ___SUB_COUNT
5442 #define ___SUB_TBL ___sub_tbl,___SUB_COUNT
5443 #else
5444 #define ___SUB_TBL 0,0
5445 #endif
5447 #define ___BEGIN_MOD1 ___LOCAL ___WORD ___init_proc ___PVOID{
5448 #define ___DEF_PRM(i,glo,n)___PRM(i,glo)=___GLO(i,glo)=___MLBL(n);
5449 #define ___END_MOD1 return ___FIX(___NO_ERR); }
5451 #define ___BEGIN_MOD2 ___LOCAL ___module_struct ___module_descr = { \
5452 ___VERSION, \
5453 ___MODULE_KIND, \
5454 ___MODULE_NAME, \
5455 ___SETUP_HOST_LABEL, \
5456 ___GLO_TBL, \
5457 ___SYM_TBL, \
5458 ___KEY_TBL, \
5459 ___LBL_TBL, \
5460 ___OFD_TBL, \
5461 ___CNS_TBL, \
5462 ___SUB_TBL, \
5463 ___init_proc, \
5464 ___SCRIPT_LINE, \
5466 0,0,0,0,0,0,0,0 \
5467 }; \
5468 ___BEGIN_C_LINKAGE \
5469 ___EXP_FUNC(___mod_or_lnk,___LINKER_ID) \
5470 ___P((___global_state_struct *___gs), \
5471 (___gs) \
5472 ___global_state_struct *___gs;) \
5474 ___SET_LOCAL_GSTATE(___gs)
5475 #define ___END_MOD2 \
5476 return (___mod_or_lnk)&___module_descr; \
5478 ___END_C_LINKAGE
5480 #ifdef ___LIBRARY
5482 #define ___MAIN_PROC
5484 #else
5486 #ifdef ___OS_WIN32
5487 #ifdef _WINDOWS
5489 #define ___MAIN_PROC \
5490 ___IMP_FUNC(int,___winmain) \
5491 ___P((HINSTANCE hInstance, \
5492 HINSTANCE hPrevInstance, \
5493 LPSTR lpCmdLine, \
5494 int nCmdShow, \
5495 ___mod_or_lnk (*linker)(___global_state_struct*), \
5496 char *script_line), \
5497 ()); \
5498 int WINAPI WinMain ___P((HINSTANCE hInstance, \
5499 HINSTANCE hPrevInstance, \
5500 LPSTR lpCmdLine, \
5501 int nCmdShow), \
5502 (hInstance, \
5503 hPrevInstance, \
5504 lpCmdLine, \
5505 nCmdShow) \
5506 HINSTANCE hInstance; \
5507 HINSTANCE hPrevInstance; \
5508 LPSTR lpCmdLine; \
5509 int nCmdShow;) \
5511 return ___winmain \
5512 (hInstance, \
5513 hPrevInstance, \
5514 lpCmdLine, \
5515 nCmdShow, \
5516 ___LINKER_ID, \
5517 ___SCRIPT_LINE); \
5520 #endif
5521 #endif
5523 #ifndef ___MAIN_PROC
5524 #ifdef _UNICODE
5526 #define ___MAIN_PROC \
5527 ___IMP_FUNC(int,___main_UCS_2) \
5528 ___P((int argc, \
5529 ___UCS_2STRING argv[], \
5530 ___mod_or_lnk (*linker)(___global_state_struct*), \
5531 char *script_line), \
5532 ()); \
5533 int wmain ___P((int argc, \
5534 wchar_t *argv[]), \
5535 (argc, \
5536 argv) \
5537 int argc; \
5538 wchar_t *argv[];) \
5540 return ___main_UCS_2 \
5541 (argc, \
5542 argv, \
5543 ___LINKER_ID, \
5544 ___SCRIPT_LINE); \
5547 #else
5549 #define ___MAIN_PROC \
5550 ___IMP_FUNC(int,___main_char) \
5551 ___P((int argc, \
5552 char *argv[], \
5553 ___mod_or_lnk (*linker)(___global_state_struct*), \
5554 char *script_line), \
5555 ()); \
5556 int main ___P((int argc, \
5557 char *argv[]), \
5558 (argc, \
5559 argv) \
5560 int argc; \
5561 char *argv[];) \
5563 return ___main_char \
5564 (argc, \
5565 argv, \
5566 ___LINKER_ID, \
5567 ___SCRIPT_LINE); \
5570 #endif
5571 #endif
5573 #endif
5575 #define ___LINKFILE_DESCR(sym_list,key_list) \
5576 ___LOCAL ___linkfile_struct ___linkfile_descr = { \
5577 ___VERSION, \
5578 ___LINKFILE_KIND, \
5579 ___LINKFILE_NAME, \
5580 sym_list, \
5581 key_list, \
5582 ___linker_tbl, \
5583 0,0,0,0,0,0,0,0 \
5584 }; \
5585 ___BEGIN_C_LINKAGE \
5586 ___EXP_FUNC(___mod_or_lnk,___LINKER_ID) \
5587 ___P((___global_state_struct *___gs), \
5588 (___gs) \
5589 ___global_state_struct *___gs;) \
5591 ___SET_LOCAL_GSTATE(___gs) \
5592 return (___mod_or_lnk)&___linkfile_descr; \
5594 ___END_C_LINKAGE \
5595 ___MAIN_PROC
5597 #define ___BEGIN_OLD_LNK
5598 #define ___DEF_OLD_LNK(id)___BEGIN_C_LINKAGE ___IMP_FUNC(___mod_or_lnk,id) \
5599 ___P((___global_state_struct *___gs),()); ___END_C_LINKAGE
5600 #define ___END_OLD_LNK
5602 #define ___BEGIN_NEW_LNK
5603 #define ___DEF_NEW_LNK(id)___BEGIN_C_LINKAGE ___mod_or_lnk id \
5604 ___P((___global_state_struct *___gs),()); ___END_C_LINKAGE
5605 #define ___END_NEW_LNK
5607 #define ___BEGIN_LNK ___LOCAL void *___linker_tbl[]={
5608 #define ___DEF_LNK(id)(void*)id
5609 #define ___END_LNK ,0};
5611 /*---------------------------------------------------------------------------*/
5614 * ___ERR_CODE is a type which represents the union of error codes
5615 * from various subsystems. Currently 6 types of error codes are
5616 * supported: Windows HRESULT, MACOS errors, ANSI-C errno, netdb
5617 * h_errno, getaddrinfo error codes, and system specific error codes.
5618 * A Windows HRESULT error code is a 32 bit signed integer value
5619 * composed of (starting with the low bits) a 16 bit status code, a 11
5620 * bit facility code, a 4 bit reserved facility code and a 1 bit
5621 * severity code (negative means error). It seems that only the 4
5622 * lower bits of the facility code are really used, the remaining 7
5623 * bits are zero. This allows us to compact this 32 bit integer value
5624 * to a 30 bit integer value (which fits in a fixnum) by dropping the
5625 * top 2 bits of the facility code. Of the 512 possible facility
5626 * codes, the codes 448 to 511 are assigned to Gambit specific error
5627 * codes, the codes 384 to 447 are assigned to MACOS errors, the codes
5628 * 320 to 382 are assigned to ANSI-C errno error codes, the code 319
5629 * is assigned to netdb h_errno error codes, and the code 318 is
5630 * assigned to getaddrinfo error codes. The ``no error'' error code
5631 * of each subsystem is always mapped to ___NO_ERR which is equal to
5632 * 0, all other error codes are thus negative values.
5635 #define ___ERR_CODE int
5637 #define ___ERR_CODE_FACILITY_SYSTEM 448
5638 #define ___ERR_CODE_FACILITY_MACOS 384
5639 #define ___ERR_CODE_FACILITY_ERRNO 320
5640 #define ___ERR_CODE_FACILITY_H_ERRNO 319
5641 #define ___ERR_CODE_FACILITY_GAI_CODE 318
5643 #define ___ERR_CODE_BUILD(facility,code) \
5644 ((___CAST(___ERR_CODE,-1)<<29)+(___CAST(___ERR_CODE,facility)<<16)+(code))
5646 #define ___ERR_CODE_FACILITY(err)(((err)>>16)&~(~___CAST(___ERR_CODE,0)<<9))
5648 #define ___HRESULT_ERR(hresult) \
5649 (((hresult)&~(~___CAST(___ERR_CODE,0)<<25)) | \
5650 (((hresult)&~___CAST(___ERR_CODE,0)<<27)>>2))
5652 #define ___HRESULT_FROM_ERR_CODE(err) \
5653 (((err)&~(~___CAST(___ERR_CODE,0)<<25)) | \
5654 (((err)&~___CAST(___ERR_CODE,0)<<25)<<2))
5656 #define ___WIN32_ERR(win32err) \
5657 ___HRESULT_ERR(HRESULT_FROM_WIN32(win32err))
5659 #define ___WIN32_FROM_ERR_CODE(err) \
5660 HRESULT_CODE(___HRESULT_FROM_ERR_CODE(err))
5662 #define ___MACOS_ERR(oserr) \
5663 ((oserr)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_MACOS,oserr))
5665 #define ___MACOS_FROM_ERR_CODE(err) \
5666 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_MACOS,0)))
5668 #define ___ERRNO_ERR(errno) \
5669 ((errno)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_ERRNO,errno))
5671 #define ___ERRNO_FROM_ERR_CODE(err) \
5672 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_ERRNO,0)))
5674 #define ___H_ERRNO_ERR(h_errno) \
5675 ((h_errno)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_H_ERRNO,(h_errno)))
5677 #define ___H_ERRNO_FROM_ERR_CODE(err) \
5678 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_H_ERRNO,0)))
5680 #define ___GAI_CODE_ERR(gai_code) \
5681 ((gai_code)==0?___NO_ERR:___ERR_CODE_BUILD(___ERR_CODE_FACILITY_GAI_CODE,(gai_code)))
5683 #define ___GAI_CODE_FROM_ERR_CODE(err) \
5684 ((err)==___NO_ERR?0:((err)-___ERR_CODE_BUILD(___ERR_CODE_FACILITY_GAI_CODE,0)))
5686 #define ___ERR_BASE ___ERR_CODE_BUILD(___ERR_CODE_FACILITY_SYSTEM,0)
5688 #define ___NO_ERR 0
5689 #define ___UNWIND_C_STACK (___ERR_BASE+0)
5690 #define ___SFUN_HEAP_OVERFLOW_ERR (___ERR_BASE+1)
5691 #define ___IMPL_LIMIT_ERR (___ERR_BASE+2)
5692 #define ___UNKNOWN_ERR (___ERR_BASE+3)
5693 #define ___UNIMPL_ERR (___ERR_BASE+4)
5694 #define ___HEAP_OVERFLOW_ERR (___ERR_BASE+5)
5695 #define ___CLOSED_DEVICE_ERR (___ERR_BASE+6)
5696 #define ___INVALID_OP_ERR (___ERR_BASE+7)
5697 #define ___MODULE_VERSION_TOO_OLD_ERR (___ERR_BASE+8)
5698 #define ___MODULE_VERSION_TOO_NEW_ERR (___ERR_BASE+9)
5699 #define ___MODULE_ALREADY_LOADED_ERR (___ERR_BASE+10)
5700 #define ___DYNAMIC_LOADING_NOT_AVAILABLE_ERR (___ERR_BASE+11)
5701 #define ___DYNAMIC_LOADING_LOOKUP_ERR (___ERR_BASE+12)
5702 #define ___KILL_PUMP (___ERR_BASE+13)
5703 #define ___SELECT_SETUP_DONE (___ERR_BASE+14)
5704 #define ___STOC_BASE ___STOC_S8_ERR
5705 #define ___STOC_S8_ERR (___ERR_BASE+(1<<7))
5706 #define ___STOC_U8_ERR (___ERR_BASE+(2<<7))
5707 #define ___STOC_S16_ERR (___ERR_BASE+(3<<7))
5708 #define ___STOC_U16_ERR (___ERR_BASE+(4<<7))
5709 #define ___STOC_S32_ERR (___ERR_BASE+(5<<7))
5710 #define ___STOC_U32_ERR (___ERR_BASE+(6<<7))
5711 #define ___STOC_S64_ERR (___ERR_BASE+(7<<7))
5712 #define ___STOC_U64_ERR (___ERR_BASE+(8<<7))
5713 #define ___STOC_F32_ERR (___ERR_BASE+(9<<7))
5714 #define ___STOC_F64_ERR (___ERR_BASE+(10<<7))
5715 #define ___STOC_CHAR_ERR (___ERR_BASE+(11<<7))
5716 #define ___STOC_SCHAR_ERR (___ERR_BASE+(12<<7))
5717 #define ___STOC_UCHAR_ERR (___ERR_BASE+(13<<7))
5718 #define ___STOC_ISO_8859_1_ERR (___ERR_BASE+(14<<7))
5719 #define ___STOC_UCS_2_ERR (___ERR_BASE+(15<<7))
5720 #define ___STOC_UCS_4_ERR (___ERR_BASE+(16<<7))
5721 #define ___STOC_WCHAR_ERR (___ERR_BASE+(17<<7))
5722 #define ___STOC_SHORT_ERR (___ERR_BASE+(18<<7))
5723 #define ___STOC_USHORT_ERR (___ERR_BASE+(19<<7))
5724 #define ___STOC_INT_ERR (___ERR_BASE+(20<<7))
5725 #define ___STOC_UINT_ERR (___ERR_BASE+(21<<7))
5726 #define ___STOC_LONG_ERR (___ERR_BASE+(22<<7))
5727 #define ___STOC_ULONG_ERR (___ERR_BASE+(23<<7))
5728 #define ___STOC_LONGLONG_ERR (___ERR_BASE+(24<<7))
5729 #define ___STOC_ULONGLONG_ERR (___ERR_BASE+(25<<7))
5730 #define ___STOC_FLOAT_ERR (___ERR_BASE+(26<<7))
5731 #define ___STOC_DOUBLE_ERR (___ERR_BASE+(27<<7))
5732 #define ___STOC_STRUCT_ERR (___ERR_BASE+(28<<7))
5733 #define ___STOC_UNION_ERR (___ERR_BASE+(29<<7))
5734 #define ___STOC_TYPE_ERR (___ERR_BASE+(30<<7))
5735 #define ___STOC_POINTER_ERR (___ERR_BASE+(31<<7))
5736 #define ___STOC_NONNULLPOINTER_ERR (___ERR_BASE+(32<<7))
5737 #define ___STOC_FUNCTION_ERR (___ERR_BASE+(33<<7))
5738 #define ___STOC_NONNULLFUNCTION_ERR (___ERR_BASE+(34<<7))
5739 #define ___STOC_BOOL_ERR (___ERR_BASE+(35<<7))
5740 #define ___STOC_CHARSTRING_ERR (___ERR_BASE+(36<<7))
5741 #define ___STOC_NONNULLCHARSTRING_ERR (___ERR_BASE+(37<<7))
5742 #define ___STOC_NONNULLCHARSTRINGLIST_ERR (___ERR_BASE+(38<<7))
5743 #define ___STOC_ISO_8859_1STRING_ERR (___ERR_BASE+(39<<7))
5744 #define ___STOC_NONNULLISO_8859_1STRING_ERR (___ERR_BASE+(40<<7))
5745 #define ___STOC_NONNULLISO_8859_1STRINGLIST_ERR (___ERR_BASE+(41<<7))
5746 #define ___STOC_UTF_8STRING_ERR (___ERR_BASE+(42<<7))
5747 #define ___STOC_NONNULLUTF_8STRING_ERR (___ERR_BASE+(43<<7))
5748 #define ___STOC_NONNULLUTF_8STRINGLIST_ERR (___ERR_BASE+(44<<7))
5749 #define ___STOC_UTF_16STRING_ERR (___ERR_BASE+(45<<7))
5750 #define ___STOC_NONNULLUTF_16STRING_ERR (___ERR_BASE+(46<<7))
5751 #define ___STOC_NONNULLUTF_16STRINGLIST_ERR (___ERR_BASE+(47<<7))
5752 #define ___STOC_UCS_2STRING_ERR (___ERR_BASE+(48<<7))
5753 #define ___STOC_NONNULLUCS_2STRING_ERR (___ERR_BASE+(49<<7))
5754 #define ___STOC_NONNULLUCS_2STRINGLIST_ERR (___ERR_BASE+(50<<7))
5755 #define ___STOC_UCS_4STRING_ERR (___ERR_BASE+(51<<7))
5756 #define ___STOC_NONNULLUCS_4STRING_ERR (___ERR_BASE+(52<<7))
5757 #define ___STOC_NONNULLUCS_4STRINGLIST_ERR (___ERR_BASE+(53<<7))
5758 #define ___STOC_WCHARSTRING_ERR (___ERR_BASE+(54<<7))
5759 #define ___STOC_NONNULLWCHARSTRING_ERR (___ERR_BASE+(55<<7))
5760 #define ___STOC_NONNULLWCHARSTRINGLIST_ERR (___ERR_BASE+(56<<7))
5761 #define ___STOC_VARIANT_ERR (___ERR_BASE+(57<<7))
5762 #define ___STOC_HEAP_OVERFLOW_ERR (___ERR_BASE+(58<<7))
5763 #define ___STOC_MAX (___ERR_BASE+(59<<7)-1)
5764 #define ___CTOS_BASE ___CTOS_S8_ERR
5765 #define ___CTOS_S8_ERR (___ERR_BASE+(65<<7))
5766 #define ___CTOS_U8_ERR (___ERR_BASE+(66<<7))
5767 #define ___CTOS_S16_ERR (___ERR_BASE+(67<<7))
5768 #define ___CTOS_U16_ERR (___ERR_BASE+(68<<7))
5769 #define ___CTOS_S32_ERR (___ERR_BASE+(69<<7))
5770 #define ___CTOS_U32_ERR (___ERR_BASE+(70<<7))
5771 #define ___CTOS_S64_ERR (___ERR_BASE+(71<<7))
5772 #define ___CTOS_U64_ERR (___ERR_BASE+(72<<7))
5773 #define ___CTOS_F32_ERR (___ERR_BASE+(73<<7))
5774 #define ___CTOS_F64_ERR (___ERR_BASE+(74<<7))
5775 #define ___CTOS_CHAR_ERR (___ERR_BASE+(75<<7))
5776 #define ___CTOS_SCHAR_ERR (___ERR_BASE+(76<<7))
5777 #define ___CTOS_UCHAR_ERR (___ERR_BASE+(77<<7))
5778 #define ___CTOS_ISO_8859_1_ERR (___ERR_BASE+(78<<7))
5779 #define ___CTOS_UCS_2_ERR (___ERR_BASE+(79<<7))
5780 #define ___CTOS_UCS_4_ERR (___ERR_BASE+(80<<7))
5781 #define ___CTOS_WCHAR_ERR (___ERR_BASE+(81<<7))
5782 #define ___CTOS_SHORT_ERR (___ERR_BASE+(82<<7))
5783 #define ___CTOS_USHORT_ERR (___ERR_BASE+(83<<7))
5784 #define ___CTOS_INT_ERR (___ERR_BASE+(84<<7))
5785 #define ___CTOS_UINT_ERR (___ERR_BASE+(85<<7))
5786 #define ___CTOS_LONG_ERR (___ERR_BASE+(86<<7))
5787 #define ___CTOS_ULONG_ERR (___ERR_BASE+(87<<7))
5788 #define ___CTOS_LONGLONG_ERR (___ERR_BASE+(88<<7))
5789 #define ___CTOS_ULONGLONG_ERR (___ERR_BASE+(89<<7))
5790 #define ___CTOS_FLOAT_ERR (___ERR_BASE+(90<<7))
5791 #define ___CTOS_DOUBLE_ERR (___ERR_BASE+(91<<7))
5792 #define ___CTOS_STRUCT_ERR (___ERR_BASE+(92<<7))
5793 #define ___CTOS_UNION_ERR (___ERR_BASE+(93<<7))
5794 #define ___CTOS_TYPE_ERR (___ERR_BASE+(94<<7))
5795 #define ___CTOS_POINTER_ERR (___ERR_BASE+(95<<7))
5796 #define ___CTOS_NONNULLPOINTER_ERR (___ERR_BASE+(96<<7))
5797 #define ___CTOS_FUNCTION_ERR (___ERR_BASE+(97<<7))
5798 #define ___CTOS_NONNULLFUNCTION_ERR (___ERR_BASE+(98<<7))
5799 #define ___CTOS_BOOL_ERR (___ERR_BASE+(99<<7))
5800 #define ___CTOS_CHARSTRING_ERR (___ERR_BASE+(100<<7))
5801 #define ___CTOS_NONNULLCHARSTRING_ERR (___ERR_BASE+(101<<7))
5802 #define ___CTOS_NONNULLCHARSTRINGLIST_ERR (___ERR_BASE+(102<<7))
5803 #define ___CTOS_ISO_8859_1STRING_ERR (___ERR_BASE+(103<<7))
5804 #define ___CTOS_NONNULLISO_8859_1STRING_ERR (___ERR_BASE+(104<<7))
5805 #define ___CTOS_NONNULLISO_8859_1STRINGLIST_ERR (___ERR_BASE+(105<<7))
5806 #define ___CTOS_UTF_8STRING_ERR (___ERR_BASE+(106<<7))
5807 #define ___CTOS_NONNULLUTF_8STRING_ERR (___ERR_BASE+(107<<7))
5808 #define ___CTOS_NONNULLUTF_8STRINGLIST_ERR (___ERR_BASE+(108<<7))
5809 #define ___CTOS_UTF_16STRING_ERR (___ERR_BASE+(109<<7))
5810 #define ___CTOS_NONNULLUTF_16STRING_ERR (___ERR_BASE+(110<<7))
5811 #define ___CTOS_NONNULLUTF_16STRINGLIST_ERR (___ERR_BASE+(111<<7))
5812 #define ___CTOS_UCS_2STRING_ERR (___ERR_BASE+(112<<7))
5813 #define ___CTOS_NONNULLUCS_2STRING_ERR (___ERR_BASE+(113<<7))
5814 #define ___CTOS_NONNULLUCS_2STRINGLIST_ERR (___ERR_BASE+(114<<7))
5815 #define ___CTOS_UCS_4STRING_ERR (___ERR_BASE+(115<<7))
5816 #define ___CTOS_NONNULLUCS_4STRING_ERR (___ERR_BASE+(116<<7))
5817 #define ___CTOS_NONNULLUCS_4STRINGLIST_ERR (___ERR_BASE+(117<<7))
5818 #define ___CTOS_WCHARSTRING_ERR (___ERR_BASE+(118<<7))
5819 #define ___CTOS_NONNULLWCHARSTRING_ERR (___ERR_BASE+(119<<7))
5820 #define ___CTOS_NONNULLWCHARSTRINGLIST_ERR (___ERR_BASE+(120<<7))
5821 #define ___CTOS_VARIANT_ERR (___ERR_BASE+(121<<7))
5822 #define ___CTOS_HEAP_OVERFLOW_ERR (___ERR_BASE+(122<<7))
5823 #define ___CTOS_MAX (___ERR_BASE+(123<<7)-1)
5825 #define ___RETURN_POS 127
5827 /*---------------------------------------------------------------------------*/
5829 #define ___USE_RC_ALLOCATION_FOR_FOREIGN
5831 #ifdef ___USE_RC_ALLOCATION_FOR_FOREIGN
5833 #define ___CPLUSPLUS_ASSIGN_NEW(var,type) \
5834 do { \
5835 void *___ptr = ___EXT(___alloc_rc) (sizeof (type)); \
5836 if (___ptr == 0) \
5837 var = 0; \
5838 else \
5839 var = new (___ptr) type; \
5840 } while (0)
5841 #define ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init) \
5842 do { \
5843 void *___ptr = ___EXT(___alloc_rc) (sizeof (type)); \
5844 if (___ptr == 0) \
5845 var = 0; \
5846 else \
5847 var = new (___ptr) type (init); \
5848 } while (0)
5849 #define ___CPLUSPLUS_DELETE_STRUCT(name,ptr) \
5850 do { \
5851 ___EXT(___release_rc) (ptr); \
5852 } while (0)
5853 #define ___CPLUSPLUS_DELETE_UNION(name,ptr) \
5854 do { \
5855 ___EXT(___release_rc) (ptr); \
5856 } while (0)
5857 #define ___CPLUSPLUS_DELETE_TYPE(name,ptr) \
5858 do { \
5859 ___CAST(name*,ptr)->~name (); \
5860 ___EXT(___release_rc) (ptr); \
5861 } while (0)
5863 #define ___C_ASSIGN_NEW(var,type) \
5864 do { \
5865 var = ___CAST(type*,___EXT(___alloc_rc) (sizeof (type)); \
5866 } while (0)
5867 #define ___C_ASSIGN_NEW_WITH_INIT(var,type,init) \
5868 do { \
5869 if ((var = ___CAST(type*,___EXT(___alloc_rc) (sizeof (type)))) != 0) \
5870 *___CAST(type*,var) = init; \
5871 } while (0)
5872 #define ___C_DELETE_STRUCT(name,ptr) \
5873 do { \
5874 ___EXT(___release_rc) (ptr); \
5875 } while (0)
5876 #define ___C_DELETE_UNION(name,ptr) \
5877 do { \
5878 ___EXT(___release_rc) (ptr); \
5879 } while (0)
5880 #define ___C_DELETE_TYPE(name,ptr) \
5881 do { \
5882 ___EXT(___release_rc) (ptr); \
5883 } while (0)
5885 #else
5887 #define ___CPLUSPLUS_ASSIGN_NEW(var,type) \
5888 do { \
5889 try { var = new type; } catch (std::bad_alloc) { var = 0; } \
5890 } while (0)
5891 #define ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init) \
5892 do { \
5893 try { var = new type (init); } catch (std::bad_alloc) { var = 0; } \
5894 } while (0)
5895 #define ___CPLUSPLUS_DELETE_STRUCT(name,ptr) \
5896 do { \
5897 delete ___CAST(struct name*,ptr); \
5898 } while (0)
5899 #define ___CPLUSPLUS_DELETE_UNION(name,ptr) \
5900 do { \
5901 delete ___CAST(union name*,ptr); \
5902 } while (0)
5903 #define ___CPLUSPLUS_DELETE_TYPE(name,ptr) \
5904 do { \
5905 delete ___CAST(name*,ptr); \
5906 } while (0)
5908 #define ___C_ASSIGN_NEW(var,type) \
5909 do { \
5910 var = ___CAST(type*,___EXT(___alloc_mem) (sizeof (type)); \
5911 } while (0)
5912 #define ___C_ASSIGN_NEW_WITH_INIT(var,type,init) \
5913 do { \
5914 if ((var = ___CAST(type*,___EXT(___alloc_mem) (sizeof (type)))) != 0) \
5915 *___CAST(type*,var) = init; \
5916 } while (0)
5917 #define ___C_DELETE_STRUCT(name,ptr) \
5918 do { \
5919 ___EXT(___free_mem) (ptr); \
5920 } while (0)
5921 #define ___C_DELETE_UNION(name,ptr) \
5922 do { \
5923 ___EXT(___free_mem) (ptr); \
5924 } while (0)
5925 #define ___C_DELETE_TYPE(name,ptr) \
5926 do { \
5927 ___EXT(___free_mem) (ptr); \
5928 } while (0)
5930 #endif
5932 #ifdef ___USE_CPLUSPLUS_NEW_DELETE
5934 #define ___ASSIGN_NEW(var,type) \
5935 ___CPLUSPLUS_ASSIGN_NEW(var,type)
5936 #define ___ASSIGN_NEW_WITH_INIT(var,type,init) \
5937 ___CPLUSPLUS_ASSIGN_NEW_WITH_INIT(var,type,init)
5938 #define ___DELETE_STRUCT(name,ptr) ___CPLUSPLUS_DELETE_STRUCT(name,ptr)
5939 #define ___DELETE_UNION(name,ptr) ___CPLUSPLUS_DELETE_UNION(name,ptr)
5940 #define ___DELETE_TYPE(name,ptr) ___CPLUSPLUS_DELETE_TYPE(name,ptr)
5942 #else
5944 #define ___ASSIGN_NEW(var,type) \
5945 ___C_ASSIGN_NEW(var,type)
5946 #define ___ASSIGN_NEW_WITH_INIT(var,type,init) \
5947 ___C_ASSIGN_NEW_WITH_INIT(var,type,init)
5948 #define ___DELETE_STRUCT(name,ptr) ___C_DELETE_STRUCT(name,ptr)
5949 #define ___DELETE_UNION(name,ptr) ___C_DELETE_UNION(name,ptr)
5950 #define ___DELETE_TYPE(name,ptr) ___C_DELETE_TYPE(name,ptr)
5952 #endif
5954 #ifdef ___USE_CPLUSPLUS_CLEANUP
5956 #define ___BEGIN_CLEANUP(cleanup) \
5957 { struct ___cleanup { ~___cleanup () { cleanup; } } ___cleanup_object;
5958 #define ___END_CLEANUP(cleanup) \
5961 #else
5963 #define ___BEGIN_CLEANUP(cleanup) \
5965 #define ___END_CLEANUP(cleanup) \
5966 cleanup; }
5968 #endif
5970 #ifdef ___USE_SETJMP
5972 #define ___BEGIN_TRY \
5973 { ___jmpbuf_struct ___jbuf, *___old_catcher = ___ps->catcher; \
5974 ___ps->catcher = &___jbuf; ___err = ___SETJMP(___jbuf.buf); \
5975 if (___err==___FIX(___NO_ERR)) {
5976 #define ___END_TRY } ___ps->catcher = ___old_catcher; }
5977 #define ___THROW(e)___LONGJMP(___ps->catcher->buf, e)
5978 #define ___ON_THROW(stat1,stat2) \
5979 ___ON_THROW_AUX(___processor_state ___ps=___PSTATE;,stat1,stat2)
5981 #else
5983 #define ___BEGIN_TRY { ___err = ___FIX(___NO_ERR); try {
5984 #define ___END_TRY } catch (___throw_struct ts) { ___err = ts.err; } }
5985 #define ___THROW(e)do { ___throw_struct ts; ts.err = e; throw (ts); } while (0)
5986 #define ___ON_THROW(stat1,stat2) \
5987 ___ON_THROW_AUX(,stat1,stat2)
5989 #endif
5991 #define ___ON_THROW_AUX(decl,stat1,stat2) \
5992 do { \
5993 ___SCMOBJ ___err; decl \
5994 ___BEGIN_TRY stat1; ___END_TRY \
5995 if (___err != ___FIX(___NO_ERR)) stat2; \
5996 } while (0)
5998 #define ___RELEASE_POINTER ___EXT(___release_pointer)
6000 #define ___DEF_RELEASE_FN_STRUCT(name,id) \
6001 ___HIDDEN ___SCMOBJ id \
6002 ___P((void *___x), \
6003 (___x) \
6004 void *___x;) \
6005 { ___DELETE_STRUCT(name,___x); return ___FIX(___NO_ERR); }
6007 #define ___DEF_RELEASE_FN_UNION(name,id) \
6008 ___HIDDEN ___SCMOBJ id \
6009 ___P((void *___x), \
6010 (___x) \
6011 void *___x;) \
6012 { ___DELETE_UNION(name,___x); return ___FIX(___NO_ERR); }
6014 #define ___DEF_RELEASE_FN_TYPE(name,id) \
6015 ___HIDDEN ___SCMOBJ id \
6016 ___P((void *___x), \
6017 (___x) \
6018 void *___x;) \
6019 { ___DELETE_TYPE(name,___x); return ___FIX(___NO_ERR); }
6021 #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;)}
6023 #define ___STOC3(f,s,c,i)___err=___EXT(f)(s,c,i)
6024 #define ___STOC4(f,s,c,t,i)___err=___EXT(f)(s,c,t,i)
6025 #define ___CTOS3(f,c,s,i)___err=___EXT(f)(c,s,i)
6026 #define ___CTOS5(f,c,t,r,s,i)___err=___EXT(f)(c,t,r,s,i)
6027 #define ___IF_STOC3(f,s,c,i)if ((___STOC3(f,s,c,i))==___FIX(___NO_ERR))
6028 #define ___IF_STOC4(f,s,c,t,i)if ((___STOC4(f,s,c,t,i))==___FIX(___NO_ERR))
6029 #define ___IF_CTOS3(f,c,s,i)if ((___CTOS3(f,c,s,i))==___FIX(___NO_ERR))
6030 #define ___IF_CTOS5(f,c,t,r,s,i)if ((___CTOS5(f,c,t,r,s,i))==___FIX(___NO_ERR))
6032 #define ___BEGIN_SFUN_BODY
6033 #define ___END_SFUN_BODY
6035 #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)) {
6036 #define ___SFUN_CALL_VOID ___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker);
6037 #define ___SFUN_SET_RESULT_VOID /* no result to set */
6038 #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);
6039 #define ___END_SFUN_VOID } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6041 #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)) {
6042 #define ___SFUN_CALL_SCMOBJ ___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker);
6043 #define ___SFUN_SET_RESULT_SCMOBJ ___result = ___SFUN_RESULT;
6044 #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);
6045 #define ___END_SFUN_SCMOBJ } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6047 #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)) {
6048 #define ___SFUN_CALL if ((___err=___EXT(___call) (___NARGS,___FIELD(___marker,0),___marker))==___FIX(___NO_ERR))
6049 #define ___SFUN_SET_RESULT /* done in conversion function */
6050 #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))
6051 #define ___END_SFUN } ___EXT(___kill_sfun_stack_marker) (___marker); } ___EXT(___propagate_error) (___err);
6053 #define ___BEGIN_SFUN_ARG(i,arg)___SCMOBJ arg;
6054 #define ___END_SFUN_ARG(i)
6055 #define ___BEGIN_SFUN_ARG_SCMOBJ(i)
6056 #define ___END_SFUN_ARG_SCMOBJ(i)
6057 #define ___SFUN_ARG(i,arg)___PSSTK(___FRAME_SPACE(2)+i)=arg;
6058 #define ___SFUN_RESULT ___PSR1
6060 #define ___BEGIN_SFUN_SCMOBJ_TO_S8(s,c)___STOC3(___SCMOBJ_to_S8,s,&c,___RETURN_POS);
6061 #define ___END_SFUN_SCMOBJ_TO_S8(s,c)
6062 #define ___BEGIN_SFUN_SCMOBJ_TO_U8(s,c)___STOC3(___SCMOBJ_to_U8,s,&c,___RETURN_POS);
6063 #define ___END_SFUN_SCMOBJ_TO_U8(s,c)
6064 #define ___BEGIN_SFUN_SCMOBJ_TO_S16(s,c)___STOC3(___SCMOBJ_to_S16,s,&c,___RETURN_POS);
6065 #define ___END_SFUN_SCMOBJ_TO_S16(s,c)
6066 #define ___BEGIN_SFUN_SCMOBJ_TO_U16(s,c)___STOC3(___SCMOBJ_to_U16,s,&c,___RETURN_POS);
6067 #define ___END_SFUN_SCMOBJ_TO_U16(s,c)
6068 #define ___BEGIN_SFUN_SCMOBJ_TO_S32(s,c)___STOC3(___SCMOBJ_to_S32,s,&c,___RETURN_POS);
6069 #define ___END_SFUN_SCMOBJ_TO_S32(s,c)
6070 #define ___BEGIN_SFUN_SCMOBJ_TO_U32(s,c)___STOC3(___SCMOBJ_to_U32,s,&c,___RETURN_POS);
6071 #define ___END_SFUN_SCMOBJ_TO_U32(s,c)
6072 #define ___BEGIN_SFUN_SCMOBJ_TO_S64(s,c)___STOC3(___SCMOBJ_to_S64,s,&c,___RETURN_POS);
6073 #define ___END_SFUN_SCMOBJ_TO_S64(s,c)
6074 #define ___BEGIN_SFUN_SCMOBJ_TO_U64(s,c)___STOC3(___SCMOBJ_to_U64,s,&c,___RETURN_POS);
6075 #define ___END_SFUN_SCMOBJ_TO_U64(s,c)
6076 #define ___BEGIN_SFUN_SCMOBJ_TO_F32(s,c)___STOC3(___SCMOBJ_to_F32,s,&c,___RETURN_POS);
6077 #define ___END_SFUN_SCMOBJ_TO_F32(s,c)
6078 #define ___BEGIN_SFUN_SCMOBJ_TO_F64(s,c)___STOC3(___SCMOBJ_to_F64,s,&c,___RETURN_POS);
6079 #define ___END_SFUN_SCMOBJ_TO_F64(s,c)
6080 #define ___BEGIN_SFUN_SCMOBJ_TO_CHAR(s,c)___STOC3(___SCMOBJ_to_CHAR,s,&c,___RETURN_POS);
6081 #define ___END_SFUN_SCMOBJ_TO_CHAR(s,c)
6082 #define ___BEGIN_SFUN_SCMOBJ_TO_SCHAR(s,c)___STOC3(___SCMOBJ_to_SCHAR,s,&c,___RETURN_POS);
6083 #define ___END_SFUN_SCMOBJ_TO_SCHAR(s,c)
6084 #define ___BEGIN_SFUN_SCMOBJ_TO_UCHAR(s,c)___STOC3(___SCMOBJ_to_UCHAR,s,&c,___RETURN_POS);
6085 #define ___END_SFUN_SCMOBJ_TO_UCHAR(s,c)
6086 #define ___BEGIN_SFUN_SCMOBJ_TO_ISO_8859_1(s,c)___STOC3(___SCMOBJ_to_ISO_8859_1,s,&c,___RETURN_POS);
6087 #define ___END_SFUN_SCMOBJ_TO_ISO_8859_1(s,c)
6088 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_2(s,c)___STOC3(___SCMOBJ_to_UCS_2,s,&c,___RETURN_POS);
6089 #define ___END_SFUN_SCMOBJ_TO_UCS_2(s,c)
6090 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_4(s,c)___STOC3(___SCMOBJ_to_UCS_4,s,&c,___RETURN_POS);
6091 #define ___END_SFUN_SCMOBJ_TO_UCS_4(s,c)
6092 #define ___BEGIN_SFUN_SCMOBJ_TO_WCHAR(s,c)___STOC3(___SCMOBJ_to_WCHAR,s,&c,___RETURN_POS);
6093 #define ___END_SFUN_SCMOBJ_TO_WCHAR(s,c)
6094 #define ___BEGIN_SFUN_SCMOBJ_TO_SHORT(s,c)___STOC3(___SCMOBJ_to_SHORT,s,&c,___RETURN_POS);
6095 #define ___END_SFUN_SCMOBJ_TO_SHORT(s,c)
6096 #define ___BEGIN_SFUN_SCMOBJ_TO_USHORT(s,c)___STOC3(___SCMOBJ_to_USHORT,s,&c,___RETURN_POS);
6097 #define ___END_SFUN_SCMOBJ_TO_USHORT(s,c)
6098 #define ___BEGIN_SFUN_SCMOBJ_TO_INT(s,c)___STOC3(___SCMOBJ_to_INT,s,&c,___RETURN_POS);
6099 #define ___END_SFUN_SCMOBJ_TO_INT(s,c)
6100 #define ___BEGIN_SFUN_SCMOBJ_TO_UINT(s,c)___STOC3(___SCMOBJ_to_UINT,s,&c,___RETURN_POS);
6101 #define ___END_SFUN_SCMOBJ_TO_UINT(s,c)
6102 #define ___BEGIN_SFUN_SCMOBJ_TO_LONG(s,c)___STOC3(___SCMOBJ_to_LONG,s,&c,___RETURN_POS);
6103 #define ___END_SFUN_SCMOBJ_TO_LONG(s,c)
6104 #define ___BEGIN_SFUN_SCMOBJ_TO_ULONG(s,c)___STOC3(___SCMOBJ_to_ULONG,s,&c,___RETURN_POS);
6105 #define ___END_SFUN_SCMOBJ_TO_ULONG(s,c)
6106 #define ___BEGIN_SFUN_SCMOBJ_TO_FLOAT(s,c)___STOC3(___SCMOBJ_to_FLOAT,s,&c,___RETURN_POS);
6107 #define ___END_SFUN_SCMOBJ_TO_FLOAT(s,c)
6108 #define ___BEGIN_SFUN_SCMOBJ_TO_DOUBLE(s,c)___STOC3(___SCMOBJ_to_DOUBLE,s,&c,___RETURN_POS);
6109 #define ___END_SFUN_SCMOBJ_TO_DOUBLE(s,c)
6110 #define ___BEGIN_SFUN_SCMOBJ_TO_STRUCT(n,s,c,t)___STOC4(___SCMOBJ_to_STRUCT,s,&c,t,___RETURN_POS);
6111 #define ___END_SFUN_SCMOBJ_TO_STRUCT(n,s,c,t)
6112 #define ___BEGIN_SFUN_SCMOBJ_TO_UNION(n,s,c,t)___STOC4(___SCMOBJ_to_UNION,s,&c,t,___RETURN_POS);
6113 #define ___END_SFUN_SCMOBJ_TO_UNION(n,s,c,t)
6114 #define ___BEGIN_SFUN_SCMOBJ_TO_TYPE(n,s,c,t)___STOC4(___SCMOBJ_to_TYPE,s,&c,t,___RETURN_POS);
6115 #define ___END_SFUN_SCMOBJ_TO_TYPE(n,s,c,t)
6116 #define ___BEGIN_SFUN_SCMOBJ_TO_POINTER(s,c,t)___STOC4(___SCMOBJ_to_POINTER,s,&c,t,___RETURN_POS);
6117 #define ___END_SFUN_SCMOBJ_TO_POINTER(s,c,t)
6118 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t)___STOC4(___SCMOBJ_to_NONNULLPOINTER,s,&c,t,___RETURN_POS);
6119 #define ___END_SFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t)
6120 #define ___BEGIN_SFUN_SCMOBJ_TO_FUNCTION(s,cnv,c)___STOC4(___SCMOBJ_to_FUNCTION,s,___CAST(void*,cnv),&c,___RETURN_POS);
6121 #define ___END_SFUN_SCMOBJ_TO_FUNCTION(s,cnv,c)
6122 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c)___STOC4(___SCMOBJ_to_NONNULLFUNCTION,s,___CAST(void*,cnv),&c,___RETURN_POS);
6123 #define ___END_SFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c)
6124 #define ___BEGIN_SFUN_SCMOBJ_TO_BOOL(s,c)___STOC3(___SCMOBJ_to_BOOL,s,&c,___RETURN_POS);
6125 #define ___END_SFUN_SCMOBJ_TO_BOOL(s,c)
6126 #define ___BEGIN_SFUN_SCMOBJ_TO_CHARSTRING(s,c)___STOC3(___SCMOBJ_to_CHARSTRING,s,&c,___RETURN_POS);
6127 #define ___END_SFUN_SCMOBJ_TO_CHARSTRING(s,c)
6128 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c)___STOC3(___SCMOBJ_to_NONNULLCHARSTRING,s,&c,___RETURN_POS);
6129 #define ___END_SFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c)
6130 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLCHARSTRINGLIST,s,&c,___RETURN_POS);
6131 #define ___END_SFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c)
6132 #define ___BEGIN_SFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c)___STOC3(___SCMOBJ_to_ISO_8859_1STRING,s,&c,___RETURN_POS);
6133 #define ___END_SFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c)
6134 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRING,s,&c,___RETURN_POS);
6135 #define ___END_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c)
6136 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST,s,&c,___RETURN_POS);
6137 #define ___END_SFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c)
6138 #define ___BEGIN_SFUN_SCMOBJ_TO_UTF_8STRING(s,c)___STOC3(___SCMOBJ_to_UTF_8STRING,s,&c,___RETURN_POS);
6139 #define ___END_SFUN_SCMOBJ_TO_UTF_8STRING(s,c)
6140 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_8STRING,s,&c,___RETURN_POS);
6141 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c)
6142 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_8STRINGLIST,s,&c,___RETURN_POS);
6143 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c)
6144 #define ___BEGIN_SFUN_SCMOBJ_TO_UTF_16STRING(s,c)___STOC3(___SCMOBJ_to_UTF_16STRING,s,&c,___RETURN_POS);
6145 #define ___END_SFUN_SCMOBJ_TO_UTF_16STRING(s,c)
6146 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_16STRING,s,&c,___RETURN_POS);
6147 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c)
6148 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUTF_16STRINGLIST,s,&c,___RETURN_POS);
6149 #define ___END_SFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c)
6150 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_2STRING(s,c)___STOC3(___SCMOBJ_to_UCS_2STRING,s,&c,___RETURN_POS);
6151 #define ___END_SFUN_SCMOBJ_TO_UCS_2STRING(s,c)
6152 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_2STRING,s,&c,___RETURN_POS);
6153 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c)
6154 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_2STRINGLIST,s,&c,___RETURN_POS);
6155 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c)
6156 #define ___BEGIN_SFUN_SCMOBJ_TO_UCS_4STRING(s,c)___STOC3(___SCMOBJ_to_UCS_4STRING,s,&c,___RETURN_POS);
6157 #define ___END_SFUN_SCMOBJ_TO_UCS_4STRING(s,c)
6158 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_4STRING,s,&c,___RETURN_POS);
6159 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c)
6160 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLUCS_4STRINGLIST,s,&c,___RETURN_POS);
6161 #define ___END_SFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c)
6162 #define ___BEGIN_SFUN_SCMOBJ_TO_WCHARSTRING(s,c)___STOC3(___SCMOBJ_to_WCHARSTRING,s,&c,___RETURN_POS);
6163 #define ___END_SFUN_SCMOBJ_TO_WCHARSTRING(s,c)
6164 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c)___STOC3(___SCMOBJ_to_NONNULLWCHARSTRING,s,&c,___RETURN_POS);
6165 #define ___END_SFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c)
6166 #define ___BEGIN_SFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c)___STOC3(___SCMOBJ_to_NONNULLWCHARSTRINGLIST,s,&c,___RETURN_POS);
6167 #define ___END_SFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c)
6168 #define ___BEGIN_SFUN_SCMOBJ_TO_VARIANT(s,c)___STOC3(___SCMOBJ_to_VARIANT,s,&c,___RETURN_POS);
6169 #define ___END_SFUN_SCMOBJ_TO_VARIANT(s,c)
6171 #define ___BEGIN_SFUN_S8_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S8_to_SCMOBJ,c,&s,i){
6172 #define ___END_SFUN_S8_TO_SCMOBJ(c,s,i)}
6173 #define ___BEGIN_SFUN_U8_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U8_to_SCMOBJ,c,&s,i){
6174 #define ___END_SFUN_U8_TO_SCMOBJ(c,s,i)}
6175 #define ___BEGIN_SFUN_S16_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S16_to_SCMOBJ,c,&s,i){
6176 #define ___END_SFUN_S16_TO_SCMOBJ(c,s,i)}
6177 #define ___BEGIN_SFUN_U16_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U16_to_SCMOBJ,c,&s,i){
6178 #define ___END_SFUN_U16_TO_SCMOBJ(c,s,i)}
6179 #define ___BEGIN_SFUN_S32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S32_to_SCMOBJ,c,&s,i){
6180 #define ___END_SFUN_S32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6181 #define ___BEGIN_SFUN_U32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U32_to_SCMOBJ,c,&s,i){
6182 #define ___END_SFUN_U32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6183 #define ___BEGIN_SFUN_S64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___S64_to_SCMOBJ,c,&s,i){
6184 #define ___END_SFUN_S64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6185 #define ___BEGIN_SFUN_U64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___U64_to_SCMOBJ,c,&s,i){
6186 #define ___END_SFUN_U64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6187 #define ___BEGIN_SFUN_F32_TO_SCMOBJ(c,s,i)___IF_CTOS3(___F32_to_SCMOBJ,c,&s,i){
6188 #define ___END_SFUN_F32_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6189 #define ___BEGIN_SFUN_F64_TO_SCMOBJ(c,s,i)___IF_CTOS3(___F64_to_SCMOBJ,c,&s,i){
6190 #define ___END_SFUN_F64_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6191 #define ___BEGIN_SFUN_CHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___CHAR_to_SCMOBJ,c,&s,i){
6192 #define ___END_SFUN_CHAR_TO_SCMOBJ(c,s,i)}
6193 #define ___BEGIN_SFUN_SCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___SCHAR_to_SCMOBJ,c,&s,i){
6194 #define ___END_SFUN_SCHAR_TO_SCMOBJ(c,s,i)}
6195 #define ___BEGIN_SFUN_UCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCHAR_to_SCMOBJ,c,&s,i){
6196 #define ___END_SFUN_UCHAR_TO_SCMOBJ(c,s,i)}
6197 #define ___BEGIN_SFUN_ISO_8859_1_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ISO_8859_1_to_SCMOBJ,c,&s,i){
6198 #define ___END_SFUN_ISO_8859_1_TO_SCMOBJ(c,s,i)}
6199 #define ___BEGIN_SFUN_UCS_2_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_2_to_SCMOBJ,c,&s,i){
6200 #define ___END_SFUN_UCS_2_TO_SCMOBJ(c,s,i)}
6201 #define ___BEGIN_SFUN_UCS_4_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_4_to_SCMOBJ,c,&s,i){
6202 #define ___END_SFUN_UCS_4_TO_SCMOBJ(c,s,i)}
6203 #define ___BEGIN_SFUN_WCHAR_TO_SCMOBJ(c,s,i)___IF_CTOS3(___WCHAR_to_SCMOBJ,c,&s,i){
6204 #define ___END_SFUN_WCHAR_TO_SCMOBJ(c,s,i)}
6205 #define ___BEGIN_SFUN_SHORT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___SHORT_to_SCMOBJ,c,&s,i){
6206 #define ___END_SFUN_SHORT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6207 #define ___BEGIN_SFUN_USHORT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___USHORT_to_SCMOBJ,c,&s,i){
6208 #define ___END_SFUN_USHORT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6209 #define ___BEGIN_SFUN_INT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___INT_to_SCMOBJ,c,&s,i){
6210 #define ___END_SFUN_INT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6211 #define ___BEGIN_SFUN_UINT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UINT_to_SCMOBJ,c,&s,i){
6212 #define ___END_SFUN_UINT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6213 #define ___BEGIN_SFUN_LONG_TO_SCMOBJ(c,s,i)___IF_CTOS3(___LONG_to_SCMOBJ,c,&s,i){
6214 #define ___END_SFUN_LONG_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6215 #define ___BEGIN_SFUN_ULONG_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ULONG_to_SCMOBJ,c,&s,i){
6216 #define ___END_SFUN_ULONG_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6217 #define ___BEGIN_SFUN_FLOAT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___FLOAT_to_SCMOBJ,c,&s,i){
6218 #define ___END_SFUN_FLOAT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6219 #define ___BEGIN_SFUN_DOUBLE_TO_SCMOBJ(c,s,i)___IF_CTOS3(___DOUBLE_to_SCMOBJ,c,&s,i){
6220 #define ___END_SFUN_DOUBLE_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6221 #define ___BEGIN_SFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___STRUCT_to_SCMOBJ,(void*)c,t,r,&s,i){
6222 #define ___END_SFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6223 #define ___BEGIN_SFUN_UNION_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___UNION_to_SCMOBJ,(void*)c,t,r,&s,i){
6224 #define ___END_SFUN_UNION_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6225 #define ___BEGIN_SFUN_TYPE_TO_SCMOBJ(n,c,t,r,s,i)___IF_CTOS5(___TYPE_to_SCMOBJ,(void*)c,t,r,&s,i){
6226 #define ___END_SFUN_TYPE_TO_SCMOBJ(n,c,t,r,s,i)___EXT(___release_scmobj)(s);}
6227 #define ___BEGIN_SFUN_POINTER_TO_SCMOBJ(c,t,r,s,i)___IF_CTOS5(___POINTER_to_SCMOBJ,(void*)c,t,r,&s,i){
6228 #define ___END_SFUN_POINTER_TO_SCMOBJ(c,t,r,s,i)___EXT(___release_scmobj)(s);}
6229 #define ___BEGIN_SFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s,i)___IF_CTOS5(___NONNULLPOINTER_to_SCMOBJ,(void*)c,t,r,&s,i){
6230 #define ___END_SFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s,i)___EXT(___release_scmobj)(s);}
6231 #define ___BEGIN_SFUN_FUNCTION_TO_SCMOBJ(c,s,i)___IF_CTOS3(___FUNCTION_to_SCMOBJ,___CAST(void*,c),&s,i){
6232 #define ___END_SFUN_FUNCTION_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6233 #define ___BEGIN_SFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLFUNCTION_to_SCMOBJ,___CAST(void*,c),&s,i){
6234 #define ___END_SFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6235 #define ___BEGIN_SFUN_BOOL_TO_SCMOBJ(c,s,i)___IF_CTOS3(___BOOL_to_SCMOBJ,c,&s,i){
6236 #define ___END_SFUN_BOOL_TO_SCMOBJ(c,s,i)}
6237 #define ___BEGIN_SFUN_CHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___CHARSTRING_to_SCMOBJ,c,&s,i){
6238 #define ___END_SFUN_CHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6239 #define ___BEGIN_SFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLCHARSTRING_to_SCMOBJ,c,&s,i){
6240 #define ___END_SFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6241 #define ___BEGIN_SFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLCHARSTRINGLIST_to_SCMOBJ,c,&s,i){
6242 #define ___END_SFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6243 #define ___BEGIN_SFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___ISO_8859_1STRING_to_SCMOBJ,c,&s,i){
6244 #define ___END_SFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6245 #define ___BEGIN_SFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLISO_8859_1STRING_to_SCMOBJ,c,&s,i){
6246 #define ___END_SFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6247 #define ___BEGIN_SFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ,c,&s,i){
6248 #define ___END_SFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6249 #define ___BEGIN_SFUN_UTF_8STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UTF_8STRING_to_SCMOBJ,c,&s,i){
6250 #define ___END_SFUN_UTF_8STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6251 #define ___BEGIN_SFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_8STRING_to_SCMOBJ,c,&s,i){
6252 #define ___END_SFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6253 #define ___BEGIN_SFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_8STRINGLIST_to_SCMOBJ,c,&s,i){
6254 #define ___END_SFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6255 #define ___BEGIN_SFUN_UTF_16STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UTF_16STRING_to_SCMOBJ,c,&s,i){
6256 #define ___END_SFUN_UTF_16STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6257 #define ___BEGIN_SFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_16STRING_to_SCMOBJ,c,&s,i){
6258 #define ___END_SFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6259 #define ___BEGIN_SFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUTF_16STRINGLIST_to_SCMOBJ,c,&s,i){
6260 #define ___END_SFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6261 #define ___BEGIN_SFUN_UCS_2STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_2STRING_to_SCMOBJ,c,&s,i){
6262 #define ___END_SFUN_UCS_2STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6263 #define ___BEGIN_SFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_2STRING_to_SCMOBJ,c,&s,i){
6264 #define ___END_SFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6265 #define ___BEGIN_SFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_2STRINGLIST_to_SCMOBJ,c,&s,i){
6266 #define ___END_SFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6267 #define ___BEGIN_SFUN_UCS_4STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___UCS_4STRING_to_SCMOBJ,c,&s,i){
6268 #define ___END_SFUN_UCS_4STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6269 #define ___BEGIN_SFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_4STRING_to_SCMOBJ,c,&s,i){
6270 #define ___END_SFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6271 #define ___BEGIN_SFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLUCS_4STRINGLIST_to_SCMOBJ,c,&s,i){
6272 #define ___END_SFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6273 #define ___BEGIN_SFUN_WCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___WCHARSTRING_to_SCMOBJ,c,&s,i){
6274 #define ___END_SFUN_WCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6275 #define ___BEGIN_SFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLWCHARSTRING_to_SCMOBJ,c,&s,i){
6276 #define ___END_SFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6277 #define ___BEGIN_SFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___IF_CTOS3(___NONNULLWCHARSTRINGLIST_to_SCMOBJ,c,&s,i){
6278 #define ___END_SFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6279 #define ___BEGIN_SFUN_VARIANT_TO_SCMOBJ(c,s,i)___IF_CTOS3(___VARIANT_to_SCMOBJ,c,&s,i){
6280 #define ___END_SFUN_VARIANT_TO_SCMOBJ(c,s,i)___EXT(___release_scmobj)(s);}
6283 #define ___SFUN_CAST_AND_DEREF(type,arg)(*___CAST(type,arg))
6284 #define ___SFUN_CAST(type,arg)___CAST(type,arg)
6286 #define ___BEGIN_SFUN_COPY_STRUCT(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,struct n,arg);
6287 #define ___END_SFUN_COPY_STRUCT(n,r,arg)}
6288 #define ___BEGIN_SFUN_COPY_UNION(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,union n,arg);
6289 #define ___END_SFUN_COPY_UNION(n,r,arg)}
6290 #define ___BEGIN_SFUN_COPY_TYPE(n,r,arg){ void *r; ___ASSIGN_NEW_WITH_INIT(r,n,arg);
6291 #define ___END_SFUN_COPY_TYPE(n,r,arg)}
6293 #define ___CFUN_CAST_AND_DEREF(type,arg)(*___CAST(type,arg))
6294 #define ___CFUN_CAST(type,arg)___CAST(type,arg)
6296 #define ___CFUN_CALL_VOID(call)call;
6297 #define ___CFUN_CALL(r,call)r = call;
6298 #define ___CFUN_CALL_STRUCT(n,r,call)___ASSIGN_NEW_WITH_INIT(r,struct n,call);
6299 #define ___CFUN_CALL_UNION(n,r,call)___ASSIGN_NEW_WITH_INIT(r,union n,call);
6300 #define ___CFUN_CALL_TYPE(n,r,call)___ASSIGN_NEW_WITH_INIT(r,n,call);
6301 #define ___CFUN_CALL_POINTER(r,call)r = call;
6302 #define ___CFUN_CALL_NONNULLPOINTER(r,call)r = call;
6303 #define ___CFUN_CALL_FUNCTION(r,call)r = call;
6304 #define ___CFUN_CALL_NONNULLFUNCTION(r,call)r = call;
6306 #define ___BEGIN_CFUN_BODY
6307 #define ___END_CFUN_BODY ___AT_END
6308 #define ___BEGIN_CFUN_BODY_CLEANUP ___W_ALL ___BEGIN_TRY
6309 #define ___END_CFUN_BODY_CLEANUP ___AT_END ___END_TRY ___R_ALL
6311 #define ___BEGIN_CFUN_VOID ___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___errmsg=___FAL;
6312 #define ___CFUN_SET_RESULT_VOID ___CFUN_RESULT = ___VOID;
6313 #define ___CFUN_ERROR_VOID ___CFUN_CONV_ERROR
6314 #define ___CFUN_ERROR_CLEANUP_VOID ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6315 #define ___END_CFUN_VOID } ___R_ALL
6317 #define ___BEGIN_CFUN_SCMOBJ ___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___result;___SCMOBJ ___errmsg=___FAL;
6318 #define ___CFUN_SET_RESULT_SCMOBJ ___CFUN_RESULT = ___result;
6319 #define ___CFUN_ERROR_SCMOBJ ___CFUN_CONV_ERROR
6320 #define ___CFUN_ERROR_CLEANUP_SCMOBJ ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6321 #define ___END_CFUN_SCMOBJ } ___R_ALL
6323 #define ___BEGIN_CFUN(decl)___SET_STK(-___FRAME_STACK_RA,___R0) ___W_ALL {___SCMOBJ ___err=___FIX(___NO_ERR);___SCMOBJ ___errmsg=___FAL;decl;
6324 #define ___CFUN_SET_RESULT /* done in conversion function */
6325 #define ___CFUN_ERROR ___CFUN_CONV_ERROR
6326 #define ___CFUN_ERROR_CLEANUP ___CFUN_CONV_ERROR ___EXT(___propagate_error) (___err);
6327 #define ___END_CFUN } ___R_ALL
6329 #define ___BEGIN_CFUN_ARG(i,decl)decl;
6330 #define ___END_CFUN_ARG(i)
6331 #define ___BEGIN_CFUN_ARG_SCMOBJ(i)
6332 #define ___END_CFUN_ARG_SCMOBJ(i)
6333 #define ___CFUN_ARG(i)___PSSTK((i-___FRAME_SPACE(___NARGS+1)))
6334 #define ___CFUN_RESULT ___PSR1
6336 #define ___BEGIN_CFUN_SCMOBJ_TO_S8(s,c,i)___IF_STOC3(___SCMOBJ_to_S8,s,&c,i){
6337 #define ___END_CFUN_SCMOBJ_TO_S8(s,c,i)}
6338 #define ___BEGIN_CFUN_SCMOBJ_TO_U8(s,c,i)___IF_STOC3(___SCMOBJ_to_U8,s,&c,i){
6339 #define ___END_CFUN_SCMOBJ_TO_U8(s,c,i)}
6340 #define ___BEGIN_CFUN_SCMOBJ_TO_S16(s,c,i)___IF_STOC3(___SCMOBJ_to_S16,s,&c,i){
6341 #define ___END_CFUN_SCMOBJ_TO_S16(s,c,i)}
6342 #define ___BEGIN_CFUN_SCMOBJ_TO_U16(s,c,i)___IF_STOC3(___SCMOBJ_to_U16,s,&c,i){
6343 #define ___END_CFUN_SCMOBJ_TO_U16(s,c,i)}
6344 #define ___BEGIN_CFUN_SCMOBJ_TO_S32(s,c,i)___IF_STOC3(___SCMOBJ_to_S32,s,&c,i){
6345 #define ___END_CFUN_SCMOBJ_TO_S32(s,c,i)}
6346 #define ___BEGIN_CFUN_SCMOBJ_TO_U32(s,c,i)___IF_STOC3(___SCMOBJ_to_U32,s,&c,i){
6347 #define ___END_CFUN_SCMOBJ_TO_U32(s,c,i)}
6348 #define ___BEGIN_CFUN_SCMOBJ_TO_S64(s,c,i)___IF_STOC3(___SCMOBJ_to_S64,s,&c,i){
6349 #define ___END_CFUN_SCMOBJ_TO_S64(s,c,i)}
6350 #define ___BEGIN_CFUN_SCMOBJ_TO_U64(s,c,i)___IF_STOC3(___SCMOBJ_to_U64,s,&c,i){
6351 #define ___END_CFUN_SCMOBJ_TO_U64(s,c,i)}
6352 #define ___BEGIN_CFUN_SCMOBJ_TO_F32(s,c,i)___IF_STOC3(___SCMOBJ_to_F32,s,&c,i){
6353 #define ___END_CFUN_SCMOBJ_TO_F32(s,c,i)}
6354 #define ___BEGIN_CFUN_SCMOBJ_TO_F64(s,c,i)___IF_STOC3(___SCMOBJ_to_F64,s,&c,i){
6355 #define ___END_CFUN_SCMOBJ_TO_F64(s,c,i)}
6356 #define ___BEGIN_CFUN_SCMOBJ_TO_CHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_CHAR,s,&c,i){
6357 #define ___END_CFUN_SCMOBJ_TO_CHAR(s,c,i)}
6358 #define ___BEGIN_CFUN_SCMOBJ_TO_SCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_SCHAR,s,&c,i){
6359 #define ___END_CFUN_SCMOBJ_TO_SCHAR(s,c,i)}
6360 #define ___BEGIN_CFUN_SCMOBJ_TO_UCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_UCHAR,s,&c,i){
6361 #define ___END_CFUN_SCMOBJ_TO_UCHAR(s,c,i)}
6362 #define ___BEGIN_CFUN_SCMOBJ_TO_ISO_8859_1(s,c,i)___IF_STOC3(___SCMOBJ_to_ISO_8859_1,s,&c,i){
6363 #define ___END_CFUN_SCMOBJ_TO_ISO_8859_1(s,c,i)}
6364 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_2(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_2,s,&c,i){
6365 #define ___END_CFUN_SCMOBJ_TO_UCS_2(s,c,i)}
6366 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_4(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_4,s,&c,i){
6367 #define ___END_CFUN_SCMOBJ_TO_UCS_4(s,c,i)}
6368 #define ___BEGIN_CFUN_SCMOBJ_TO_WCHAR(s,c,i)___IF_STOC3(___SCMOBJ_to_WCHAR,s,&c,i){
6369 #define ___END_CFUN_SCMOBJ_TO_WCHAR(s,c,i)}
6370 #define ___BEGIN_CFUN_SCMOBJ_TO_SHORT(s,c,i)___IF_STOC3(___SCMOBJ_to_SHORT,s,&c,i){
6371 #define ___END_CFUN_SCMOBJ_TO_SHORT(s,c,i)}
6372 #define ___BEGIN_CFUN_SCMOBJ_TO_USHORT(s,c,i)___IF_STOC3(___SCMOBJ_to_USHORT,s,&c,i){
6373 #define ___END_CFUN_SCMOBJ_TO_USHORT(s,c,i)}
6374 #define ___BEGIN_CFUN_SCMOBJ_TO_INT(s,c,i)___IF_STOC3(___SCMOBJ_to_INT,s,&c,i){
6375 #define ___END_CFUN_SCMOBJ_TO_INT(s,c,i)}
6376 #define ___BEGIN_CFUN_SCMOBJ_TO_UINT(s,c,i)___IF_STOC3(___SCMOBJ_to_UINT,s,&c,i){
6377 #define ___END_CFUN_SCMOBJ_TO_UINT(s,c,i)}
6378 #define ___BEGIN_CFUN_SCMOBJ_TO_LONG(s,c,i)___IF_STOC3(___SCMOBJ_to_LONG,s,&c,i){
6379 #define ___END_CFUN_SCMOBJ_TO_LONG(s,c,i)}
6380 #define ___BEGIN_CFUN_SCMOBJ_TO_ULONG(s,c,i)___IF_STOC3(___SCMOBJ_to_ULONG,s,&c,i){
6381 #define ___END_CFUN_SCMOBJ_TO_ULONG(s,c,i)}
6382 #define ___BEGIN_CFUN_SCMOBJ_TO_FLOAT(s,c,i)___IF_STOC3(___SCMOBJ_to_FLOAT,s,&c,i){
6383 #define ___END_CFUN_SCMOBJ_TO_FLOAT(s,c,i)}
6384 #define ___BEGIN_CFUN_SCMOBJ_TO_DOUBLE(s,c,i)___IF_STOC3(___SCMOBJ_to_DOUBLE,s,&c,i){
6385 #define ___END_CFUN_SCMOBJ_TO_DOUBLE(s,c,i)}
6386 #define ___BEGIN_CFUN_SCMOBJ_TO_STRUCT(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_STRUCT,s,(void**)&c,t,i){
6387 #define ___END_CFUN_SCMOBJ_TO_STRUCT(n,s,c,t,i)}
6388 #define ___BEGIN_CFUN_SCMOBJ_TO_UNION(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_UNION,s,(void**)&c,t,i){
6389 #define ___END_CFUN_SCMOBJ_TO_UNION(n,s,c,t,i)}
6390 #define ___BEGIN_CFUN_SCMOBJ_TO_TYPE(n,s,c,t,i)___IF_STOC4(___SCMOBJ_to_TYPE,s,(void**)&c,t,i){
6391 #define ___END_CFUN_SCMOBJ_TO_TYPE(n,s,c,t,i)}
6392 #define ___BEGIN_CFUN_SCMOBJ_TO_POINTER(s,c,t,i)___IF_STOC4(___SCMOBJ_to_POINTER,s,(void**)&c,t,i){
6393 #define ___END_CFUN_SCMOBJ_TO_POINTER(s,c,t,i)}
6394 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t,i)___IF_STOC4(___SCMOBJ_to_NONNULLPOINTER,s,(void**)&c,t,i){
6395 #define ___END_CFUN_SCMOBJ_TO_NONNULLPOINTER(s,c,t,i)}
6396 #define ___BEGIN_CFUN_SCMOBJ_TO_FUNCTION(s,cnv,c,i)___IF_STOC4(___SCMOBJ_to_FUNCTION,s,(void*)cnv,(void**)&c,i){
6397 #define ___END_CFUN_SCMOBJ_TO_FUNCTION(s,cnv,c,i)___EXT(___release_function)(c);}
6398 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c,i)___IF_STOC4(___SCMOBJ_to_NONNULLFUNCTION,s,(void*)cnv,(void**)&c,i){
6399 #define ___END_CFUN_SCMOBJ_TO_NONNULLFUNCTION(s,cnv,c,i)___EXT(___release_function)(c);}
6400 #define ___BEGIN_CFUN_SCMOBJ_TO_BOOL(s,c,i)___IF_STOC3(___SCMOBJ_to_BOOL,s,&c,i){
6401 #define ___END_CFUN_SCMOBJ_TO_BOOL(s,c,i)}
6402 #define ___BEGIN_CFUN_SCMOBJ_TO_CHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_CHARSTRING,s,&c,i){
6403 #define ___END_CFUN_SCMOBJ_TO_CHARSTRING(s,c,i)___EXT(___release_string)(c);}
6404 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLCHARSTRING,s,&c,i){
6405 #define ___END_CFUN_SCMOBJ_TO_NONNULLCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6406 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLCHARSTRINGLIST,s,&c,i){
6407 #define ___END_CFUN_SCMOBJ_TO_NONNULLCHARSTRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6408 #define ___BEGIN_CFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_ISO_8859_1STRING,s,&c,i){
6409 #define ___END_CFUN_SCMOBJ_TO_ISO_8859_1STRING(s,c,i)___EXT(___release_string)(c);}
6410 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRING,s,&c,i){
6411 #define ___END_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRING(s,c,i)___EXT(___release_string)(c);}
6412 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST,s,&c,i){
6413 #define ___END_CFUN_SCMOBJ_TO_NONNULLISO_8859_1STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6414 #define ___BEGIN_CFUN_SCMOBJ_TO_UTF_8STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UTF_8STRING,s,&c,i){
6415 #define ___END_CFUN_SCMOBJ_TO_UTF_8STRING(s,c,i)___EXT(___release_string)(c);}
6416 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_8STRING,s,&c,i){
6417 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_8STRING(s,c,i)___EXT(___release_string)(c);}
6418 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_8STRINGLIST,s,&c,i){
6419 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_8STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6420 #define ___BEGIN_CFUN_SCMOBJ_TO_UTF_16STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UTF_16STRING,s,&c,i){
6421 #define ___END_CFUN_SCMOBJ_TO_UTF_16STRING(s,c,i)___EXT(___release_string)(c);}
6422 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_16STRING,s,&c,i){
6423 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_16STRING(s,c,i)___EXT(___release_string)(c);}
6424 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUTF_16STRINGLIST,s,&c,i){
6425 #define ___END_CFUN_SCMOBJ_TO_NONNULLUTF_16STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6426 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_2STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_2STRING,s,&c,i){
6427 #define ___END_CFUN_SCMOBJ_TO_UCS_2STRING(s,c,i)___EXT(___release_string)(c);}
6428 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_2STRING,s,&c,i){
6429 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_2STRING(s,c,i)___EXT(___release_string)(c);}
6430 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_2STRINGLIST,s,&c,i){
6431 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_2STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6432 #define ___BEGIN_CFUN_SCMOBJ_TO_UCS_4STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_UCS_4STRING,s,&c,i){
6433 #define ___END_CFUN_SCMOBJ_TO_UCS_4STRING(s,c,i)___EXT(___release_string)(c);}
6434 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_4STRING,s,&c,i){
6435 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_4STRING(s,c,i)___EXT(___release_string)(c);}
6436 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLUCS_4STRINGLIST,s,&c,i){
6437 #define ___END_CFUN_SCMOBJ_TO_NONNULLUCS_4STRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6438 #define ___BEGIN_CFUN_SCMOBJ_TO_WCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_WCHARSTRING,s,&c,i){
6439 #define ___END_CFUN_SCMOBJ_TO_WCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6440 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLWCHARSTRING,s,&c,i){
6441 #define ___END_CFUN_SCMOBJ_TO_NONNULLWCHARSTRING(s,c,i)___EXT(___release_string)(c);}
6442 #define ___BEGIN_CFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c,i)___IF_STOC3(___SCMOBJ_to_NONNULLWCHARSTRINGLIST,s,&c,i){
6443 #define ___END_CFUN_SCMOBJ_TO_NONNULLWCHARSTRINGLIST(s,c,i)___EXT(___release_string_list)(c);}
6444 #define ___BEGIN_CFUN_SCMOBJ_TO_VARIANT(s,c,i)___IF_STOC3(___SCMOBJ_to_VARIANT,s,&c,i){
6445 #define ___END_CFUN_SCMOBJ_TO_VARIANT(s,c,i)___EXT(___release_variant)(c);}
6447 #define ___BEGIN_CFUN_S8_TO_SCMOBJ(c,s)___CTOS3(___S8_to_SCMOBJ,c,&s,___RETURN_POS);
6448 #define ___END_CFUN_S8_TO_SCMOBJ(c,s)
6449 #define ___BEGIN_CFUN_U8_TO_SCMOBJ(c,s)___CTOS3(___U8_to_SCMOBJ,c,&s,___RETURN_POS);
6450 #define ___END_CFUN_U8_TO_SCMOBJ(c,s)
6451 #define ___BEGIN_CFUN_S16_TO_SCMOBJ(c,s)___CTOS3(___S16_to_SCMOBJ,c,&s,___RETURN_POS);
6452 #define ___END_CFUN_S16_TO_SCMOBJ(c,s)
6453 #define ___BEGIN_CFUN_U16_TO_SCMOBJ(c,s)___CTOS3(___U16_to_SCMOBJ,c,&s,___RETURN_POS);
6454 #define ___END_CFUN_U16_TO_SCMOBJ(c,s)
6455 #define ___BEGIN_CFUN_S32_TO_SCMOBJ(c,s)___IF_CTOS3(___S32_to_SCMOBJ,c,&s,___RETURN_POS){
6456 #define ___END_CFUN_S32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6457 #define ___BEGIN_CFUN_U32_TO_SCMOBJ(c,s)___IF_CTOS3(___U32_to_SCMOBJ,c,&s,___RETURN_POS){
6458 #define ___END_CFUN_U32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6459 #define ___BEGIN_CFUN_S64_TO_SCMOBJ(c,s)___IF_CTOS3(___S64_to_SCMOBJ,c,&s,___RETURN_POS){
6460 #define ___END_CFUN_S64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6461 #define ___BEGIN_CFUN_U64_TO_SCMOBJ(c,s)___IF_CTOS3(___U64_to_SCMOBJ,c,&s,___RETURN_POS){
6462 #define ___END_CFUN_U64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6463 #define ___BEGIN_CFUN_F32_TO_SCMOBJ(c,s)___IF_CTOS3(___F32_to_SCMOBJ,c,&s,___RETURN_POS){
6464 #define ___END_CFUN_F32_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6465 #define ___BEGIN_CFUN_F64_TO_SCMOBJ(c,s)___IF_CTOS3(___F64_to_SCMOBJ,c,&s,___RETURN_POS){
6466 #define ___END_CFUN_F64_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6467 #define ___BEGIN_CFUN_CHAR_TO_SCMOBJ(c,s)___CTOS3(___CHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6468 #define ___END_CFUN_CHAR_TO_SCMOBJ(c,s)
6469 #define ___BEGIN_CFUN_SCHAR_TO_SCMOBJ(c,s)___CTOS3(___SCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6470 #define ___END_CFUN_SCHAR_TO_SCMOBJ(c,s)
6471 #define ___BEGIN_CFUN_UCHAR_TO_SCMOBJ(c,s)___CTOS3(___UCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6472 #define ___END_CFUN_UCHAR_TO_SCMOBJ(c,s)
6473 #define ___BEGIN_CFUN_ISO_8859_1_TO_SCMOBJ(c,s)___CTOS3(___ISO_8859_1_to_SCMOBJ,c,&s,___RETURN_POS);
6474 #define ___END_CFUN_ISO_8859_1_TO_SCMOBJ(c,s)
6475 #define ___BEGIN_CFUN_UCS_2_TO_SCMOBJ(c,s)___CTOS3(___UCS_2_to_SCMOBJ,c,&s,___RETURN_POS);
6476 #define ___END_CFUN_UCS_2_TO_SCMOBJ(c,s)
6477 #define ___BEGIN_CFUN_UCS_4_TO_SCMOBJ(c,s)___CTOS3(___UCS_4_to_SCMOBJ,c,&s,___RETURN_POS);
6478 #define ___END_CFUN_UCS_4_TO_SCMOBJ(c,s)
6479 #define ___BEGIN_CFUN_WCHAR_TO_SCMOBJ(c,s)___CTOS3(___WCHAR_to_SCMOBJ,c,&s,___RETURN_POS);
6480 #define ___END_CFUN_WCHAR_TO_SCMOBJ(c,s)
6481 #define ___BEGIN_CFUN_SHORT_TO_SCMOBJ(c,s)___IF_CTOS3(___SHORT_to_SCMOBJ,c,&s,___RETURN_POS){
6482 #define ___END_CFUN_SHORT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6483 #define ___BEGIN_CFUN_USHORT_TO_SCMOBJ(c,s)___IF_CTOS3(___USHORT_to_SCMOBJ,c,&s,___RETURN_POS){
6484 #define ___END_CFUN_USHORT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6485 #define ___BEGIN_CFUN_INT_TO_SCMOBJ(c,s)___IF_CTOS3(___INT_to_SCMOBJ,c,&s,___RETURN_POS){
6486 #define ___END_CFUN_INT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6487 #define ___BEGIN_CFUN_UINT_TO_SCMOBJ(c,s)___IF_CTOS3(___UINT_to_SCMOBJ,c,&s,___RETURN_POS){
6488 #define ___END_CFUN_UINT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6489 #define ___BEGIN_CFUN_LONG_TO_SCMOBJ(c,s)___IF_CTOS3(___LONG_to_SCMOBJ,c,&s,___RETURN_POS){
6490 #define ___END_CFUN_LONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6491 #define ___BEGIN_CFUN_ULONG_TO_SCMOBJ(c,s)___IF_CTOS3(___ULONG_to_SCMOBJ,c,&s,___RETURN_POS){
6492 #define ___END_CFUN_ULONG_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6493 #define ___BEGIN_CFUN_FLOAT_TO_SCMOBJ(c,s)___IF_CTOS3(___FLOAT_to_SCMOBJ,c,&s,___RETURN_POS){
6494 #define ___END_CFUN_FLOAT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6495 #define ___BEGIN_CFUN_DOUBLE_TO_SCMOBJ(c,s)___IF_CTOS3(___DOUBLE_to_SCMOBJ,c,&s,___RETURN_POS){
6496 #define ___END_CFUN_DOUBLE_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6497 #define ___BEGIN_CFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___STRUCT_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6498 #define ___END_CFUN_STRUCT_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6499 #define ___BEGIN_CFUN_UNION_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___UNION_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6500 #define ___END_CFUN_UNION_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6501 #define ___BEGIN_CFUN_TYPE_TO_SCMOBJ(n,c,t,r,s)___IF_CTOS5(___TYPE_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6502 #define ___END_CFUN_TYPE_TO_SCMOBJ(n,c,t,r,s)___EXT(___release_scmobj)(s);}
6503 #define ___BEGIN_CFUN_POINTER_TO_SCMOBJ(c,t,r,s)___IF_CTOS5(___POINTER_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6504 #define ___END_CFUN_POINTER_TO_SCMOBJ(c,t,r,s)___EXT(___release_scmobj)(s);}
6505 #define ___BEGIN_CFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s)___IF_CTOS5(___NONNULLPOINTER_to_SCMOBJ,(void*)c,t,r,&s,___RETURN_POS){
6506 #define ___END_CFUN_NONNULLPOINTER_TO_SCMOBJ(c,t,r,s)___EXT(___release_scmobj)(s);}
6507 #define ___BEGIN_CFUN_FUNCTION_TO_SCMOBJ(c,s)___IF_CTOS3(___FUNCTION_to_SCMOBJ,___CAST(void*,c),&s,___RETURN_POS){
6508 #define ___END_CFUN_FUNCTION_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6509 #define ___BEGIN_CFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLFUNCTION_to_SCMOBJ,___CAST(void*,c),&s,___RETURN_POS){
6510 #define ___END_CFUN_NONNULLFUNCTION_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6511 #define ___BEGIN_CFUN_BOOL_TO_SCMOBJ(c,s)___CTOS3(___BOOL_to_SCMOBJ,c,&s,___RETURN_POS);
6512 #define ___END_CFUN_BOOL_TO_SCMOBJ(c,s)
6513 #define ___BEGIN_CFUN_CHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___CHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6514 #define ___END_CFUN_CHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6515 #define ___BEGIN_CFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6516 #define ___END_CFUN_NONNULLCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6517 #define ___BEGIN_CFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLCHARSTRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6518 #define ___END_CFUN_NONNULLCHARSTRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6519 #define ___BEGIN_CFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___ISO_8859_1STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6520 #define ___END_CFUN_ISO_8859_1STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6521 #define ___BEGIN_CFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLISO_8859_1STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6522 #define ___END_CFUN_NONNULLISO_8859_1STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6523 #define ___BEGIN_CFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6524 #define ___END_CFUN_NONNULLISO_8859_1STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6525 #define ___BEGIN_CFUN_UTF_8STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UTF_8STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6526 #define ___END_CFUN_UTF_8STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6527 #define ___BEGIN_CFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_8STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6528 #define ___END_CFUN_NONNULLUTF_8STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6529 #define ___BEGIN_CFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_8STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6530 #define ___END_CFUN_NONNULLUTF_8STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6531 #define ___BEGIN_CFUN_UTF_16STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UTF_16STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6532 #define ___END_CFUN_UTF_16STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6533 #define ___BEGIN_CFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_16STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6534 #define ___END_CFUN_NONNULLUTF_16STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6535 #define ___BEGIN_CFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUTF_16STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6536 #define ___END_CFUN_NONNULLUTF_16STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6537 #define ___BEGIN_CFUN_UCS_2STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UCS_2STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6538 #define ___END_CFUN_UCS_2STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6539 #define ___BEGIN_CFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_2STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6540 #define ___END_CFUN_NONNULLUCS_2STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6541 #define ___BEGIN_CFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_2STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6542 #define ___END_CFUN_NONNULLUCS_2STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6543 #define ___BEGIN_CFUN_UCS_4STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___UCS_4STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6544 #define ___END_CFUN_UCS_4STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6545 #define ___BEGIN_CFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_4STRING_to_SCMOBJ,c,&s,___RETURN_POS){
6546 #define ___END_CFUN_NONNULLUCS_4STRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6547 #define ___BEGIN_CFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLUCS_4STRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6548 #define ___END_CFUN_NONNULLUCS_4STRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6549 #define ___BEGIN_CFUN_WCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___WCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6550 #define ___END_CFUN_WCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6551 #define ___BEGIN_CFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLWCHARSTRING_to_SCMOBJ,c,&s,___RETURN_POS){
6552 #define ___END_CFUN_NONNULLWCHARSTRING_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6553 #define ___BEGIN_CFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s)___IF_CTOS3(___NONNULLWCHARSTRINGLIST_to_SCMOBJ,c,&s,___RETURN_POS){
6554 #define ___END_CFUN_NONNULLWCHARSTRINGLIST_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6555 #define ___BEGIN_CFUN_VARIANT_TO_SCMOBJ(c,s)___IF_CTOS3(___VARIANT_to_SCMOBJ,c,&s,___RETURN_POS){
6556 #define ___END_CFUN_VARIANT_TO_SCMOBJ(c,s)___EXT(___release_scmobj)(s);}
6558 #endif
6560 /*---------------------------------------------------------------------------*/
6562 #ifndef ___DEFINES_ONLY
6564 #ifdef _MSC_VER
6565 #ifdef ___DYNAMIC
6566 int _fltused; /* needed if floating-point used. */
6567 #endif
6568 #endif
6570 #ifdef __BORLANDC__
6571 #ifdef __WIN32__
6572 #ifndef ___OS_WIN32
6573 #define ___OS_WIN32
6574 #endif
6575 #endif
6576 #ifdef ___SHARED
6577 #define _RTLDLL
6578 #endif
6579 #endif
6581 #ifdef ___OS_WIN32
6583 #ifndef _WIN32_WINNT
6584 #define _WIN32_WINNT 0x0501
6585 #endif
6587 #ifndef ___DONT_HAVE_WINSOCK2_H
6588 #include <winsock2.h>
6589 #endif
6591 #ifndef ___DONT_HAVE_WINDOWS_H
6592 #include <windows.h>
6593 #endif
6595 #endif
6597 #ifdef ___USE_CPLUSPLUS_NEW_DELETE
6599 #ifndef ___DONT_HAVE_NEW
6600 #include <new>
6601 #endif
6603 #endif
6605 #ifndef ___DONT_HAVE_MATH_H
6606 #include <math.h>
6607 #endif
6609 #ifdef ___USE_SETJMP
6611 typedef struct ___jmpbuf_struct
6613 jmp_buf buf;
6614 } ___jmpbuf_struct;
6616 #else
6618 typedef struct ___throw_struct
6620 ___SCMOBJ err;
6621 } ___throw_struct;
6623 #endif
6625 typedef void *___VARIANT; /* not yet implemented */
6627 #ifdef ___BUILTIN_64BIT_INT_TYPE
6630 * If the symbol ___BUILTIN_64BIT_INT_TYPE is defined then the data
6631 * types ___S64 and ___U64 are builtin integer types.
6634 #define ___S64_from_SM32(val) \
6635 ___CAST_S64(___CAST_S32(val))
6637 #define ___S64_from_SM32_UM32(hi32,lo32) \
6638 ((___CAST_S64(___CAST_S32(hi32)) << 32) + ___CAST_S64(___CAST_U32(lo32)))
6640 #define ___S64_from_LONGLONG(val) \
6641 ___CAST_S64(val)
6643 #define ___S64_to_LONGLONG(val) \
6644 ___CAST(___LONGLONG,val)
6646 #define ___S64_fits_in_width(val,width) \
6647 ((((val) >> ((width)-1)) == 0) || (((val) >> ((width)-1)) == -1))
6649 #define ___S64_hi32(val)___CAST_S32((val) >> 32)
6650 #define ___S64_lo32(val)___CAST_U32(val)
6652 #define ___U64_from_UM32(val) \
6653 ___CAST_U64(___CAST_U32(val))
6655 #define ___U64_from_UM32_UM32(hi32,lo32) \
6656 ((___CAST_U64(___CAST_U32(hi32)) << 32) + ___CAST_U64(___CAST_U32(lo32)))
6658 #define ___U64_from_ULONGLONG(val) \
6659 ___CAST_U64(val)
6661 #define ___U64_to_ULONGLONG(val) \
6662 ___CAST(___ULONGLONG,val)
6664 #define ___U64_fits_in_width(val,width) \
6665 (((val) >> (width)) == 0)
6667 #define ___U64_mul_UM32_UM32(x,y) \
6668 (___CAST_U64(___CAST_U32(x)) * ___CAST_U32(y))
6670 #define ___U64_add_U64_U64(x,y) \
6671 (___CAST_U64(x) + ___CAST_U64(y))
6673 #define ___U64_hi32(val)___CAST_U32((val) >> 32)
6674 #define ___U64_lo32(val)___CAST_U32(val)
6676 #else
6679 * If the symbol ___BUILTIN_64BIT_INT_TYPE is not defined then the
6680 * data types ___S64 and ___U64 are structures.
6683 typedef struct
6685 #ifdef ___BIG_ENDIAN
6686 ___S32 hi32;
6687 ___U32 lo32;
6688 #else
6689 ___U32 lo32;
6690 ___S32 hi32;
6691 #endif
6692 } ___S64;
6694 typedef struct
6696 #ifdef ___BIG_ENDIAN
6697 ___U32 hi32;
6698 ___U32 lo32;
6699 #else
6700 ___U32 lo32;
6701 ___U32 hi32;
6702 #endif
6703 } ___U64;
6705 #define ___S64_from_SM32(val) \
6706 ___EXT(___S64_from_SM32_fn) (val)
6708 #define ___S64_from_SM32_UM32(hi32,lo32) \
6709 ___EXT(___S64_from_SM32_UM32_fn) (hi32,lo32)
6711 #define ___S64_from_LONGLONG(val) \
6712 ___EXT(___S64_from_LONGLONG_fn) (val)
6714 #define ___S64_to_LONGLONG(val) \
6715 ___EXT(___S64_to_LONGLONG_fn) (val)
6717 #define ___S64_fits_in_width(val,width) \
6718 ___EXT(___S64_fits_in_width_fn) (val,width)
6720 #define ___S64_hi32(val)val.hi32
6721 #define ___S64_lo32(val)val.lo32
6723 #define ___U64_from_UM32(val) \
6724 ___EXT(___U64_from_UM32_fn) (val)
6726 #define ___U64_from_UM32_UM32(hi32,lo32) \
6727 ___EXT(___U64_from_UM32_UM32_fn) (hi32,lo32)
6729 #define ___U64_from_ULONGLONG(val) \
6730 ___EXT(___U64_from_ULONGLONG_fn) (val)
6732 #define ___U64_to_ULONGLONG(val) \
6733 ___EXT(___U64_to_ULONGLONG_fn) (val)
6735 #define ___U64_fits_in_width(val,width) \
6736 ___EXT(___U64_fits_in_width_fn) (val,width)
6738 #define ___U64_mul_UM32_UM32(x,y) \
6739 ___EXT(___U64_mul_UM32_UM32_fn) (x,y)
6741 #define ___U64_add_U64_U64(x,y) \
6742 ___EXT(___U64_add_U64_U64_fn) (x,y)
6744 #define ___U64_hi32(val)val.hi32
6745 #define ___U64_lo32(val)val.lo32
6747 #endif
6749 /* Symbol/keyword structure */
6751 typedef ___FAKEWORD ___symkey_struct[5+___PADDING_SIZE];
6753 /* Global variable structure */
6755 typedef struct ___glo_struct
6757 ___WORD val, prm, next;
6758 } ___glo_struct;
6760 /* Processor structure */
6762 typedef struct ___processor_state_struct
6764 ___WORD *stack_trip;
6765 ___WORD *stack_limit;
6766 ___WORD *fp;
6767 ___WORD *stack_start;
6768 ___WORD *stack_break;
6770 ___WORD *heap_limit;
6771 ___WORD *hp;
6773 ___WORD current_thread;
6774 ___WORD run_queue;
6776 ___WORD r[___NB_GVM_REGS];
6777 ___WORD pc;
6778 ___WORD temp1;
6779 ___WORD temp2;
6780 ___WORD temp3;
6781 ___WORD temp4;
6783 int na;
6784 ___BOOL intr_enabled;
6785 ___BOOL intr_flag[___NB_INTRS];
6787 ___WORD glo_list_head;
6788 ___WORD glo_list_tail;
6790 ___WORD executable_wills;
6791 ___WORD nonexecutable_wills;
6793 void (*dummy8) ___PVOID;
6794 void (*dummy7) ___PVOID;
6795 void (*dummy6) ___PVOID;
6796 void (*dummy5) ___PVOID;
6797 void (*dummy4) ___PVOID;
6798 void (*dummy3) ___PVOID;
6799 void (*dummy2) ___PVOID;
6800 void (*dummy1) ___PVOID;
6802 #ifdef ___USE_SETJMP
6803 ___jmpbuf_struct *catcher;
6804 #endif
6806 #ifdef ___DEBUG_STACK_LIMIT
6807 int poll_line;
6808 char *poll_file;
6809 int stack_limit_line;
6810 char *stack_limit_file;
6811 #endif
6813 #ifdef ___DEBUG_HEAP_LIMIT
6814 int check_heap_line;
6815 char *check_heap_file;
6816 int heap_limit_line;
6817 char *heap_limit_file;
6818 #endif
6819 } ___processor_state_struct, *___processor_state;
6821 typedef ___WORD (*___host) ___P((___processor_state),());
6823 typedef struct ___label_struct
6825 ___WORD header;
6826 ___WORD entry_or_descr;
6827 ___FAKEVOIDSTAR host_label;
6828 ___FAKEHOST host;
6829 } ___label_struct;
6831 /* Module structure */
6833 typedef struct ___module_struct
6835 int version;
6836 int kind;
6837 ___UTF_8STRING name;
6838 int flags;
6839 ___FAKEWORD *glo_tbl; int glo_count; int sup_count;
6840 ___UTF_8STRING *glo_names;
6841 ___FAKEWORD *sym_tbl; int sym_count;
6842 ___UTF_8STRING *sym_names;
6843 ___FAKEWORD *key_tbl; int key_count;
6844 ___UTF_8STRING *key_names;
6845 ___WORD *lp;
6846 ___label_struct *lbl_tbl; int lbl_count;
6847 ___WORD *ofd_tbl; int ofd_length;
6848 ___WORD *cns_tbl; int cns_count;
6849 ___FAKEWORD *sub_tbl; int sub_count;
6850 ___WORD (*init_proc) ___PVOID;
6851 ___UTF_8STRING script_line;
6852 struct ___module_struct *next;
6854 void (*dummy8) ___PVOID;
6855 void (*dummy7) ___PVOID;
6856 void (*dummy6) ___PVOID;
6857 void (*dummy5) ___PVOID;
6858 void (*dummy4) ___PVOID;
6859 void (*dummy3) ___PVOID;
6860 void (*dummy2) ___PVOID;
6861 void (*dummy1) ___PVOID;
6862 } ___module_struct;
6864 /* Linkfile structure */
6866 typedef struct ___linkfile_struct
6868 int version;
6869 int kind;
6870 ___UTF_8STRING name;
6871 ___FAKEWORD *sym_list;
6872 ___FAKEWORD *key_list;
6873 void **linker_tbl;
6875 void (*dummy8) ___PVOID;
6876 void (*dummy7) ___PVOID;
6877 void (*dummy6) ___PVOID;
6878 void (*dummy5) ___PVOID;
6879 void (*dummy4) ___PVOID;
6880 void (*dummy3) ___PVOID;
6881 void (*dummy2) ___PVOID;
6882 void (*dummy1) ___PVOID;
6883 } ___linkfile_struct;
6885 /* Module or linkfile structure */
6887 typedef union ___mod_or_lnk_union
6889 ___module_struct module;
6890 ___linkfile_struct linkfile;
6891 } *___mod_or_lnk;
6893 /* Program startup information structure */
6895 typedef struct ___program_startup_info_struct
6897 ___UCS_2STRING *argv;
6898 ___UCS_2STRING script_line;
6900 #ifdef ___OS_WIN32
6902 HINSTANCE hInstance;
6903 HINSTANCE hPrevInstance;
6904 LPSTR lpCmdLine;
6905 int nCmdShow;
6907 #endif
6908 } ___program_startup_info_struct;
6910 /* Global state structure */
6912 typedef struct ___global_state_struct
6914 ___processor_state_struct pstate;
6916 ___F64 nb_gcs;
6917 ___F64 gc_user_time;
6918 ___F64 gc_sys_time;
6919 ___F64 gc_real_time;
6920 ___F64 bytes_allocated_minus_occupied;
6922 ___F64 last_gc_user_time;
6923 ___F64 last_gc_sys_time;
6924 ___F64 last_gc_real_time;
6925 ___F64 last_gc_heap_size;
6926 ___F64 last_gc_alloc;
6927 ___F64 last_gc_live;
6928 ___F64 last_gc_movable;
6929 ___F64 last_gc_nonmovable;
6931 ___WORD handler_sfun_conv_error;
6932 ___WORD handler_cfun_conv_error;
6933 ___WORD handler_stack_limit;
6934 ___WORD handler_heap_limit;
6935 ___WORD handler_not_proc;
6936 ___WORD handler_not_proc_glo;
6937 ___WORD handler_wrong_nargs;
6938 ___WORD handler_get_rest;
6939 ___WORD handler_get_key;
6940 ___WORD handler_get_key_rest;
6941 ___WORD handler_force;
6942 ___WORD handler_return_to_c;
6943 ___WORD handler_break;
6944 ___WORD internal_return;
6945 ___WORD dynamic_env_bind_return;
6947 ___SCMOBJ symbol_table; /* Hash table of all interned symbols. */
6948 ___SCMOBJ keyword_table; /* Hash table of all interned keywords. */
6949 ___SCMOBJ command_line; /* List of command line arguments. */
6950 ___SCMOBJ program_descr; /* Program descriptor. */
6952 void (*dummy8) ___PVOID;
6953 void (*dummy7) ___PVOID;
6954 void (*dummy6) ___PVOID;
6955 void (*dummy5) ___PVOID;
6956 void (*dummy4) ___PVOID;
6957 void (*dummy3) ___PVOID;
6958 void (*dummy2) ___PVOID;
6959 void (*dummy1) ___PVOID;
6961 #ifndef ___CAN_IMPORT_CLIB_DYNAMICALLY
6962 double (*fabs)
6963 ___P((double x),
6964 ());
6965 double (*floor)
6966 ___P((double x),
6967 ());
6968 double (*ceil)
6969 ___P((double x),
6970 ());
6971 double (*exp)
6972 ___P((double x),
6973 ());
6974 double (*log)
6975 ___P((double x),
6976 ());
6977 double (*sin)
6978 ___P((double x),
6979 ());
6980 double (*cos)
6981 ___P((double x),
6982 ());
6983 double (*tan)
6984 ___P((double x),
6985 ());
6986 double (*asin)
6987 ___P((double x),
6988 ());
6989 double (*acos)
6990 ___P((double x),
6991 ());
6992 double (*atan)
6993 ___P((double x),
6994 ());
6995 #ifdef ___GOOD_ATAN2
6996 double (*atan2)
6997 ___P((double y,
6998 double x),
6999 ());
7000 #endif
7001 #ifdef ___GOOD_POW
7002 double (*pow)
7003 ___P((double x,
7004 double y),
7005 ());
7006 #endif
7007 double (*sqrt)
7008 ___P((double x),
7009 ());
7010 #endif
7012 #ifdef ___USE_SETJMP
7013 #ifndef ___CAN_IMPORT_SETJMP_DYNAMICALLY
7014 int (*setjmp)
7015 ___P((jmp_buf env),
7016 ());
7017 #endif
7018 #endif
7020 #ifndef ___CAN_IMPORT_DYNAMICALLY
7021 ___BOOL (*___iswalpha)
7022 ___P((___UCS_4 x),
7023 ());
7024 ___BOOL (*___iswdigit)
7025 ___P((___UCS_4 x),
7026 ());
7027 ___BOOL (*___iswspace)
7028 ___P((___UCS_4 x),
7029 ());
7030 ___BOOL (*___iswupper)
7031 ___P((___UCS_4 x),
7032 ());
7033 ___BOOL (*___iswlower)
7034 ___P((___UCS_4 x),
7035 ());
7036 ___UCS_4 (*___towupper)
7037 ___P((___UCS_4 x),
7038 ());
7039 ___UCS_4 (*___towlower)
7040 ___P((___UCS_4 x),
7041 ());
7042 ___SCMOBJ (*___string_collate)
7043 ___P((___SCMOBJ s1,
7044 ___SCMOBJ s2),
7045 ());
7046 ___SCMOBJ (*___string_collate_ci)
7047 ___P((___SCMOBJ s1,
7048 ___SCMOBJ s2),
7049 ());
7050 double (*___copysign)
7051 ___P((double x,
7052 double y),
7053 ());
7054 ___BOOL (*___isfinite)
7055 ___P((double x),
7056 ());
7057 ___BOOL (*___isnan)
7058 ___P((double x),
7059 ());
7060 double (*___trunc)
7061 ___P((double x),
7062 ());
7063 double (*___round)
7064 ___P((double x),
7065 ());
7066 #ifndef ___GOOD_ATAN2
7067 double (*___atan2)
7068 ___P((double y,
7069 double x),
7070 ());
7071 #endif
7072 #ifndef ___GOOD_POW
7073 double (*___pow)
7074 ___P((double x,
7075 double y),
7076 ());
7077 #endif
7078 ___S64 (*___S64_from_SM32_fn)
7079 ___P((___SM32 val),
7080 ());
7081 ___S64 (*___S64_from_SM32_UM32_fn)
7082 ___P((___SM32 hi32,
7083 ___UM32 lo32),
7084 ());
7085 ___S64 (*___S64_from_LONGLONG_fn)
7086 ___P((___LONGLONG val),
7087 ());
7088 ___LONGLONG (*___S64_to_LONGLONG_fn)
7089 ___P((___S64 val),
7090 ());
7091 ___BOOL (*___S64_fits_in_width_fn)
7092 ___P((___S64 val,
7093 int width),
7094 ());
7095 ___U64 (*___U64_from_UM32_fn)
7096 ___P((___UM32 val),
7097 ());
7098 ___U64 (*___U64_from_UM32_UM32_fn)
7099 ___P((___UM32 hi32,
7100 ___UM32 lo32),
7101 ());
7102 ___U64 (*___U64_from_ULONGLONG_fn)
7103 ___P((___ULONGLONG val),
7104 ());
7105 ___ULONGLONG (*___U64_to_ULONGLONG_fn)
7106 ___P((___U64 val),
7107 ());
7108 ___BOOL (*___U64_fits_in_width_fn)
7109 ___P((___U64 val,
7110 int width),
7111 ());
7112 ___U64 (*___U64_mul_UM32_UM32_fn)
7113 ___P((___UM32 x,
7114 ___UM32 y),
7115 ());
7116 ___U64 (*___U64_add_U64_U64_fn)
7117 ___P((___U64 x,
7118 ___U64 y),
7119 ());
7120 ___SCMOBJ (*___SCMOBJ_to_S8)
7121 ___P((___SCMOBJ obj,
7122 ___S8 *x,
7123 int arg_num),
7124 ());
7125 ___SCMOBJ (*___SCMOBJ_to_U8)
7126 ___P((___SCMOBJ obj,
7127 ___U8 *x,
7128 int arg_num),
7129 ());
7130 ___SCMOBJ (*___SCMOBJ_to_S16)
7131 ___P((___SCMOBJ obj,
7132 ___S16 *x,
7133 int arg_num),
7134 ());
7135 ___SCMOBJ (*___SCMOBJ_to_U16)
7136 ___P((___SCMOBJ obj,
7137 ___U16 *x,
7138 int arg_num),
7139 ());
7140 ___SCMOBJ (*___SCMOBJ_to_S32)
7141 ___P((___SCMOBJ obj,
7142 ___S32 *x,
7143 int arg_num),
7144 ());
7145 ___SCMOBJ (*___SCMOBJ_to_U32)
7146 ___P((___SCMOBJ obj,
7147 ___U32 *x,
7148 int arg_num),
7149 ());
7150 ___SCMOBJ (*___SCMOBJ_to_S64)
7151 ___P((___SCMOBJ obj,
7152 ___S64 *x,
7153 int arg_num),
7154 ());
7155 ___SCMOBJ (*___SCMOBJ_to_U64)
7156 ___P((___SCMOBJ obj,
7157 ___U64 *x,
7158 int arg_num),
7159 ());
7160 ___SCMOBJ (*___SCMOBJ_to_F32)
7161 ___P((___SCMOBJ obj,
7162 ___F32 *x,
7163 int arg_num),
7164 ());
7165 ___SCMOBJ (*___SCMOBJ_to_F64)
7166 ___P((___SCMOBJ obj,
7167 ___F64 *x,
7168 int arg_num),
7169 ());
7170 ___SCMOBJ (*___SCMOBJ_to_CHAR)
7171 ___P((___SCMOBJ obj,
7172 char *x,
7173 int arg_num),
7174 ());
7175 ___SCMOBJ (*___SCMOBJ_to_SCHAR)
7176 ___P((___SCMOBJ obj,
7177 ___SCHAR *x,
7178 int arg_num),
7179 ());
7180 ___SCMOBJ (*___SCMOBJ_to_UCHAR)
7181 ___P((___SCMOBJ obj,
7182 unsigned char *x,
7183 int arg_num),
7184 ());
7185 ___SCMOBJ (*___SCMOBJ_to_ISO_8859_1)
7186 ___P((___SCMOBJ obj,
7187 ___ISO_8859_1 *x,
7188 int arg_num),
7189 ());
7190 ___SCMOBJ (*___SCMOBJ_to_UCS_2)
7191 ___P((___SCMOBJ obj,
7192 ___UCS_2 *x,
7193 int arg_num),
7194 ());
7195 ___SCMOBJ (*___SCMOBJ_to_UCS_4)
7196 ___P((___SCMOBJ obj,
7197 ___UCS_4 *x,
7198 int arg_num),
7199 ());
7200 ___SCMOBJ (*___SCMOBJ_to_WCHAR)
7201 ___P((___SCMOBJ obj,
7202 ___WCHAR *x,
7203 int arg_num),
7204 ());
7205 ___SCMOBJ (*___SCMOBJ_to_SHORT)
7206 ___P((___SCMOBJ obj,
7207 short *x,
7208 int arg_num),
7209 ());
7210 ___SCMOBJ (*___SCMOBJ_to_USHORT)
7211 ___P((___SCMOBJ obj,
7212 unsigned short *x,
7213 int arg_num),
7214 ());
7215 ___SCMOBJ (*___SCMOBJ_to_INT)
7216 ___P((___SCMOBJ obj,
7217 int *x,
7218 int arg_num),
7219 ());
7220 ___SCMOBJ (*___SCMOBJ_to_UINT)
7221 ___P((___SCMOBJ obj,
7222 unsigned int *x,
7223 int arg_num),
7224 ());
7225 ___SCMOBJ (*___SCMOBJ_to_LONG)
7226 ___P((___SCMOBJ obj,
7227 long *x,
7228 int arg_num),
7229 ());
7230 ___SCMOBJ (*___SCMOBJ_to_ULONG)
7231 ___P((___SCMOBJ obj,
7232 unsigned long *x,
7233 int arg_num),
7234 ());
7235 ___SCMOBJ (*___SCMOBJ_to_LONGLONG)
7236 ___P((___SCMOBJ obj,
7237 ___LONGLONG *x,
7238 int arg_num),
7239 ());
7240 ___SCMOBJ (*___SCMOBJ_to_ULONGLONG)
7241 ___P((___SCMOBJ obj,
7242 ___ULONGLONG *x,
7243 int arg_num),
7244 ());
7245 ___SCMOBJ (*___SCMOBJ_to_FLOAT)
7246 ___P((___SCMOBJ obj,
7247 float *x,
7248 int arg_num),
7249 ());
7250 ___SCMOBJ (*___SCMOBJ_to_DOUBLE)
7251 ___P((___SCMOBJ obj,
7252 double *x,
7253 int arg_num),
7254 ());
7255 ___SCMOBJ (*___SCMOBJ_to_STRUCT)
7256 ___P((___SCMOBJ obj,
7257 void **x,
7258 ___SCMOBJ tags,
7259 int arg_num),
7260 ());
7261 ___SCMOBJ (*___SCMOBJ_to_UNION)
7262 ___P((___SCMOBJ obj,
7263 void **x,
7264 ___SCMOBJ tags,
7265 int arg_num),
7266 ());
7267 ___SCMOBJ (*___SCMOBJ_to_TYPE)
7268 ___P((___SCMOBJ obj,
7269 void **x,
7270 ___SCMOBJ tags,
7271 int arg_num),
7272 ());
7273 ___SCMOBJ (*___SCMOBJ_to_POINTER)
7274 ___P((___SCMOBJ obj,
7275 void **x,
7276 ___SCMOBJ tags,
7277 int arg_num),
7278 ());
7279 ___SCMOBJ (*___SCMOBJ_to_NONNULLPOINTER)
7280 ___P((___SCMOBJ obj,
7281 void **x,
7282 ___SCMOBJ tags,
7283 int arg_num),
7284 ());
7285 ___SCMOBJ (*___SCMOBJ_to_FUNCTION)
7286 ___P((___SCMOBJ obj,
7287 void *converter,
7288 void **x,
7289 int arg_num),
7290 ());
7291 ___SCMOBJ (*___SCMOBJ_to_NONNULLFUNCTION)
7292 ___P((___SCMOBJ obj,
7293 void *converter,
7294 void **x,
7295 int arg_num),
7296 ());
7297 ___SCMOBJ (*___SCMOBJ_to_BOOL)
7298 ___P((___SCMOBJ obj,
7299 ___BOOL *x,
7300 int arg_num),
7301 ());
7302 ___SCMOBJ (*___SCMOBJ_to_STRING)
7303 ___P((___SCMOBJ obj,
7304 void **x,
7305 int arg_num,
7306 int char_encoding,
7307 int fudge),
7308 ());
7309 ___SCMOBJ (*___SCMOBJ_to_NONNULLSTRING)
7310 ___P((___SCMOBJ obj,
7311 void **x,
7312 int arg_num,
7313 int char_encoding,
7314 int fudge),
7315 ());
7316 ___SCMOBJ (*___SCMOBJ_to_NONNULLSTRINGLIST)
7317 ___P((___SCMOBJ obj,
7318 void **x,
7319 int arg_num,
7320 int char_encoding),
7321 ());
7322 ___SCMOBJ (*___SCMOBJ_to_CHARSTRING)
7323 ___P((___SCMOBJ obj,
7324 char **x,
7325 int arg_num),
7326 ());
7327 ___SCMOBJ (*___SCMOBJ_to_NONNULLCHARSTRING)
7328 ___P((___SCMOBJ obj,
7329 char **x,
7330 int arg_num),
7331 ());
7332 ___SCMOBJ (*___SCMOBJ_to_NONNULLCHARSTRINGLIST)
7333 ___P((___SCMOBJ obj,
7334 char ***x,
7335 int arg_num),
7336 ());
7337 ___SCMOBJ (*___SCMOBJ_to_ISO_8859_1STRING)
7338 ___P((___SCMOBJ obj,
7339 ___ISO_8859_1STRING *x,
7340 int arg_num),
7341 ());
7342 ___SCMOBJ (*___SCMOBJ_to_NONNULLISO_8859_1STRING)
7343 ___P((___SCMOBJ obj,
7344 ___ISO_8859_1STRING *x,
7345 int arg_num),
7346 ());
7347 ___SCMOBJ (*___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST)
7348 ___P((___SCMOBJ obj,
7349 ___ISO_8859_1STRING **x,
7350 int arg_num),
7351 ());
7352 ___SCMOBJ (*___SCMOBJ_to_UTF_8STRING)
7353 ___P((___SCMOBJ obj,
7354 ___UTF_8STRING *x,
7355 int arg_num),
7356 ());
7357 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_8STRING)
7358 ___P((___SCMOBJ obj,
7359 ___UTF_8STRING *x,
7360 int arg_num),
7361 ());
7362 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_8STRINGLIST)
7363 ___P((___SCMOBJ obj,
7364 ___UTF_8STRING **x,
7365 int arg_num),
7366 ());
7367 ___SCMOBJ (*___SCMOBJ_to_UTF_16STRING)
7368 ___P((___SCMOBJ obj,
7369 ___UTF_16STRING *x,
7370 int arg_num),
7371 ());
7372 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_16STRING)
7373 ___P((___SCMOBJ obj,
7374 ___UTF_16STRING *x,
7375 int arg_num),
7376 ());
7377 ___SCMOBJ (*___SCMOBJ_to_NONNULLUTF_16STRINGLIST)
7378 ___P((___SCMOBJ obj,
7379 ___UTF_16STRING **x,
7380 int arg_num),
7381 ());
7382 ___SCMOBJ (*___SCMOBJ_to_UCS_2STRING)
7383 ___P((___SCMOBJ obj,
7384 ___UCS_2STRING *x,
7385 int arg_num),
7386 ());
7387 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_2STRING)
7388 ___P((___SCMOBJ obj,
7389 ___UCS_2STRING *x,
7390 int arg_num),
7391 ());
7392 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_2STRINGLIST)
7393 ___P((___SCMOBJ obj,
7394 ___UCS_2STRING **x,
7395 int arg_num),
7396 ());
7397 ___SCMOBJ (*___SCMOBJ_to_UCS_4STRING)
7398 ___P((___SCMOBJ obj,
7399 ___UCS_4STRING *x,
7400 int arg_num),
7401 ());
7402 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_4STRING)
7403 ___P((___SCMOBJ obj,
7404 ___UCS_4STRING *x,
7405 int arg_num),
7406 ());
7407 ___SCMOBJ (*___SCMOBJ_to_NONNULLUCS_4STRINGLIST)
7408 ___P((___SCMOBJ obj,
7409 ___UCS_4STRING **x,
7410 int arg_num),
7411 ());
7412 ___SCMOBJ (*___SCMOBJ_to_WCHARSTRING)
7413 ___P((___SCMOBJ obj,
7414 ___WCHARSTRING *x,
7415 int arg_num),
7416 ());
7417 ___SCMOBJ (*___SCMOBJ_to_NONNULLWCHARSTRING)
7418 ___P((___SCMOBJ obj,
7419 ___WCHARSTRING *x,
7420 int arg_num),
7421 ());
7422 ___SCMOBJ (*___SCMOBJ_to_NONNULLWCHARSTRINGLIST)
7423 ___P((___SCMOBJ obj,
7424 ___WCHARSTRING **x,
7425 int arg_num),
7426 ());
7427 ___SCMOBJ (*___SCMOBJ_to_VARIANT)
7428 ___P((___SCMOBJ obj,
7429 ___VARIANT *x,
7430 int arg_num),
7431 ());
7432 ___SCMOBJ (*___release_foreign)
7433 ___P((___SCMOBJ obj),
7434 ());
7435 ___SCMOBJ (*___release_pointer)
7436 ___P((void *x),
7437 ());
7438 ___SCMOBJ (*___release_function)
7439 ___P((void *x),
7440 ());
7441 void (*___addref_function)
7442 ___P((void *x),
7443 ());
7444 void (*___release_string)
7445 ___P((void *x),
7446 ());
7447 void (*___addref_string)
7448 ___P((void *x),
7449 ());
7450 void (*___release_string_list)
7451 ___P((void *x),
7452 ());
7453 void (*___addref_string_list)
7454 ___P((void *x),
7455 ());
7456 void (*___release_variant)
7457 ___P((___VARIANT x),
7458 ());
7459 void (*___addref_variant)
7460 ___P((___VARIANT x),
7461 ());
7462 ___SCMOBJ (*___S8_to_SCMOBJ)
7463 ___P((___S8 x,
7464 ___SCMOBJ *obj,
7465 int arg_num),
7466 ());
7467 ___SCMOBJ (*___U8_to_SCMOBJ)
7468 ___P((___U8 x,
7469 ___SCMOBJ *obj,
7470 int arg_num),
7471 ());
7472 ___SCMOBJ (*___S16_to_SCMOBJ)
7473 ___P((___S16 x,
7474 ___SCMOBJ *obj,
7475 int arg_num),
7476 ());
7477 ___SCMOBJ (*___U16_to_SCMOBJ)
7478 ___P((___U16 x,
7479 ___SCMOBJ *obj,
7480 int arg_num),
7481 ());
7482 ___SCMOBJ (*___S32_to_SCMOBJ)
7483 ___P((___S32 x,
7484 ___SCMOBJ *obj,
7485 int arg_num),
7486 ());
7487 ___SCMOBJ (*___U32_to_SCMOBJ)
7488 ___P((___U32 x,
7489 ___SCMOBJ *obj,
7490 int arg_num),
7491 ());
7492 ___SCMOBJ (*___S64_to_SCMOBJ)
7493 ___P((___S64 x,
7494 ___SCMOBJ *obj,
7495 int arg_num),
7496 ());
7497 ___SCMOBJ (*___U64_to_SCMOBJ)
7498 ___P((___U64 x,
7499 ___SCMOBJ *obj,
7500 int arg_num),
7501 ());
7502 ___SCMOBJ (*___F32_to_SCMOBJ)
7503 ___P((___F32 x,
7504 ___SCMOBJ *obj,
7505 int arg_num),
7506 ());
7507 ___SCMOBJ (*___F64_to_SCMOBJ)
7508 ___P((___F64 x,
7509 ___SCMOBJ *obj,
7510 int arg_num),
7511 ());
7512 ___SCMOBJ (*___CHAR_to_SCMOBJ)
7513 ___P((char x,
7514 ___SCMOBJ *obj,
7515 int arg_num),
7516 ());
7517 ___SCMOBJ (*___SCHAR_to_SCMOBJ)
7518 ___P((___SCHAR x,
7519 ___SCMOBJ *obj,
7520 int arg_num),
7521 ());
7522 ___SCMOBJ (*___UCHAR_to_SCMOBJ)
7523 ___P((unsigned char x,
7524 ___SCMOBJ *obj,
7525 int arg_num),
7526 ());
7527 ___SCMOBJ (*___ISO_8859_1_to_SCMOBJ)
7528 ___P((___ISO_8859_1 x,
7529 ___SCMOBJ *obj,
7530 int arg_num),
7531 ());
7532 ___SCMOBJ (*___UCS_2_to_SCMOBJ)
7533 ___P((___UCS_2 x,
7534 ___SCMOBJ *obj,
7535 int arg_num),
7536 ());
7537 ___SCMOBJ (*___UCS_4_to_SCMOBJ)
7538 ___P((___UCS_4 x,
7539 ___SCMOBJ *obj,
7540 int arg_num),
7541 ());
7542 ___SCMOBJ (*___WCHAR_to_SCMOBJ)
7543 ___P((___WCHAR x,
7544 ___SCMOBJ *obj,
7545 int arg_num),
7546 ());
7547 ___SCMOBJ (*___SHORT_to_SCMOBJ)
7548 ___P((short x,
7549 ___SCMOBJ *obj,
7550 int arg_num),
7551 ());
7552 ___SCMOBJ (*___USHORT_to_SCMOBJ)
7553 ___P((unsigned short x,
7554 ___SCMOBJ *obj,
7555 int arg_num),
7556 ());
7557 ___SCMOBJ (*___INT_to_SCMOBJ)
7558 ___P((int x,
7559 ___SCMOBJ *obj,
7560 int arg_num),
7561 ());
7562 ___SCMOBJ (*___UINT_to_SCMOBJ)
7563 ___P((unsigned int x,
7564 ___SCMOBJ *obj,
7565 int arg_num),
7566 ());
7567 ___SCMOBJ (*___LONG_to_SCMOBJ)
7568 ___P((long x,
7569 ___SCMOBJ *obj,
7570 int arg_num),
7571 ());
7572 ___SCMOBJ (*___ULONG_to_SCMOBJ)
7573 ___P((unsigned long x,
7574 ___SCMOBJ *obj,
7575 int arg_num),
7576 ());
7577 ___SCMOBJ (*___LONGLONG_to_SCMOBJ)
7578 ___P((___LONGLONG x,
7579 ___SCMOBJ *obj,
7580 int arg_num),
7581 ());
7582 ___SCMOBJ (*___ULONGLONG_to_SCMOBJ)
7583 ___P((___ULONGLONG x,
7584 ___SCMOBJ *obj,
7585 int arg_num),
7586 ());
7587 ___SCMOBJ (*___FLOAT_to_SCMOBJ)
7588 ___P((float x,
7589 ___SCMOBJ *obj,
7590 int arg_num),
7591 ());
7592 ___SCMOBJ (*___DOUBLE_to_SCMOBJ)
7593 ___P((double x,
7594 ___SCMOBJ *obj,
7595 int arg_num),
7596 ());
7597 ___SCMOBJ (*___STRUCT_to_SCMOBJ)
7598 ___P((void *x,
7599 ___SCMOBJ tags,
7600 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7601 ___SCMOBJ *obj,
7602 int arg_num),
7603 ());
7604 ___SCMOBJ (*___UNION_to_SCMOBJ)
7605 ___P((void *x,
7606 ___SCMOBJ tags,
7607 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7608 ___SCMOBJ *obj,
7609 int arg_num),
7610 ());
7611 ___SCMOBJ (*___TYPE_to_SCMOBJ)
7612 ___P((void *x,
7613 ___SCMOBJ tags,
7614 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7615 ___SCMOBJ *obj,
7616 int arg_num),
7617 ());
7618 ___SCMOBJ (*___POINTER_to_SCMOBJ)
7619 ___P((void *x,
7620 ___SCMOBJ tags,
7621 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7622 ___SCMOBJ *obj,
7623 int arg_num),
7624 ());
7625 ___SCMOBJ (*___NONNULLPOINTER_to_SCMOBJ)
7626 ___P((void *x,
7627 ___SCMOBJ tags,
7628 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
7629 ___SCMOBJ *obj,
7630 int arg_num),
7631 ());
7632 ___SCMOBJ (*___FUNCTION_to_SCMOBJ)
7633 ___P((void *x,
7634 ___SCMOBJ *obj,
7635 int arg_num),
7636 ());
7637 ___SCMOBJ (*___NONNULLFUNCTION_to_SCMOBJ)
7638 ___P((void *x,
7639 ___SCMOBJ *obj,
7640 int arg_num),
7641 ());
7642 ___SCMOBJ (*___BOOL_to_SCMOBJ)
7643 ___P((___BOOL x,
7644 ___SCMOBJ *obj,
7645 int arg_num),
7646 ());
7647 ___SCMOBJ (*___STRING_to_SCMOBJ)
7648 ___P((void *x,
7649 ___SCMOBJ *obj,
7650 int arg_num,
7651 int char_encoding),
7652 ());
7653 ___SCMOBJ (*___NONNULLSTRING_to_SCMOBJ)
7654 ___P((void *x,
7655 ___SCMOBJ *obj,
7656 int arg_num,
7657 int char_encoding),
7658 ());
7659 ___SCMOBJ (*___NONNULLSTRINGLIST_to_SCMOBJ)
7660 ___P((void *x,
7661 ___SCMOBJ *obj,
7662 int arg_num,
7663 int char_encoding),
7664 ());
7665 ___SCMOBJ (*___CHARSTRING_to_SCMOBJ)
7666 ___P((char *x,
7667 ___SCMOBJ *obj,
7668 int arg_num),
7669 ());
7670 ___SCMOBJ (*___NONNULLCHARSTRING_to_SCMOBJ)
7671 ___P((char *x,
7672 ___SCMOBJ *obj,
7673 int arg_num),
7674 ());
7675 ___SCMOBJ (*___NONNULLCHARSTRINGLIST_to_SCMOBJ)
7676 ___P((char **x,
7677 ___SCMOBJ *obj,
7678 int arg_num),
7679 ());
7680 ___SCMOBJ (*___ISO_8859_1STRING_to_SCMOBJ)
7681 ___P((___ISO_8859_1STRING x,
7682 ___SCMOBJ *obj,
7683 int arg_num),
7684 ());
7685 ___SCMOBJ (*___NONNULLISO_8859_1STRING_to_SCMOBJ)
7686 ___P((___ISO_8859_1STRING x,
7687 ___SCMOBJ *obj,
7688 int arg_num),
7689 ());
7690 ___SCMOBJ (*___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ)
7691 ___P((___ISO_8859_1STRING *x,
7692 ___SCMOBJ *obj,
7693 int arg_num),
7694 ());
7695 ___SCMOBJ (*___UTF_8STRING_to_SCMOBJ)
7696 ___P((___UTF_8STRING x,
7697 ___SCMOBJ *obj,
7698 int arg_num),
7699 ());
7700 ___SCMOBJ (*___NONNULLUTF_8STRING_to_SCMOBJ)
7701 ___P((___UTF_8STRING x,
7702 ___SCMOBJ *obj,
7703 int arg_num),
7704 ());
7705 ___SCMOBJ (*___NONNULLUTF_8STRINGLIST_to_SCMOBJ)
7706 ___P((___UTF_8STRING *x,
7707 ___SCMOBJ *obj,
7708 int arg_num),
7709 ());
7710 ___SCMOBJ (*___UTF_16STRING_to_SCMOBJ)
7711 ___P((___UTF_16STRING x,
7712 ___SCMOBJ *obj,
7713 int arg_num),
7714 ());
7715 ___SCMOBJ (*___NONNULLUTF_16STRING_to_SCMOBJ)
7716 ___P((___UTF_16STRING x,
7717 ___SCMOBJ *obj,
7718 int arg_num),
7719 ());
7720 ___SCMOBJ (*___NONNULLUTF_16STRINGLIST_to_SCMOBJ)
7721 ___P((___UTF_16STRING *x,
7722 ___SCMOBJ *obj,
7723 int arg_num),
7724 ());
7725 ___SCMOBJ (*___UCS_2STRING_to_SCMOBJ)
7726 ___P((___UCS_2STRING x,
7727 ___SCMOBJ *obj,
7728 int arg_num),
7729 ());
7730 ___SCMOBJ (*___NONNULLUCS_2STRING_to_SCMOBJ)
7731 ___P((___UCS_2STRING x,
7732 ___SCMOBJ *obj,
7733 int arg_num),
7734 ());
7735 ___SCMOBJ (*___NONNULLUCS_2STRINGLIST_to_SCMOBJ)
7736 ___P((___UCS_2STRING *x,
7737 ___SCMOBJ *obj,
7738 int arg_num),
7739 ());
7740 ___SCMOBJ (*___UCS_4STRING_to_SCMOBJ)
7741 ___P((___UCS_4STRING x,
7742 ___SCMOBJ *obj,
7743 int arg_num),
7744 ());
7745 ___SCMOBJ (*___NONNULLUCS_4STRING_to_SCMOBJ)
7746 ___P((___UCS_4STRING x,
7747 ___SCMOBJ *obj,
7748 int arg_num),
7749 ());
7750 ___SCMOBJ (*___NONNULLUCS_4STRINGLIST_to_SCMOBJ)
7751 ___P((___UCS_4STRING *x,
7752 ___SCMOBJ *obj,
7753 int arg_num),
7754 ());
7755 ___SCMOBJ (*___WCHARSTRING_to_SCMOBJ)
7756 ___P((___WCHARSTRING x,
7757 ___SCMOBJ *obj,
7758 int arg_num),
7759 ());
7760 ___SCMOBJ (*___NONNULLWCHARSTRING_to_SCMOBJ)
7761 ___P((___WCHARSTRING x,
7762 ___SCMOBJ *obj,
7763 int arg_num),
7764 ());
7765 ___SCMOBJ (*___NONNULLWCHARSTRINGLIST_to_SCMOBJ)
7766 ___P((___WCHARSTRING *x,
7767 ___SCMOBJ *obj,
7768 int arg_num),
7769 ());
7770 ___SCMOBJ (*___VARIANT_to_SCMOBJ)
7771 ___P((___VARIANT x,
7772 ___SCMOBJ *obj,
7773 int arg_num),
7774 ());
7775 ___SCMOBJ (*___CHARSTRING_to_UCS_2STRING)
7776 ___P((char *str_char,
7777 ___UCS_2STRING *str_UCS_2),
7778 ());
7779 void (*___free_UCS_2STRING)
7780 ___P((___UCS_2STRING str_UCS_2),
7781 ());
7782 ___SCMOBJ (*___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST)
7783 ___P((char **str_list_char,
7784 ___UCS_2STRING **str_list_UCS_2),
7785 ());
7786 void (*___free_NONNULLUCS_2STRINGLIST)
7787 ___P((___UCS_2STRING *str_list_UCS_2),
7788 ());
7789 ___SCMOBJ (*___make_sfun_stack_marker)
7790 ___P((___SCMOBJ *marker,
7791 ___SCMOBJ proc_or_false),
7792 ());
7793 void (*___kill_sfun_stack_marker)
7794 ___P((___SCMOBJ marker),
7795 ());
7796 void *(*___alloc_rc)
7797 ___P((unsigned long bytes),
7798 ());
7799 void (*___release_rc)
7800 ___P((void *ptr),
7801 ());
7802 void (*___addref_rc)
7803 ___P((void *ptr),
7804 ());
7805 ___SCMOBJ (*___data_rc)
7806 ___P((void *ptr),
7807 ());
7808 void (*___set_data_rc)
7809 ___P((void *ptr,
7810 ___SCMOBJ val),
7811 ());
7812 ___SCMOBJ (*___alloc_scmobj)
7813 ___P((int subtype,
7814 long bytes,
7815 int kind),
7816 ());
7817 void (*___release_scmobj)
7818 ___P((___SCMOBJ obj),
7819 ());
7820 ___SCMOBJ (*___make_pair)
7821 ___P((___SCMOBJ car,
7822 ___SCMOBJ cdr,
7823 int kind),
7824 ());
7825 ___SCMOBJ (*___make_vector)
7826 ___P((long length,
7827 ___SCMOBJ init,
7828 int kind),
7829 ());
7830 void (*___still_obj_refcount_inc)
7831 ___P((___SCMOBJ obj),
7832 ());
7833 void (*___still_obj_refcount_dec)
7834 ___P((___SCMOBJ obj),
7835 ());
7836 ___SCMOBJ (*___gc_hash_table_ref)
7837 ___P((___SCMOBJ ht,
7838 ___SCMOBJ key),
7839 ());
7840 ___SCMOBJ (*___gc_hash_table_set)
7841 ___P((___SCMOBJ ht,
7842 ___SCMOBJ key,
7843 ___SCMOBJ val),
7844 ());
7845 ___SCMOBJ (*___gc_hash_table_rehash)
7846 ___P((___SCMOBJ ht_src,
7847 ___SCMOBJ ht_dst),
7848 ());
7849 unsigned long (*___get_min_heap) ___PVOID;
7850 void (*___set_min_heap)
7851 ___P((unsigned long bytes),
7852 ());
7853 unsigned long (*___get_max_heap) ___PVOID;
7854 void (*___set_max_heap)
7855 ___P((unsigned long bytes),
7856 ());
7857 int (*___get_live_percent) ___PVOID;
7858 void (*___set_live_percent)
7859 ___P((int percent),
7860 ());
7861 int (*___get_standard_level) ___PVOID;
7862 void (*___set_standard_level)
7863 ___P((int level),
7864 ());
7865 int (*___set_debug_settings)
7866 ___P((int mask,
7867 int new_settings),
7868 ());
7869 ___program_startup_info_struct *(*___get_program_startup_info) ___PVOID;
7870 void (*___cleanup) ___PVOID;
7871 void (*___cleanup_and_exit_process)
7872 ___P((int status),
7873 ());
7874 ___SCMOBJ (*___call)
7875 ___P((int nargs,
7876 ___SCMOBJ proc,
7877 ___SCMOBJ marker),
7878 ());
7879 void (*___propagate_error)
7880 ___P((___SCMOBJ err),
7881 ());
7882 #ifdef ___DEBUG_HOST_CHANGES
7883 void (*___register_host_entry)
7884 ___P((___WORD start,
7885 char *module_name),
7886 ());
7887 #endif
7888 void (*___raise_interrupt)
7889 ___P((int code),
7890 ());
7891 void (*___begin_interrupt_service) ___PVOID;
7892 ___BOOL (*___check_interrupt)
7893 ___P((int code),
7894 ());
7895 void (*___end_interrupt_service)
7896 ___P((int code),
7897 ());
7898 void (*___disable_interrupts) ___PVOID;
7899 void (*___enable_interrupts) ___PVOID;
7900 void *(*___alloc_mem)
7901 ___P((unsigned long bytes),
7902 ());
7903 void (*___free_mem)
7904 ___P((void *ptr),
7905 ());
7906 #endif
7907 } ___global_state_struct;
7909 #ifdef ___LBL_COUNT
7910 ___LOCAL ___WORD ___lp; /* Module's label table pointer */
7911 #endif
7913 ___GLO_DECL
7914 ___SYM_DECL
7915 ___KEY_DECL
7917 /* Setup parameters structure */
7919 typedef struct ___setup_params_struct
7921 int version;
7922 ___UCS_2STRING *argv;
7923 unsigned long min_heap;
7924 unsigned long max_heap;
7925 int live_percent;
7926 long (*gc_hook) ___P((long avail, long live),());
7927 void (*display_error) ___P((char **msgs),());
7928 void (*fatal_error) ___P((char **msgs),());
7929 int standard_level;
7930 int debug_settings;
7931 int file_settings;
7932 int terminal_settings;
7933 int stdio_settings;
7934 ___UCS_2STRING gambcdir;
7935 ___UCS_2STRING *gambcdir_map;
7936 ___UCS_2STRING remote_dbg_addr;
7937 ___UCS_2STRING rpc_server_addr;
7938 ___mod_or_lnk (*linker) ___P((___global_state_struct*),());
7940 void (*dummy8) ___PVOID;
7941 void (*dummy7) ___PVOID;
7942 void (*dummy6) ___PVOID;
7943 void (*dummy5) ___PVOID;
7944 void (*dummy4) ___PVOID;
7945 void (*dummy3) ___PVOID;
7946 void (*dummy2) ___PVOID;
7947 void (*dummy1) ___PVOID;
7948 } ___setup_params_struct;
7950 #define ___DEBUG_SETTINGS_LEVEL_MASK 15
7951 #define ___DEBUG_SETTINGS_LEVEL_SHIFT 0
7952 #define ___DEBUG_SETTINGS_UNCAUGHT_MASK (1<<4)
7953 #define ___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL 0
7954 #define ___DEBUG_SETTINGS_UNCAUGHT_ALL 1
7955 #define ___DEBUG_SETTINGS_UNCAUGHT_SHIFT 4
7956 #define ___DEBUG_SETTINGS_ERROR_MASK (3<<5)
7957 #define ___DEBUG_SETTINGS_ERROR_REPL 0
7958 #define ___DEBUG_SETTINGS_ERROR_SINGLE_STEP 1
7959 #define ___DEBUG_SETTINGS_ERROR_QUIT 2
7960 #define ___DEBUG_SETTINGS_ERROR_SHIFT 5
7961 #define ___DEBUG_SETTINGS_REPL_MASK (3<<7)
7962 #define ___DEBUG_SETTINGS_REPL_IDE 0
7963 #define ___DEBUG_SETTINGS_REPL_CONSOLE 1
7964 #define ___DEBUG_SETTINGS_REPL_STDIO 2
7965 #define ___DEBUG_SETTINGS_REPL_REMOTE 3
7966 #define ___DEBUG_SETTINGS_REPL_SHIFT 7
7967 #define ___DEBUG_SETTINGS_USER_INTR_MASK (3<<9)
7968 #define ___DEBUG_SETTINGS_USER_INTR_REPL 0
7969 #define ___DEBUG_SETTINGS_USER_INTR_DEFER 1
7970 #define ___DEBUG_SETTINGS_USER_INTR_QUIT 2
7971 #define ___DEBUG_SETTINGS_USER_INTR_SHIFT 9
7973 #define ___DEBUG_SETTINGS_LEVEL(settings) \
7974 (((settings) & ___DEBUG_SETTINGS_LEVEL_MASK) \
7975 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
7977 #define ___DEBUG_SETTINGS_UNCAUGHT(settings) \
7978 (((settings) & ___DEBUG_SETTINGS_UNCAUGHT_MASK) \
7979 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
7981 #define ___DEBUG_SETTINGS_ERROR(settings) \
7982 (((settings) & ___DEBUG_SETTINGS_ERROR_MASK) \
7983 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
7985 #define ___DEBUG_SETTINGS_REPL(settings) \
7986 (((settings) & ___DEBUG_SETTINGS_REPL_MASK) \
7987 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
7989 #define ___DEBUG_SETTINGS_USER_INTR(settings) \
7990 (((settings) & ___DEBUG_SETTINGS_USER_INTR_MASK) \
7991 >> ___DEBUG_SETTINGS_LEVEL_SHIFT)
7993 #define ___DEBUG_SETTINGS_INITIAL \
7994 ((1 << ___DEBUG_SETTINGS_LEVEL_SHIFT) | \
7995 (___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL \
7996 << ___DEBUG_SETTINGS_UNCAUGHT_SHIFT) | \
7997 (___DEBUG_SETTINGS_ERROR_QUIT \
7998 << ___DEBUG_SETTINGS_ERROR_SHIFT) | \
7999 (___DEBUG_SETTINGS_REPL_IDE \
8000 << ___DEBUG_SETTINGS_REPL_SHIFT) | \
8001 (___DEBUG_SETTINGS_USER_INTR_QUIT \
8002 << ___DEBUG_SETTINGS_USER_INTR_SHIFT))
8004 #define ___DEBUG_SETTINGS_DEFAULT \
8005 ((1 << ___DEBUG_SETTINGS_LEVEL_SHIFT) | \
8006 (___DEBUG_SETTINGS_UNCAUGHT_PRIMORDIAL \
8007 << ___DEBUG_SETTINGS_UNCAUGHT_SHIFT) | \
8008 (___DEBUG_SETTINGS_ERROR_REPL \
8009 << ___DEBUG_SETTINGS_ERROR_SHIFT) | \
8010 (___DEBUG_SETTINGS_REPL_IDE \
8011 << ___DEBUG_SETTINGS_REPL_SHIFT) | \
8012 (___DEBUG_SETTINGS_USER_INTR_REPL \
8013 << ___DEBUG_SETTINGS_USER_INTR_SHIFT))
8015 #define ___CHAR_ENCODING(x) ((x)&(31<<0))
8016 #define ___CHAR_ENCODING_MASK(x) ((x)&~(31<<0))
8017 #define ___CHAR_ENCODING_ASCII (1<<0)
8018 #define ___CHAR_ENCODING_ISO_8859_1 (2<<0)
8019 #define ___CHAR_ENCODING_UTF_8 (3<<0)
8020 #define ___CHAR_ENCODING_UTF_16 (4<<0)
8021 #define ___CHAR_ENCODING_UTF_16BE (5<<0)
8022 #define ___CHAR_ENCODING_UTF_16LE (6<<0)
8023 #define ___CHAR_ENCODING_UTF_FALLBACK_ASCII (7<<0)
8024 #define ___CHAR_ENCODING_UTF_FALLBACK_ISO_8859_1 (8<<0)
8025 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_8 (9<<0)
8026 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16 (10<<0)
8027 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16BE (11<<0)
8028 #define ___CHAR_ENCODING_UTF_FALLBACK_UTF_16LE (12<<0)
8029 #define ___CHAR_ENCODING_UCS_2 (13<<0)
8030 #define ___CHAR_ENCODING_UCS_2BE (14<<0)
8031 #define ___CHAR_ENCODING_UCS_2LE (15<<0)
8032 #define ___CHAR_ENCODING_UCS_4 (16<<0)
8033 #define ___CHAR_ENCODING_UCS_4BE (17<<0)
8034 #define ___CHAR_ENCODING_UCS_4LE (18<<0)
8035 #define ___CHAR_ENCODING_WCHAR (19<<0)
8036 #define ___CHAR_ENCODING_NATIVE (20<<0)
8038 #define ___CHAR_ENCODING_UTF ___CHAR_ENCODING_UTF_FALLBACK_UTF_8
8040 #define ___CHAR_ENCODING_SUPPORTS_BMP(x) \
8041 ((x) >= ___CHAR_ENCODING_UTF_8 && \
8042 (x) <= ___CHAR_ENCODING_UCS_4LE)
8044 #ifdef ___BIG_ENDIAN
8045 #define ___CHAR_ENCODING_U8 ___CHAR_ENCODING_ISO_8859_1
8046 #define ___CHAR_ENCODING_U16 ___CHAR_ENCODING_UCS_2BE
8047 #define ___CHAR_ENCODING_U32 ___CHAR_ENCODING_UCS_4BE
8048 #else
8049 #define ___CHAR_ENCODING_U8 ___CHAR_ENCODING_ISO_8859_1
8050 #define ___CHAR_ENCODING_U16 ___CHAR_ENCODING_UCS_2LE
8051 #define ___CHAR_ENCODING_U32 ___CHAR_ENCODING_UCS_4LE
8052 #endif
8054 #define ___CHAR_ENCODING_ERRORS(x) ((x)&(3<<5))
8055 #define ___CHAR_ENCODING_ERRORS_MASK(x) ((x)&~(3<<5))
8056 #define ___CHAR_ENCODING_ERRORS_ON (1<<5)
8057 #define ___CHAR_ENCODING_ERRORS_OFF (2<<5)
8059 #define ___EOL_ENCODING(x) ((x)&(3<<7))
8060 #define ___EOL_ENCODING_MASK(x) ((x)&~(3<<7))
8061 #define ___EOL_ENCODING_LF (1<<7)
8062 #define ___EOL_ENCODING_CR (2<<7)
8063 #define ___EOL_ENCODING_CRLF (3<<7)
8065 #define ___BUFFERING(x) ((x)&(3<<9))
8066 #define ___BUFFERING_MASK(x) ((x)&~(3<<9))
8067 #define ___NO_BUFFERING (1<<9)
8068 #define ___LINE_BUFFERING (2<<9)
8069 #define ___FULL_BUFFERING (3<<9)
8070 #define ___FULLY_BUFFERED(x) (___BUFFERING(x)>=___FULL_BUFFERING)
8072 #define ___DECODE_STATE(x) ((x)&(3<<11))
8073 #define ___DECODE_STATE_MASK(x) ((x)&~(3<<11))
8074 #define ___DECODE_STATE_NONE (0<<11)
8075 #define ___DECODE_STATE_LF (1<<11)
8076 #define ___DECODE_STATE_CR (2<<11)
8078 #define ___TERMINAL_LINE_EDITING(x) ((x)&(3<<16))
8079 #define ___TERMINAL_LINE_EDITING_MASK(x) ((x)&~(3<<16))
8080 #define ___TERMINAL_LINE_EDITING_ON (1<<16)
8081 #define ___TERMINAL_LINE_EDITING_OFF (2<<16)
8083 #define ___FILE_SETTINGS_INITIAL 0
8084 #define ___TERMINAL_SETTINGS_INITIAL 0
8085 #define ___STDIO_SETTINGS_INITIAL 0
8087 #ifndef ___INCLUDED_FROM_C_INTF
8088 ___IMP_FUNC(___S64,___S64_from_SM32_fn)
8089 ___P((___SM32 val),
8090 ());
8091 ___IMP_FUNC(___S64,___S64_from_SM32_UM32_fn)
8092 ___P((___SM32 hi32,
8093 ___UM32 lo32),
8094 ());
8095 ___IMP_FUNC(___S64,___S64_from_LONGLONG_fn)
8096 ___P((___LONGLONG val),
8097 ());
8098 ___IMP_FUNC(___LONGLONG,___S64_to_LONGLONG_fn)
8099 ___P((___S64 val),
8100 ());
8101 ___IMP_FUNC(___BOOL,___S64_fits_in_width_fn)
8102 ___P((___S64 val,
8103 int width),
8104 ());
8105 ___IMP_FUNC(___U64,___U64_from_UM32_fn)
8106 ___P((___UM32 val),
8107 ());
8108 ___IMP_FUNC(___U64,___U64_from_UM32_UM32_fn)
8109 ___P((___UM32 hi32,
8110 ___UM32 lo32),
8111 ());
8112 ___IMP_FUNC(___U64,___U64_from_ULONGLONG_fn)
8113 ___P((___ULONGLONG val),
8114 ());
8115 ___IMP_FUNC(___ULONGLONG,___U64_to_ULONGLONG_fn)
8116 ___P((___U64 val),
8117 ());
8118 ___IMP_FUNC(___BOOL,___U64_fits_in_width_fn)
8119 ___P((___U64 val,
8120 int width),
8121 ());
8122 ___IMP_FUNC(___U64,___U64_mul_UM32_UM32_fn)
8123 ___P((___UM32 x,
8124 ___UM32 y),
8125 ());
8126 ___IMP_FUNC(___U64,___U64_add_U64_U64_fn)
8127 ___P((___U64 x,
8128 ___U64 y),
8129 ());
8130 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S8)
8131 ___P((___SCMOBJ obj,
8132 ___S8 *x,
8133 int arg_num),
8134 ());
8135 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U8)
8136 ___P((___SCMOBJ obj,
8137 ___U8 *x,
8138 int arg_num),
8139 ());
8140 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S16)
8141 ___P((___SCMOBJ obj,
8142 ___S16 *x,
8143 int arg_num),
8144 ());
8145 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U16)
8146 ___P((___SCMOBJ obj,
8147 ___U16 *x,
8148 int arg_num),
8149 ());
8150 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S32)
8151 ___P((___SCMOBJ obj,
8152 ___S32 *x,
8153 int arg_num),
8154 ());
8155 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U32)
8156 ___P((___SCMOBJ obj,
8157 ___U32 *x,
8158 int arg_num),
8159 ());
8160 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_S64)
8161 ___P((___SCMOBJ obj,
8162 ___S64 *x,
8163 int arg_num),
8164 ());
8165 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_U64)
8166 ___P((___SCMOBJ obj,
8167 ___U64 *x,
8168 int arg_num),
8169 ());
8170 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_F32)
8171 ___P((___SCMOBJ obj,
8172 ___F32 *x,
8173 int arg_num),
8174 ());
8175 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_F64)
8176 ___P((___SCMOBJ obj,
8177 ___F64 *x,
8178 int arg_num),
8179 ());
8180 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_CHAR)
8181 ___P((___SCMOBJ obj,
8182 char *x,
8183 int arg_num),
8184 ());
8185 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_SCHAR)
8186 ___P((___SCMOBJ obj,
8187 ___SCHAR *x,
8188 int arg_num),
8189 ());
8190 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCHAR)
8191 ___P((___SCMOBJ obj,
8192 unsigned char *x,
8193 int arg_num),
8194 ());
8195 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ISO_8859_1)
8196 ___P((___SCMOBJ obj,
8197 ___ISO_8859_1 *x,
8198 int arg_num),
8199 ());
8200 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_2)
8201 ___P((___SCMOBJ obj,
8202 ___UCS_2 *x,
8203 int arg_num),
8204 ());
8205 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_4)
8206 ___P((___SCMOBJ obj,
8207 ___UCS_4 *x,
8208 int arg_num),
8209 ());
8210 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_WCHAR)
8211 ___P((___SCMOBJ obj,
8212 ___WCHAR *x,
8213 int arg_num),
8214 ());
8215 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_SHORT)
8216 ___P((___SCMOBJ obj,
8217 short *x,
8218 int arg_num),
8219 ());
8220 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_USHORT)
8221 ___P((___SCMOBJ obj,
8222 unsigned short *x,
8223 int arg_num),
8224 ());
8225 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_INT)
8226 ___P((___SCMOBJ obj,
8227 int *x,
8228 int arg_num),
8229 ());
8230 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UINT)
8231 ___P((___SCMOBJ obj,
8232 unsigned int *x,
8233 int arg_num),
8234 ());
8235 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_LONG)
8236 ___P((___SCMOBJ obj,
8237 long *x,
8238 int arg_num),
8239 ());
8240 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ULONG)
8241 ___P((___SCMOBJ obj,
8242 unsigned long *x,
8243 int arg_num),
8244 ());
8245 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_LONGLONG)
8246 ___P((___SCMOBJ obj,
8247 ___LONGLONG *x,
8248 int arg_num),
8249 ());
8250 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ULONGLONG)
8251 ___P((___SCMOBJ obj,
8252 ___ULONGLONG *x,
8253 int arg_num),
8254 ());
8255 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_FLOAT)
8256 ___P((___SCMOBJ obj,
8257 float *x,
8258 int arg_num),
8259 ());
8260 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_DOUBLE)
8261 ___P((___SCMOBJ obj,
8262 double *x,
8263 int arg_num),
8264 ());
8265 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_STRUCT)
8266 ___P((___SCMOBJ obj,
8267 void **x,
8268 ___SCMOBJ tags,
8269 int arg_num),
8270 ());
8271 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UNION)
8272 ___P((___SCMOBJ obj,
8273 void **x,
8274 ___SCMOBJ tags,
8275 int arg_num),
8276 ());
8277 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_TYPE)
8278 ___P((___SCMOBJ obj,
8279 void **x,
8280 ___SCMOBJ tags,
8281 int arg_num),
8282 ());
8283 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_POINTER)
8284 ___P((___SCMOBJ obj,
8285 void **x,
8286 ___SCMOBJ tags,
8287 int arg_num),
8288 ());
8289 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLPOINTER)
8290 ___P((___SCMOBJ obj,
8291 void **x,
8292 ___SCMOBJ tags,
8293 int arg_num),
8294 ());
8295 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_FUNCTION)
8296 ___P((___SCMOBJ obj,
8297 void *converter,
8298 void **x,
8299 int arg_num),
8300 ());
8301 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLFUNCTION)
8302 ___P((___SCMOBJ obj,
8303 void *converter,
8304 void **x,
8305 int arg_num),
8306 ());
8307 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_BOOL)
8308 ___P((___SCMOBJ obj,
8309 ___BOOL *x,
8310 int arg_num),
8311 ());
8312 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_STRING)
8313 ___P((___SCMOBJ obj,
8314 void **x,
8315 int arg_num,
8316 int char_encoding,
8317 int fudge),
8318 ());
8319 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLSTRING)
8320 ___P((___SCMOBJ obj,
8321 void **x,
8322 int arg_num,
8323 int char_encoding,
8324 int fudge),
8325 ());
8326 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLSTRINGLIST)
8327 ___P((___SCMOBJ obj,
8328 void **x,
8329 int arg_num,
8330 int char_encoding),
8331 ());
8332 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_CHARSTRING)
8333 ___P((___SCMOBJ obj,
8334 char **x,
8335 int arg_num),
8336 ());
8337 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLCHARSTRING)
8338 ___P((___SCMOBJ obj,
8339 char **x,
8340 int arg_num),
8341 ());
8342 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLCHARSTRINGLIST)
8343 ___P((___SCMOBJ obj,
8344 char ***x,
8345 int arg_num),
8346 ());
8347 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_ISO_8859_1STRING)
8348 ___P((___SCMOBJ obj,
8349 ___ISO_8859_1STRING *x,
8350 int arg_num),
8351 ());
8352 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLISO_8859_1STRING)
8353 ___P((___SCMOBJ obj,
8354 ___ISO_8859_1STRING *x,
8355 int arg_num),
8356 ());
8357 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLISO_8859_1STRINGLIST)
8358 ___P((___SCMOBJ obj,
8359 ___ISO_8859_1STRING **x,
8360 int arg_num),
8361 ());
8362 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UTF_8STRING)
8363 ___P((___SCMOBJ obj,
8364 ___UTF_8STRING *x,
8365 int arg_num),
8366 ());
8367 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_8STRING)
8368 ___P((___SCMOBJ obj,
8369 ___UTF_8STRING *x,
8370 int arg_num),
8371 ());
8372 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_8STRINGLIST)
8373 ___P((___SCMOBJ obj,
8374 ___UTF_8STRING **x,
8375 int arg_num),
8376 ());
8377 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UTF_16STRING)
8378 ___P((___SCMOBJ obj,
8379 ___UTF_16STRING *x,
8380 int arg_num),
8381 ());
8382 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_16STRING)
8383 ___P((___SCMOBJ obj,
8384 ___UTF_16STRING *x,
8385 int arg_num),
8386 ());
8387 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUTF_16STRINGLIST)
8388 ___P((___SCMOBJ obj,
8389 ___UTF_16STRING **x,
8390 int arg_num),
8391 ());
8392 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_2STRING)
8393 ___P((___SCMOBJ obj,
8394 ___UCS_2STRING *x,
8395 int arg_num),
8396 ());
8397 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_2STRING)
8398 ___P((___SCMOBJ obj,
8399 ___UCS_2STRING *x,
8400 int arg_num),
8401 ());
8402 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_2STRINGLIST)
8403 ___P((___SCMOBJ obj,
8404 ___UCS_2STRING **x,
8405 int arg_num),
8406 ());
8407 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_UCS_4STRING)
8408 ___P((___SCMOBJ obj,
8409 ___UCS_4STRING *x,
8410 int arg_num),
8411 ());
8412 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_4STRING)
8413 ___P((___SCMOBJ obj,
8414 ___UCS_4STRING *x,
8415 int arg_num),
8416 ());
8417 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLUCS_4STRINGLIST)
8418 ___P((___SCMOBJ obj,
8419 ___UCS_4STRING **x,
8420 int arg_num),
8421 ());
8422 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_WCHARSTRING)
8423 ___P((___SCMOBJ obj,
8424 ___WCHARSTRING *x,
8425 int arg_num),
8426 ());
8427 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLWCHARSTRING)
8428 ___P((___SCMOBJ obj,
8429 ___WCHARSTRING *x,
8430 int arg_num),
8431 ());
8432 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_NONNULLWCHARSTRINGLIST)
8433 ___P((___SCMOBJ obj,
8434 ___WCHARSTRING **x,
8435 int arg_num),
8436 ());
8437 ___IMP_FUNC(___SCMOBJ,___SCMOBJ_to_VARIANT)
8438 ___P((___SCMOBJ obj,
8439 ___VARIANT *x,
8440 int arg_num),
8441 ());
8442 ___IMP_FUNC(___SCMOBJ,___release_foreign)
8443 ___P((___SCMOBJ obj),
8444 ());
8445 ___IMP_FUNC(___SCMOBJ,___release_pointer)
8446 ___P((void *x),
8447 ());
8448 ___IMP_FUNC(___SCMOBJ,___release_function)
8449 ___P((void *x),
8450 ());
8451 ___IMP_FUNC(void,___addref_function)
8452 ___P((void *x),
8453 ());
8454 ___IMP_FUNC(void,___release_string)
8455 ___P((void *x),
8456 ());
8457 ___IMP_FUNC(void,___addref_string)
8458 ___P((void *x),
8459 ());
8460 ___IMP_FUNC(void,___release_string_list)
8461 ___P((void *x),
8462 ());
8463 ___IMP_FUNC(void,___addref_string_list)
8464 ___P((void *x),
8465 ());
8466 ___IMP_FUNC(void,___release_variant)
8467 ___P((___VARIANT x),
8468 ());
8469 ___IMP_FUNC(void,___addref_variant)
8470 ___P((___VARIANT x),
8471 ());
8472 ___IMP_FUNC(___SCMOBJ,___S8_to_SCMOBJ)
8473 ___P((___S8 x,
8474 ___SCMOBJ *obj,
8475 int arg_num),
8476 ());
8477 ___IMP_FUNC(___SCMOBJ,___U8_to_SCMOBJ)
8478 ___P((___U8 x,
8479 ___SCMOBJ *obj,
8480 int arg_num),
8481 ());
8482 ___IMP_FUNC(___SCMOBJ,___S16_to_SCMOBJ)
8483 ___P((___S16 x,
8484 ___SCMOBJ *obj,
8485 int arg_num),
8486 ());
8487 ___IMP_FUNC(___SCMOBJ,___U16_to_SCMOBJ)
8488 ___P((___U16 x,
8489 ___SCMOBJ *obj,
8490 int arg_num),
8491 ());
8492 ___IMP_FUNC(___SCMOBJ,___S32_to_SCMOBJ)
8493 ___P((___S32 x,
8494 ___SCMOBJ *obj,
8495 int arg_num),
8496 ());
8497 ___IMP_FUNC(___SCMOBJ,___U32_to_SCMOBJ)
8498 ___P((___U32 x,
8499 ___SCMOBJ *obj,
8500 int arg_num),
8501 ());
8502 ___IMP_FUNC(___SCMOBJ,___S64_to_SCMOBJ)
8503 ___P((___S64 x,
8504 ___SCMOBJ *obj,
8505 int arg_num),
8506 ());
8507 ___IMP_FUNC(___SCMOBJ,___U64_to_SCMOBJ)
8508 ___P((___U64 x,
8509 ___SCMOBJ *obj,
8510 int arg_num),
8511 ());
8512 ___IMP_FUNC(___SCMOBJ,___F32_to_SCMOBJ)
8513 ___P((___F32 x,
8514 ___SCMOBJ *obj,
8515 int arg_num),
8516 ());
8517 ___IMP_FUNC(___SCMOBJ,___F64_to_SCMOBJ)
8518 ___P((___F64 x,
8519 ___SCMOBJ *obj,
8520 int arg_num),
8521 ());
8522 ___IMP_FUNC(___SCMOBJ,___CHAR_to_SCMOBJ)
8523 ___P((char x,
8524 ___SCMOBJ *obj,
8525 int arg_num),
8526 ());
8527 ___IMP_FUNC(___SCMOBJ,___SCHAR_to_SCMOBJ)
8528 ___P((___SCHAR x,
8529 ___SCMOBJ *obj,
8530 int arg_num),
8531 ());
8532 ___IMP_FUNC(___SCMOBJ,___UCHAR_to_SCMOBJ)
8533 ___P((unsigned char x,
8534 ___SCMOBJ *obj,
8535 int arg_num),
8536 ());
8537 ___IMP_FUNC(___SCMOBJ,___ISO_8859_1_to_SCMOBJ)
8538 ___P((___ISO_8859_1 x,
8539 ___SCMOBJ *obj,
8540 int arg_num),
8541 ());
8542 ___IMP_FUNC(___SCMOBJ,___UCS_2_to_SCMOBJ)
8543 ___P((___UCS_2 x,
8544 ___SCMOBJ *obj,
8545 int arg_num),
8546 ());
8547 ___IMP_FUNC(___SCMOBJ,___UCS_4_to_SCMOBJ)
8548 ___P((___UCS_4 x,
8549 ___SCMOBJ *obj,
8550 int arg_num),
8551 ());
8552 ___IMP_FUNC(___SCMOBJ,___WCHAR_to_SCMOBJ)
8553 ___P((___WCHAR x,
8554 ___SCMOBJ *obj,
8555 int arg_num),
8556 ());
8557 ___IMP_FUNC(___SCMOBJ,___SHORT_to_SCMOBJ)
8558 ___P((short x,
8559 ___SCMOBJ *obj,
8560 int arg_num),
8561 ());
8562 ___IMP_FUNC(___SCMOBJ,___USHORT_to_SCMOBJ)
8563 ___P((unsigned short x,
8564 ___SCMOBJ *obj,
8565 int arg_num),
8566 ());
8567 ___IMP_FUNC(___SCMOBJ,___INT_to_SCMOBJ)
8568 ___P((int x,
8569 ___SCMOBJ *obj,
8570 int arg_num),
8571 ());
8572 ___IMP_FUNC(___SCMOBJ,___UINT_to_SCMOBJ)
8573 ___P((unsigned int x,
8574 ___SCMOBJ *obj,
8575 int arg_num),
8576 ());
8577 ___IMP_FUNC(___SCMOBJ,___LONG_to_SCMOBJ)
8578 ___P((long x,
8579 ___SCMOBJ *obj,
8580 int arg_num),
8581 ());
8582 ___IMP_FUNC(___SCMOBJ,___ULONG_to_SCMOBJ)
8583 ___P((unsigned long x,
8584 ___SCMOBJ *obj,
8585 int arg_num),
8586 ());
8587 ___IMP_FUNC(___SCMOBJ,___LONGLONG_to_SCMOBJ)
8588 ___P((___LONGLONG x,
8589 ___SCMOBJ *obj,
8590 int arg_num),
8591 ());
8592 ___IMP_FUNC(___SCMOBJ,___ULONGLONG_to_SCMOBJ)
8593 ___P((___ULONGLONG x,
8594 ___SCMOBJ *obj,
8595 int arg_num),
8596 ());
8597 ___IMP_FUNC(___SCMOBJ,___FLOAT_to_SCMOBJ)
8598 ___P((float x,
8599 ___SCMOBJ *obj,
8600 int arg_num),
8601 ());
8602 ___IMP_FUNC(___SCMOBJ,___DOUBLE_to_SCMOBJ)
8603 ___P((double x,
8604 ___SCMOBJ *obj,
8605 int arg_num),
8606 ());
8607 ___IMP_FUNC(___SCMOBJ,___STRUCT_to_SCMOBJ)
8608 ___P((void *x,
8609 ___SCMOBJ tags,
8610 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8611 ___SCMOBJ *obj,
8612 int arg_num),
8613 ());
8614 ___IMP_FUNC(___SCMOBJ,___UNION_to_SCMOBJ)
8615 ___P((void *x,
8616 ___SCMOBJ tags,
8617 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8618 ___SCMOBJ *obj,
8619 int arg_num),
8620 ());
8621 ___IMP_FUNC(___SCMOBJ,___TYPE_to_SCMOBJ)
8622 ___P((void *x,
8623 ___SCMOBJ tags,
8624 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8625 ___SCMOBJ *obj,
8626 int arg_num),
8627 ());
8628 ___IMP_FUNC(___SCMOBJ,___POINTER_to_SCMOBJ)
8629 ___P((void *x,
8630 ___SCMOBJ tags,
8631 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8632 ___SCMOBJ *obj,
8633 int arg_num),
8634 ());
8635 ___IMP_FUNC(___SCMOBJ,___NONNULLPOINTER_to_SCMOBJ)
8636 ___P((void *x,
8637 ___SCMOBJ tags,
8638 ___SCMOBJ (*release_fn) ___P((void *ptr),()),
8639 ___SCMOBJ *obj,
8640 int arg_num),
8641 ());
8642 ___IMP_FUNC(___SCMOBJ,___FUNCTION_to_SCMOBJ)
8643 ___P((void *x,
8644 ___SCMOBJ *obj,
8645 int arg_num),
8646 ());
8647 ___IMP_FUNC(___SCMOBJ,___NONNULLFUNCTION_to_SCMOBJ)
8648 ___P((void *x,
8649 ___SCMOBJ *obj,
8650 int arg_num),
8651 ());
8652 ___IMP_FUNC(___SCMOBJ,___BOOL_to_SCMOBJ)
8653 ___P((___BOOL x,
8654 ___SCMOBJ *obj,
8655 int arg_num),
8656 ());
8657 ___IMP_FUNC(___SCMOBJ,___STRING_to_SCMOBJ)
8658 ___P((void *x,
8659 ___SCMOBJ *obj,
8660 int arg_num,
8661 int char_encoding),
8662 ());
8663 ___IMP_FUNC(___SCMOBJ,___NONNULLSTRING_to_SCMOBJ)
8664 ___P((void *x,
8665 ___SCMOBJ *obj,
8666 int arg_num,
8667 int char_encoding),
8668 ());
8669 ___IMP_FUNC(___SCMOBJ,___NONNULLSTRINGLIST_to_SCMOBJ)
8670 ___P((void *x,
8671 ___SCMOBJ *obj,
8672 int arg_num,
8673 int char_encoding),
8674 ());
8675 ___IMP_FUNC(___SCMOBJ,___CHARSTRING_to_SCMOBJ)
8676 ___P((char *x,
8677 ___SCMOBJ *obj,
8678 int arg_num),
8679 ());
8680 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRING_to_SCMOBJ)
8681 ___P((char *x,
8682 ___SCMOBJ *obj,
8683 int arg_num),
8684 ());
8685 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRINGLIST_to_SCMOBJ)
8686 ___P((char **x,
8687 ___SCMOBJ *obj,
8688 int arg_num),
8689 ());
8690 ___IMP_FUNC(___SCMOBJ,___ISO_8859_1STRING_to_SCMOBJ)
8691 ___P((___ISO_8859_1STRING x,
8692 ___SCMOBJ *obj,
8693 int arg_num),
8694 ());
8695 ___IMP_FUNC(___SCMOBJ,___NONNULLISO_8859_1STRING_to_SCMOBJ)
8696 ___P((___ISO_8859_1STRING x,
8697 ___SCMOBJ *obj,
8698 int arg_num),
8699 ());
8700 ___IMP_FUNC(___SCMOBJ,___NONNULLISO_8859_1STRINGLIST_to_SCMOBJ)
8701 ___P((___ISO_8859_1STRING *x,
8702 ___SCMOBJ *obj,
8703 int arg_num),
8704 ());
8705 ___IMP_FUNC(___SCMOBJ,___UTF_8STRING_to_SCMOBJ)
8706 ___P((___UTF_8STRING x,
8707 ___SCMOBJ *obj,
8708 int arg_num),
8709 ());
8710 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_8STRING_to_SCMOBJ)
8711 ___P((___UTF_8STRING x,
8712 ___SCMOBJ *obj,
8713 int arg_num),
8714 ());
8715 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_8STRINGLIST_to_SCMOBJ)
8716 ___P((___UTF_8STRING *x,
8717 ___SCMOBJ *obj,
8718 int arg_num),
8719 ());
8720 ___IMP_FUNC(___SCMOBJ,___UTF_16STRING_to_SCMOBJ)
8721 ___P((___UTF_16STRING x,
8722 ___SCMOBJ *obj,
8723 int arg_num),
8724 ());
8725 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_16STRING_to_SCMOBJ)
8726 ___P((___UTF_16STRING x,
8727 ___SCMOBJ *obj,
8728 int arg_num),
8729 ());
8730 ___IMP_FUNC(___SCMOBJ,___NONNULLUTF_16STRINGLIST_to_SCMOBJ)
8731 ___P((___UTF_16STRING *x,
8732 ___SCMOBJ *obj,
8733 int arg_num),
8734 ());
8735 ___IMP_FUNC(___SCMOBJ,___UCS_2STRING_to_SCMOBJ)
8736 ___P((___UCS_2STRING x,
8737 ___SCMOBJ *obj,
8738 int arg_num),
8739 ());
8740 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_2STRING_to_SCMOBJ)
8741 ___P((___UCS_2STRING x,
8742 ___SCMOBJ *obj,
8743 int arg_num),
8744 ());
8745 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_2STRINGLIST_to_SCMOBJ)
8746 ___P((___UCS_2STRING *x,
8747 ___SCMOBJ *obj,
8748 int arg_num),
8749 ());
8750 ___IMP_FUNC(___SCMOBJ,___UCS_4STRING_to_SCMOBJ)
8751 ___P((___UCS_4STRING x,
8752 ___SCMOBJ *obj,
8753 int arg_num),
8754 ());
8755 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_4STRING_to_SCMOBJ)
8756 ___P((___UCS_4STRING x,
8757 ___SCMOBJ *obj,
8758 int arg_num),
8759 ());
8760 ___IMP_FUNC(___SCMOBJ,___NONNULLUCS_4STRINGLIST_to_SCMOBJ)
8761 ___P((___UCS_4STRING *x,
8762 ___SCMOBJ *obj,
8763 int arg_num),
8764 ());
8765 ___IMP_FUNC(___SCMOBJ,___WCHARSTRING_to_SCMOBJ)
8766 ___P((___WCHARSTRING x,
8767 ___SCMOBJ *obj,
8768 int arg_num),
8769 ());
8770 ___IMP_FUNC(___SCMOBJ,___NONNULLWCHARSTRING_to_SCMOBJ)
8771 ___P((___WCHARSTRING x,
8772 ___SCMOBJ *obj,
8773 int arg_num),
8774 ());
8775 ___IMP_FUNC(___SCMOBJ,___NONNULLWCHARSTRINGLIST_to_SCMOBJ)
8776 ___P((___WCHARSTRING *x,
8777 ___SCMOBJ *obj,
8778 int arg_num),
8779 ());
8780 ___IMP_FUNC(___SCMOBJ,___VARIANT_to_SCMOBJ)
8781 ___P((___VARIANT x,
8782 ___SCMOBJ *obj,
8783 int arg_num),
8784 ());
8785 ___IMP_FUNC(___SCMOBJ,___CHARSTRING_to_UCS_2STRING)
8786 ___P((char *str_char,
8787 ___UCS_2STRING *str_UCS_2),
8788 ());
8789 ___IMP_FUNC(void,___free_UCS_2STRING)
8790 ___P((___UCS_2STRING str_UCS_2),
8791 ());
8792 ___IMP_FUNC(___SCMOBJ,___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST)
8793 ___P((char **str_list_char,
8794 ___UCS_2STRING **str_list_UCS_2),
8795 ());
8796 ___IMP_FUNC(void,___free_NONNULLUCS_2STRINGLIST)
8797 ___P((___UCS_2STRING *str_list_UCS_2),
8798 ());
8799 ___IMP_FUNC(___SCMOBJ,___make_sfun_stack_marker)
8800 ___P((___SCMOBJ *marker,
8801 ___SCMOBJ proc_or_false),
8802 ());
8803 ___IMP_FUNC(void,___kill_sfun_stack_marker)
8804 ___P((___SCMOBJ marker),
8805 ());
8806 #endif
8808 #ifndef ___INCLUDED_FROM_MEM
8809 ___IMP_FUNC(void*,___alloc_rc)
8810 ___P((unsigned long bytes),
8811 ());
8812 ___IMP_FUNC(void,___release_rc)
8813 ___P((void *ptr),
8814 ());
8815 ___IMP_FUNC(void,___addref_rc)
8816 ___P((void *ptr),
8817 ());
8818 ___IMP_FUNC(___SCMOBJ,___data_rc)
8819 ___P((void *ptr),
8820 ());
8821 ___IMP_FUNC(void,___set_data_rc)
8822 ___P((void *ptr,
8823 ___SCMOBJ val),
8824 ());
8825 ___IMP_FUNC(___SCMOBJ,___alloc_scmobj)
8826 ___P((int subtype,
8827 long bytes,
8828 int kind),
8829 ());
8830 ___IMP_FUNC(void,___release_scmobj)
8831 ___P((___SCMOBJ obj),
8832 ());
8833 ___IMP_FUNC(___SCMOBJ,___make_pair)
8834 ___P((___SCMOBJ car,
8835 ___SCMOBJ cdr,
8836 int kind),
8837 ());
8838 ___IMP_FUNC(___SCMOBJ,___make_vector)
8839 ___P((long length,
8840 ___SCMOBJ init,
8841 int kind),
8842 ());
8843 ___IMP_FUNC(void,___still_obj_refcount_inc)
8844 ___P((___SCMOBJ obj),
8845 ());
8846 ___IMP_FUNC(void,___still_obj_refcount_dec)
8847 ___P((___SCMOBJ obj),
8848 ());
8849 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_ref)
8850 ___P((___SCMOBJ ht,
8851 ___SCMOBJ key),
8852 ());
8853 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_set)
8854 ___P((___SCMOBJ ht,
8855 ___SCMOBJ key,
8856 ___SCMOBJ val),
8857 ());
8858 ___IMP_FUNC(___SCMOBJ,___gc_hash_table_rehash)
8859 ___P((___SCMOBJ ht_src,
8860 ___SCMOBJ ht_dst),
8861 ());
8862 #endif
8864 #ifndef ___INCLUDED_FROM_SETUP
8865 ___GSTATE_DECL
8866 ___IMP_FUNC(___BOOL,___iswalpha)
8867 ___P((___UCS_4 x),
8868 ());
8869 ___IMP_FUNC(___BOOL,___iswdigit)
8870 ___P((___UCS_4 x),
8871 ());
8872 ___IMP_FUNC(___BOOL,___iswspace)
8873 ___P((___UCS_4 x),
8874 ());
8875 ___IMP_FUNC(___BOOL,___iswupper)
8876 ___P((___UCS_4 x),
8877 ());
8878 ___IMP_FUNC(___BOOL,___iswlower)
8879 ___P((___UCS_4 x),
8880 ());
8881 ___IMP_FUNC(___UCS_4,___towupper)
8882 ___P((___UCS_4 x),
8883 ());
8884 ___IMP_FUNC(___UCS_4,___towlower)
8885 ___P((___UCS_4 x),
8886 ());
8887 ___IMP_FUNC(___SCMOBJ,___string_collate)
8888 ___P((___SCMOBJ s1,
8889 ___SCMOBJ s2),
8890 ());
8891 ___IMP_FUNC(___SCMOBJ,___string_collate_ci)
8892 ___P((___SCMOBJ s1,
8893 ___SCMOBJ s2),
8894 ());
8895 ___IMP_FUNC(double,___copysign)
8896 ___P((double x,
8897 double y),
8898 ());
8899 ___IMP_FUNC(___BOOL,___isfinite)
8900 ___P((double x),
8901 ());
8902 ___IMP_FUNC(___BOOL,___isnan)
8903 ___P((double x),
8904 ());
8905 ___IMP_FUNC(double,___trunc)
8906 ___P((double x),
8907 ());
8908 ___IMP_FUNC(double,___round)
8909 ___P((double x),
8910 ());
8911 #ifndef ___GOOD_ATAN2
8912 ___IMP_FUNC(double,___atan2)
8913 ___P((double y,
8914 double x),
8915 ());
8916 #endif
8917 #ifndef ___GOOD_POW
8918 ___IMP_FUNC(double,___pow)
8919 ___P((double x,
8920 double y),
8921 ());
8922 #endif
8923 ___IMP_FUNC(void,___setup_params_reset)
8924 ___P((struct ___setup_params_struct *setup_params),
8925 ());
8926 ___IMP_FUNC(___SCMOBJ,___setup)
8927 ___P((struct ___setup_params_struct *setup_params),
8928 ());
8929 ___IMP_FUNC(unsigned long,___get_min_heap) ___PVOID;
8930 ___IMP_FUNC(void,___set_min_heap)
8931 ___P((unsigned long bytes),
8932 ());
8933 ___IMP_FUNC(unsigned long,___get_max_heap) ___PVOID;
8934 ___IMP_FUNC(void,___set_max_heap)
8935 ___P((unsigned long bytes),
8936 ());
8937 ___IMP_FUNC(int,___get_live_percent) ___PVOID;
8938 ___IMP_FUNC(void,___set_live_percent)
8939 ___P((int percent),
8940 ());
8941 ___IMP_FUNC(int,___get_standard_level) ___PVOID;
8942 ___IMP_FUNC(void,___set_standard_level)
8943 ___P((int level),
8944 ());
8945 ___IMP_FUNC(int,___set_debug_settings)
8946 ___P((int mask,
8947 int new_settings),
8948 ());
8949 ___IMP_FUNC(___program_startup_info_struct*,___get_program_startup_info)
8950 ___PVOID;
8951 ___IMP_FUNC(void,___cleanup) ___PVOID;
8952 ___IMP_FUNC(void,___cleanup_and_exit_process)
8953 ___P((int status),
8954 ());
8955 ___IMP_FUNC(___SCMOBJ,___call)
8956 ___P((int nargs,
8957 ___SCMOBJ proc,
8958 ___SCMOBJ marker),
8959 ());
8960 ___IMP_FUNC(void,___propagate_error)
8961 ___P((___SCMOBJ err),
8962 ());
8963 #ifdef ___DEBUG_HOST_CHANGES
8964 ___IMP_FUNC(void,___register_host_entry)
8965 ___P((___WORD start,
8966 char *module_name),
8967 ());
8968 #endif
8969 ___IMP_FUNC(void,___raise_interrupt)
8970 ___P((int code),
8971 ());
8972 ___IMP_FUNC(void,___begin_interrupt_service) ___PVOID;
8973 ___IMP_FUNC(___BOOL,___check_interrupt)
8974 ___P((int code),
8975 ());
8976 ___IMP_FUNC(void,___end_interrupt_service)
8977 ___P((int code),
8978 ());
8979 ___IMP_FUNC(void,___disable_interrupts) ___PVOID;
8980 ___IMP_FUNC(void,___enable_interrupts) ___PVOID;
8981 #endif
8983 #ifndef ___INCLUDED_FROM_OS_BASE
8984 ___IMP_FUNC(void *,___alloc_mem)
8985 ___P((unsigned long bytes),
8986 ());
8987 ___IMP_FUNC(void,___free_mem)
8988 ___P((void *ptr),
8989 ());
8990 #endif
8992 #endif
8993 #endif