0000: 23 69 66 6e 64 65 66 20 5f 56 41 43 41 4c 4c 5f #ifndef _VACALL_
0010: 48 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 H
0020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0030: 2f 2a 2d 2a 2d 20 43 20 2d 2a 2d 2a 2f 0a 23 64 /*-*- C -*-*/.#d
0040: 65 66 69 6e 65 20 5f 56 41 43 41 4c 4c 5f 48 0a efine _VACALL_H.
0050: 0a 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 ./*. * Copyright
0060: 20 31 39 39 35 2d 32 30 30 36 20 42 72 75 6e 6f 1995-2006 Bruno
0070: 20 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f 40 Haible, <bruno@
0080: 63 6c 69 73 70 2e 6f 72 67 3e 0a 20 2a 0a 20 2a clisp.org>. *. *
0090: 20 54 68 69 73 20 69 73 20 66 72 65 65 20 73 6f This is free so
00a0: 66 74 77 61 72 65 20 64 69 73 74 72 69 62 75 74 ftware distribut
00b0: 65 64 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 ed under the GNU
00c0: 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 General Public
00d0: 4c 69 63 65 6e 63 65 0a 20 2a 20 64 65 73 63 72 Licence. * descr
00e0: 69 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 ibed in the file
00f0: 20 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 COPYING. Contac
0100: 74 20 74 68 65 20 61 75 74 68 6f 72 20 69 66 20 t the author if
0110: 79 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74 you don't have t
0120: 68 69 73 0a 20 2a 20 6f 72 20 63 61 6e 27 74 20 his. * or can't
0130: 6c 69 76 65 20 77 69 74 68 20 69 74 2e 20 54 68 live with it. Th
0140: 65 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45 4c ere is ABSOLUTEL
0150: 59 20 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20 65 Y NO WARRANTY, e
0160: 78 70 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c 69 xplicit or impli
0170: 65 64 2c 0a 20 2a 20 6f 6e 20 74 68 69 73 20 73 ed,. * on this s
0180: 6f 66 74 77 61 72 65 2e 0a 20 2a 2f 0a 0a 23 69 oftware.. */..#i
0190: 66 20 21 64 65 66 69 6e 65 64 28 4c 49 42 46 46 f !defined(LIBFF
01a0: 43 41 4c 4c 5f 56 45 52 53 49 4f 4e 29 0a 23 20 CALL_VERSION).#
01b0: 64 65 66 69 6e 65 20 4c 49 42 46 46 43 41 4c 4c define LIBFFCALL
01c0: 5f 56 45 52 53 49 4f 4e 20 40 4c 49 42 46 46 43 _VERSION @LIBFFC
01d0: 41 4c 4c 5f 56 45 52 53 49 4f 4e 40 0a 23 65 6e ALL_VERSION@.#en
01e0: 64 69 66 0a 0a 2f 2a 20 54 68 65 73 65 20 64 65 dif../* These de
01f0: 66 69 6e 69 74 69 6f 6e 73 20 61 72 65 20 61 64 finitions are ad
0200: 6a 75 73 74 65 64 20 62 79 20 60 63 6f 6e 66 69 justed by `confi
0210: 67 75 72 65 27 20 61 75 74 6f 6d 61 74 69 63 61 gure' automatica
0220: 6c 6c 79 2e 20 2a 2f 0a 0a 2f 2a 20 43 50 55 20 lly. */../* CPU
0230: 2a 2f 0a 23 69 66 6e 64 65 66 20 5f 5f 69 33 38 */.#ifndef __i38
0240: 36 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 69 33 38 6__.#undef __i38
0250: 36 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64 6__.#endif.#ifnd
0260: 65 66 20 5f 5f 6d 36 38 6b 5f 5f 0a 23 75 6e 64 ef __m68k__.#und
0270: 65 66 20 5f 5f 6d 36 38 6b 5f 5f 0a 23 65 6e 64 ef __m68k__.#end
0280: 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 6d 69 70 if.#ifndef __mip
0290: 73 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 6d 69 70 s__.#undef __mip
02a0: 73 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64 s__.#endif.#ifnd
02b0: 65 66 20 5f 5f 6d 69 70 73 6e 33 32 5f 5f 0a 23 ef __mipsn32__.#
02c0: 75 6e 64 65 66 20 5f 5f 6d 69 70 73 6e 33 32 5f undef __mipsn32_
02d0: 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 _.#endif.#ifndef
02e0: 20 5f 5f 6d 69 70 73 36 34 5f 5f 0a 23 75 6e 64 __mips64__.#und
02f0: 65 66 20 5f 5f 6d 69 70 73 36 34 5f 5f 0a 23 65 ef __mips64__.#e
0300: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 73 ndif.#ifndef __s
0310: 70 61 72 63 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f parc__.#undef __
0320: 73 70 61 72 63 5f 5f 0a 23 65 6e 64 69 66 0a 23 sparc__.#endif.#
0330: 69 66 6e 64 65 66 20 5f 5f 73 70 61 72 63 36 34 ifndef __sparc64
0340: 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 73 70 61 72 __.#undef __spar
0350: 63 36 34 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 c64__.#endif.#if
0360: 6e 64 65 66 20 5f 5f 61 6c 70 68 61 5f 5f 0a 23 ndef __alpha__.#
0370: 75 6e 64 65 66 20 5f 5f 61 6c 70 68 61 5f 5f 0a undef __alpha__.
0380: 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f #endif.#ifndef _
0390: 5f 68 70 70 61 5f 5f 0a 23 75 6e 64 65 66 20 5f _hppa__.#undef _
03a0: 5f 68 70 70 61 5f 5f 0a 23 65 6e 64 69 66 0a 23 _hppa__.#endif.#
03b0: 69 66 6e 64 65 66 20 5f 5f 61 72 6d 5f 5f 0a 23 ifndef __arm__.#
03c0: 75 6e 64 65 66 20 5f 5f 61 72 6d 5f 5f 0a 23 65 undef __arm__.#e
03d0: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 70 ndif.#ifndef __p
03e0: 6f 77 65 72 70 63 5f 5f 0a 23 75 6e 64 65 66 20 owerpc__.#undef
03f0: 5f 5f 70 6f 77 65 72 70 63 5f 5f 0a 23 65 6e 64 __powerpc__.#end
0400: 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 70 6f 77 if.#ifndef __pow
0410: 65 72 70 63 36 34 5f 5f 0a 23 75 6e 64 65 66 20 erpc64__.#undef
0420: 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 0a 23 65 __powerpc64__.#e
0430: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 73 ndif.#ifndef __s
0440: 33 39 30 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 73 390__.#undef __s
0450: 33 39 30 5f 5f 0a 23 65 6e 64 69 66 0a 23 69 66 390__.#endif.#if
0460: 6e 64 65 66 20 5f 5f 6d 38 38 6b 5f 5f 0a 23 75 ndef __m88k__.#u
0470: 6e 64 65 66 20 5f 5f 6d 38 38 6b 5f 5f 0a 23 65 ndef __m88k__.#e
0480: 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 5f 5f 63 ndif.#ifndef __c
0490: 6f 6e 76 65 78 5f 5f 0a 23 75 6e 64 65 66 20 5f onvex__.#undef _
04a0: 5f 63 6f 6e 76 65 78 5f 5f 0a 23 65 6e 64 69 66 _convex__.#endif
04b0: 0a 23 69 66 6e 64 65 66 20 5f 5f 69 61 36 34 5f .#ifndef __ia64_
04c0: 5f 0a 23 75 6e 64 65 66 20 5f 5f 69 61 36 34 5f _.#undef __ia64_
04d0: 5f 0a 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 _.#endif.#ifndef
04e0: 20 5f 5f 78 38 36 5f 36 34 5f 5f 0a 23 75 6e 64 __x86_64__.#und
04f0: 65 66 20 5f 5f 78 38 36 5f 36 34 5f 5f 0a 23 65 ef __x86_64__.#e
0500: 6e 64 69 66 0a 0a 2f 2a 20 43 61 6c 6c 69 6e 67 ndif../* Calling
0510: 20 63 6f 6e 76 65 6e 74 69 6f 6e 20 2a 2f 0a 2f convention */./
0520: 2a 20 44 65 66 69 6e 65 20 69 66 20 75 73 69 6e * Define if usin
0530: 67 20 70 63 63 20 6e 6f 6e 2d 72 65 65 6e 74 72 g pcc non-reentr
0540: 61 6e 74 20 73 74 72 75 63 74 20 72 65 74 75 72 ant struct retur
0550: 6e 20 63 6f 6e 76 65 6e 74 69 6f 6e 20 2a 2f 0a n convention */.
0560: 23 75 6e 64 65 66 20 5f 5f 50 43 43 5f 53 54 52 #undef __PCC_STR
0570: 55 43 54 5f 52 45 54 55 52 4e 5f 5f 0a 2f 2a 20 UCT_RETURN__./*
0580: 44 65 66 69 6e 65 20 69 66 20 73 6d 61 6c 6c 20 Define if small
0590: 73 74 72 75 63 74 73 20 61 72 65 20 72 65 74 75 structs are retu
05a0: 72 6e 65 64 20 69 6e 20 72 65 67 69 73 74 65 72 rned in register
05b0: 73 20 2a 2f 0a 23 75 6e 64 65 66 20 5f 5f 53 4d s */.#undef __SM
05c0: 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 54 55 52 ALL_STRUCT_RETUR
05d0: 4e 5f 5f 0a 2f 2a 20 44 65 66 69 6e 65 20 69 66 N__./* Define if
05e0: 20 66 6c 6f 61 74 69 6e 67 2d 70 6f 69 6e 74 20 floating-point
05f0: 72 65 73 75 6c 74 73 20 61 72 65 20 72 65 74 75 results are retu
0600: 72 6e 65 64 20 69 6e 20 74 68 65 20 69 6e 74 65 rned in the inte
0610: 67 65 72 20 72 65 67 69 73 74 65 72 73 20 2a 2f ger registers */
0620: 0a 23 75 6e 64 65 66 20 5f 5f 49 52 45 47 5f 46 .#undef __IREG_F
0630: 4c 4f 41 54 5f 52 45 54 55 52 4e 5f 5f 0a 0a 2f LOAT_RETURN__../
0640: 2a 20 41 43 5f 54 59 50 45 5f 4c 4f 4e 47 5f 4c * AC_TYPE_LONG_L
0650: 4f 4e 47 20 2a 2f 0a 2f 2a 20 44 65 66 69 6e 65 ONG */./* Define
0660: 20 69 66 20 79 6f 75 72 20 63 6f 6d 70 69 6c 65 if your compile
0670: 72 20 73 75 70 70 6f 72 74 73 20 74 68 65 20 27 r supports the '
0680: 6c 6f 6e 67 20 6c 6f 6e 67 27 20 74 79 70 65 2e long long' type.
0690: 20 2a 2f 0a 23 69 66 6e 64 65 66 20 48 41 56 45 */.#ifndef HAVE
06a0: 5f 4c 4f 4e 47 5f 4c 4f 4e 47 5f 49 4e 54 0a 23 _LONG_LONG_INT.#
06b0: 75 6e 64 65 66 20 48 41 56 45 5f 4c 4f 4e 47 5f undef HAVE_LONG_
06c0: 4c 4f 4e 47 5f 49 4e 54 0a 23 65 6e 64 69 66 0a LONG_INT.#endif.
06d0: 0a 2f 2a 20 41 43 5f 43 5f 43 48 41 52 5f 55 4e ./* AC_C_CHAR_UN
06e0: 53 49 47 4e 45 44 20 2a 2f 0a 23 69 66 6e 64 65 SIGNED */.#ifnde
06f0: 66 20 5f 5f 43 48 41 52 5f 55 4e 53 49 47 4e 45 f __CHAR_UNSIGNE
0700: 44 5f 5f 0a 23 75 6e 64 65 66 20 5f 5f 43 48 41 D__.#undef __CHA
0710: 52 5f 55 4e 53 49 47 4e 45 44 5f 5f 0a 23 65 6e R_UNSIGNED__.#en
0720: 64 69 66 0a 0a 2f 2a 20 45 6e 64 20 6f 66 20 64 dif../* End of d
0730: 65 66 69 6e 69 74 69 6f 6e 73 20 61 64 6a 75 73 efinitions adjus
0740: 74 65 64 20 62 79 20 60 63 6f 6e 66 69 67 75 72 ted by `configur
0750: 65 27 2e 20 2a 2f 0a 0a 0a 2f 2a 20 4d 61 78 20 e'. */.../* Max
0760: 23 20 77 6f 72 64 73 20 69 6e 20 61 72 67 75 6d # words in argum
0770: 65 6e 74 2d 6c 69 73 74 20 61 6e 64 20 74 65 6d ent-list and tem
0780: 70 6f 72 61 72 79 20 73 74 72 75 63 74 75 72 65 porary structure
0790: 20 73 74 6f 72 61 67 65 2e 0a 20 2a 2f 0a 23 69 storage.. */.#i
07a0: 66 6e 64 65 66 20 5f 5f 56 41 5f 41 4c 49 53 54 fndef __VA_ALIST
07b0: 5f 57 4f 52 44 53 0a 23 64 65 66 69 6e 65 20 5f _WORDS.#define _
07c0: 5f 56 41 5f 41 4c 49 53 54 5f 57 4f 52 44 53 20 _VA_ALIST_WORDS
07d0: 20 32 35 36 0a 23 65 6e 64 69 66 0a 0a 2f 2a 20 256.#endif../*
07e0: 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20 61 6c Determine the al
07f0: 69 67 6e 6d 65 6e 74 20 6f 66 20 61 20 74 79 70 ignment of a typ
0800: 65 20 61 74 20 63 6f 6d 70 69 6c 65 20 74 69 6d e at compile tim
0810: 65 2e 0a 20 2a 2f 0a 23 69 66 20 64 65 66 69 6e e.. */.#if defin
0820: 65 64 28 5f 5f 47 4e 55 43 5f 5f 29 0a 23 64 65 ed(__GNUC__).#de
0830: 66 69 6e 65 20 5f 5f 56 41 5f 61 6c 69 67 6e 6f fine __VA_aligno
0840: 66 20 5f 5f 61 6c 69 67 6e 6f 66 5f 5f 0a 23 65 f __alignof__.#e
0850: 6c 73 65 0a 23 69 66 20 64 65 66 69 6e 65 64 28 lse.#if defined(
0860: 5f 5f 6d 69 70 73 5f 5f 29 20 7c 7c 20 64 65 66 __mips__) || def
0870: 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f ined(__mipsn32__
0880: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d ) || defined(__m
0890: 69 70 73 36 34 5f 5f 29 20 2f 2a 20 53 47 49 20 ips64__) /* SGI
08a0: 63 6f 6d 70 69 6c 65 72 20 2a 2f 0a 23 64 65 66 compiler */.#def
08b0: 69 6e 65 20 5f 5f 56 41 5f 61 6c 69 67 6e 6f 66 ine __VA_alignof
08c0: 20 5f 5f 62 75 69 6c 74 69 6e 5f 61 6c 69 67 6e __builtin_align
08d0: 6f 66 0a 23 65 6c 73 65 0a 23 64 65 66 69 6e 65 of.#else.#define
08e0: 20 5f 5f 56 41 5f 6f 66 66 73 65 74 6f 66 28 74 __VA_offsetof(t
08f0: 79 70 65 2c 69 64 65 6e 74 29 20 20 28 28 75 6e ype,ident) ((un
0900: 73 69 67 6e 65 64 20 6c 6f 6e 67 29 26 28 28 28 signed long)&(((
0910: 74 79 70 65 2a 29 30 29 2d 3e 69 64 65 6e 74 29 type*)0)->ident)
0920: 29 0a 23 64 65 66 69 6e 65 20 5f 5f 56 41 5f 61 ).#define __VA_a
0930: 6c 69 67 6e 6f 66 28 74 79 70 65 29 20 20 5f 5f lignof(type) __
0940: 56 41 5f 6f 66 66 73 65 74 6f 66 28 73 74 72 75 VA_offsetof(stru
0950: 63 74 20 7b 20 63 68 61 72 20 5f 5f 73 6c 6f 74 ct { char __slot
0960: 31 3b 20 74 79 70 65 20 5f 5f 73 6c 6f 74 32 3b 1; type __slot2;
0970: 20 7d 2c 20 5f 5f 73 6c 6f 74 32 29 0a 23 65 6e }, __slot2).#en
0980: 64 69 66 0a 23 65 6e 64 69 66 0a 0a 2f 2a 20 43 dif.#endif../* C
0990: 20 62 75 69 6c 74 69 6e 20 74 79 70 65 73 2e 0a builtin types..
09a0: 20 2a 2f 0a 23 69 66 20 64 65 66 69 6e 65 64 28 */.#if defined(
09b0: 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 0a 74 79 70 __mipsn32__).typ
09c0: 65 64 65 66 20 6c 6f 6e 67 20 6c 6f 6e 67 20 5f edef long long _
09d0: 5f 76 61 77 6f 72 64 3b 0a 23 65 6c 73 65 0a 74 _vaword;.#else.t
09e0: 79 70 65 64 65 66 20 6c 6f 6e 67 20 5f 5f 76 61 ypedef long __va
09f0: 77 6f 72 64 3b 0a 23 65 6e 64 69 66 0a 0a 65 6e word;.#endif..en
0a00: 75 6d 20 5f 5f 56 41 74 79 70 65 0a 7b 0a 20 20 um __VAtype.{.
0a10: 5f 5f 56 41 76 6f 69 64 2c 0a 20 20 5f 5f 56 41 __VAvoid,. __VA
0a20: 63 68 61 72 2c 0a 20 20 5f 5f 56 41 73 63 68 61 char,. __VAscha
0a30: 72 2c 0a 20 20 5f 5f 56 41 75 63 68 61 72 2c 0a r,. __VAuchar,.
0a40: 20 20 5f 5f 56 41 73 68 6f 72 74 2c 0a 20 20 5f __VAshort,. _
0a50: 5f 56 41 75 73 68 6f 72 74 2c 0a 20 20 5f 5f 56 _VAushort,. __V
0a60: 41 69 6e 74 2c 0a 20 20 5f 5f 56 41 75 69 6e 74 Aint,. __VAuint
0a70: 2c 0a 20 20 5f 5f 56 41 6c 6f 6e 67 2c 0a 20 20 ,. __VAlong,.
0a80: 5f 5f 56 41 75 6c 6f 6e 67 2c 0a 20 20 5f 5f 56 __VAulong,. __V
0a90: 41 6c 6f 6e 67 6c 6f 6e 67 2c 0a 20 20 5f 5f 56 Alonglong,. __V
0aa0: 41 75 6c 6f 6e 67 6c 6f 6e 67 2c 0a 20 20 5f 5f Aulonglong,. __
0ab0: 56 41 66 6c 6f 61 74 2c 0a 20 20 5f 5f 56 41 64 VAfloat,. __VAd
0ac0: 6f 75 62 6c 65 2c 0a 20 20 5f 5f 56 41 76 6f 69 ouble,. __VAvoi
0ad0: 64 70 2c 0a 20 20 5f 5f 56 41 73 74 72 75 63 74 dp,. __VAstruct
0ae0: 0a 7d 3b 0a 0a 65 6e 75 6d 20 5f 5f 56 41 5f 61 .};..enum __VA_a
0af0: 6c 69 73 74 5f 66 6c 61 67 73 0a 7b 0a 0a 20 20 list_flags.{..
0b00: 2f 2a 20 68 6f 77 20 74 6f 20 72 65 74 75 72 6e /* how to return
0b10: 20 73 74 72 75 63 74 73 20 2a 2f 0a 20 20 2f 2a structs */. /*
0b20: 20 54 68 65 72 65 20 61 72 65 20 62 61 73 69 63 There are basic
0b30: 61 6c 6c 79 20 33 20 77 61 79 73 20 74 6f 20 72 ally 3 ways to r
0b40: 65 74 75 72 6e 20 73 74 72 75 63 74 73 3a 0a 20 eturn structs:.
0b50: 20 20 2a 20 61 2e 20 54 68 65 20 63 61 6c 6c 65 * a. The calle
0b60: 64 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 d function retur
0b70: 6e 73 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 ns a pointer to
0b80: 73 74 61 74 69 63 20 64 61 74 61 2e 20 4e 6f 74 static data. Not
0b90: 20 72 65 65 6e 74 72 61 6e 74 2e 0a 20 20 20 2a reentrant.. *
0ba0: 20 62 2e 20 54 68 65 20 63 61 6c 6c 65 72 20 70 b. The caller p
0bb0: 61 73 73 65 73 20 74 68 65 20 72 65 74 75 72 6e asses the return
0bc0: 20 73 74 72 75 63 74 75 72 65 20 61 64 64 72 65 structure addre
0bd0: 73 73 20 69 6e 20 61 20 64 65 64 69 63 61 74 65 ss in a dedicate
0be0: 64 20 72 65 67 69 73 74 65 72 0a 20 20 20 2a 20 d register. *
0bf0: 20 20 20 6f 72 20 61 73 20 61 20 66 69 72 73 74 or as a first
0c00: 20 28 6f 72 20 6c 61 73 74 29 2c 20 69 6e 76 69 (or last), invi
0c10: 73 69 62 6c 65 20 61 72 67 75 6d 65 6e 74 2e 20 sible argument.
0c20: 54 68 65 20 63 61 6c 6c 65 64 20 66 75 6e 63 74 The called funct
0c30: 69 6f 6e 20 73 74 6f 72 65 73 0a 20 20 20 2a 20 ion stores. *
0c40: 20 20 20 69 74 73 20 72 65 73 75 6c 74 20 74 68 its result th
0c50: 65 72 65 2e 0a 20 20 20 2a 20 63 2e 20 4c 69 6b ere.. * c. Lik
0c60: 65 20 62 2c 20 61 6e 64 20 74 68 65 20 63 61 6c e b, and the cal
0c70: 6c 65 64 20 66 75 6e 63 74 69 6f 6e 20 61 6c 73 led function als
0c80: 6f 20 72 65 74 75 72 6e 73 20 74 68 65 20 72 65 o returns the re
0c90: 74 75 72 6e 20 73 74 72 75 63 74 75 72 65 0a 20 turn structure.
0ca0: 20 20 2a 20 20 20 20 61 64 64 72 65 73 73 20 69 * address i
0cb0: 6e 20 74 68 65 20 72 65 74 75 72 6e 20 76 61 6c n the return val
0cc0: 75 65 20 72 65 67 69 73 74 65 72 2e 20 28 54 68 ue register. (Th
0cd0: 69 73 20 69 73 20 6e 6f 74 20 76 65 72 79 20 64 is is not very d
0ce0: 69 73 74 69 6e 67 75 69 73 68 61 62 6c 65 0a 20 istinguishable.
0cf0: 20 20 2a 20 20 20 20 66 72 6f 6d 20 62 2e 29 0a * from b.).
0d00: 20 20 20 2a 20 49 6e 64 65 70 65 6e 64 65 6e 74 * Independent
0d10: 6c 79 20 6f 66 20 74 68 69 73 2c 0a 20 20 20 2a ly of this,. *
0d20: 20 72 2e 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 r. small struct
0d30: 75 72 65 73 20 28 3c 3d 20 34 20 6f 72 20 3c 3d ures (<= 4 or <=
0d40: 20 38 20 62 79 74 65 73 29 20 6d 61 79 20 62 65 8 bytes) may be
0d50: 20 72 65 74 75 72 6e 65 64 20 69 6e 20 74 68 65 returned in the
0d60: 20 72 65 74 75 72 6e 0a 20 20 20 2a 20 20 20 20 return. *
0d70: 76 61 6c 75 65 20 72 65 67 69 73 74 65 72 28 73 value register(s
0d80: 29 2c 20 6f 72 0a 20 20 20 2a 20 6d 2e 20 65 76 ), or. * m. ev
0d90: 65 6e 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 75 en small structu
0da0: 72 65 73 20 61 72 65 20 70 61 73 73 65 64 20 69 res are passed i
0db0: 6e 20 6d 65 6d 6f 72 79 2e 0a 20 20 20 2a 2f 0a n memory.. */.
0dc0: 20 20 2f 2a 20 67 63 63 2d 32 2e 36 2e 33 20 65 /* gcc-2.6.3 e
0dd0: 6d 70 6c 6f 79 73 20 74 68 65 20 66 6f 6c 6c 6f mploys the follo
0de0: 77 69 6e 67 20 73 74 72 61 74 65 67 79 3a 0a 20 wing strategy:.
0df0: 20 20 2a 20 20 20 2d 20 49 66 20 50 43 43 5f 53 * - If PCC_S
0e00: 54 41 54 49 43 5f 53 54 52 55 43 54 5f 52 45 54 TATIC_STRUCT_RET
0e10: 55 52 4e 20 69 73 20 64 65 66 69 6e 65 64 20 69 URN is defined i
0e20: 6e 20 74 68 65 20 6d 61 63 68 69 6e 65 20 64 65 n the machine de
0e30: 73 63 72 69 70 74 69 6f 6e 0a 20 20 20 2a 20 20 scription. *
0e40: 20 20 20 69 74 20 75 73 65 73 20 6d 65 74 68 6f it uses metho
0e50: 64 20 61 2c 20 65 6c 73 65 20 6d 65 74 68 6f 64 d a, else method
0e60: 20 63 2e 0a 20 20 20 2a 20 20 20 2d 20 49 66 20 c.. * - If
0e70: 66 6c 61 67 5f 70 63 63 5f 73 74 72 75 63 74 5f flag_pcc_struct_
0e80: 72 65 74 75 72 6e 20 69 73 20 73 65 74 20 28 65 return is set (e
0e90: 69 74 68 65 72 20 62 79 20 2d 66 70 63 63 2d 73 ither by -fpcc-s
0ea0: 74 72 75 63 74 2d 72 65 74 75 72 6e 20 6f 72 20 truct-return or
0eb0: 69 66 0a 20 20 20 2a 20 20 20 20 20 44 45 46 41 if. * DEFA
0ec0: 55 4c 54 5f 50 43 43 5f 53 54 52 55 43 54 5f 52 ULT_PCC_STRUCT_R
0ed0: 45 54 55 52 4e 20 69 73 20 64 65 66 69 6e 65 64 ETURN is defined
0ee0: 20 74 6f 20 31 20 69 6e 20 74 68 65 20 6d 61 63 to 1 in the mac
0ef0: 68 69 6e 65 20 64 65 73 63 72 69 70 74 69 6f 6e hine description
0f00: 29 0a 20 20 20 2a 20 20 20 20 20 69 74 20 75 73 ). * it us
0f10: 65 73 20 6d 65 74 68 6f 64 20 6d 2c 20 65 6c 73 es method m, els
0f20: 65 20 28 65 69 74 68 65 72 20 62 79 20 2d 66 72 e (either by -fr
0f30: 65 67 2d 73 74 72 75 63 74 2d 72 65 74 75 72 6e eg-struct-return
0f40: 20 6f 72 20 69 66 0a 20 20 20 2a 20 20 20 20 20 or if. *
0f50: 44 45 46 41 55 4c 54 5f 50 43 43 5f 53 54 52 55 DEFAULT_PCC_STRU
0f60: 43 54 5f 52 45 54 55 52 4e 20 69 73 20 64 65 66 CT_RETURN is def
0f70: 69 6e 65 64 20 74 6f 20 30 20 69 6e 20 74 68 65 ined to 0 in the
0f80: 20 6d 61 63 68 69 6e 65 20 64 65 73 63 72 69 70 machine descrip
0f90: 74 69 6f 6e 29 0a 20 20 20 2a 20 20 20 20 20 6d tion). * m
0fa0: 65 74 68 6f 64 20 72 2e 0a 20 20 20 2a 2f 0a 20 ethod r.. */.
0fb0: 20 5f 5f 56 41 5f 50 43 43 5f 53 54 52 55 43 54 __VA_PCC_STRUCT
0fc0: 5f 52 45 54 55 52 4e 09 3d 20 31 3c 3c 30 2c 09 _RETURN.= 1<<0,.
0fd0: 2f 2a 20 61 3a 20 6e 65 65 64 20 74 6f 20 63 6f /* a: need to co
0fe0: 70 79 20 74 68 65 20 73 74 72 75 63 74 20 2a 2f py the struct */
0ff0: 0a 20 20 5f 5f 56 41 5f 53 4d 41 4c 4c 5f 53 54 . __VA_SMALL_ST
1000: 52 55 43 54 5f 52 45 54 55 52 4e 09 3d 20 31 3c RUCT_RETURN.= 1<
1010: 3c 31 2c 09 2f 2a 20 72 3a 20 73 70 65 63 69 61 <1,./* r: specia
1020: 6c 20 63 61 73 65 20 66 6f 72 20 73 6d 61 6c 6c l case for small
1030: 20 73 74 72 75 63 74 73 20 2a 2f 0a 20 20 5f 5f structs */. __
1040: 56 41 5f 47 43 43 5f 53 54 52 55 43 54 5f 52 45 VA_GCC_STRUCT_RE
1050: 54 55 52 4e 09 3d 20 31 3c 3c 32 2c 09 2f 2a 20 TURN.= 1<<2,./*
1060: 63 6f 6e 73 69 64 65 72 20 38 20 62 79 74 65 20 consider 8 byte
1070: 73 74 72 75 63 74 73 20 61 73 20 73 6d 61 6c 6c structs as small
1080: 20 2a 2f 0a 23 69 66 20 64 65 66 69 6e 65 64 28 */.#if defined(
1090: 5f 5f 73 70 61 72 63 5f 5f 29 20 26 26 20 21 64 __sparc__) && !d
10a0: 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 efined(__sparc64
10b0: 5f 5f 29 0a 20 20 5f 5f 56 41 5f 53 55 4e 43 43 __). __VA_SUNCC
10c0: 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 09 3d _STRUCT_RETURN.=
10d0: 20 31 3c 3c 33 2c 0a 20 20 5f 5f 56 41 5f 53 55 1<<3,. __VA_SU
10e0: 4e 50 52 4f 43 43 5f 53 54 52 55 43 54 5f 52 45 NPROCC_STRUCT_RE
10f0: 54 55 52 4e 09 3d 20 31 3c 3c 34 2c 0a 23 65 6c TURN.= 1<<4,.#el
1100: 73 65 0a 20 20 5f 5f 56 41 5f 53 55 4e 43 43 5f se. __VA_SUNCC_
1110: 53 54 52 55 43 54 5f 52 45 54 55 52 4e 09 3d 20 STRUCT_RETURN.=
1120: 30 2c 0a 20 20 5f 5f 56 41 5f 53 55 4e 50 52 4f 0,. __VA_SUNPRO
1130: 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e CC_STRUCT_RETURN
1140: 09 3d 20 30 2c 0a 23 65 6e 64 69 66 0a 23 69 66 .= 0,.#endif.#if
1150: 20 64 65 66 69 6e 65 64 28 5f 5f 69 33 38 36 5f defined(__i386_
1160: 5f 29 0a 20 20 5f 5f 56 41 5f 4e 45 58 54 47 43 _). __VA_NEXTGC
1170: 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 09 C_STRUCT_RETURN.
1180: 3d 20 31 3c 3c 33 2c 0a 20 20 5f 5f 56 41 5f 4d = 1<<3,. __VA_M
1190: 53 56 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 SVC_STRUCT_RETUR
11a0: 4e 09 3d 20 31 3c 3c 34 2c 0a 23 65 6e 64 69 66 N.= 1<<4,.#endif
11b0: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 68 .#if defined(__h
11c0: 70 70 61 5f 5f 29 0a 20 20 5f 5f 56 41 5f 4f 4c ppa__). __VA_OL
11d0: 44 47 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 DGCC_STRUCT_RETU
11e0: 52 4e 09 3d 20 31 3c 3c 33 2c 0a 23 65 6e 64 69 RN.= 1<<3,.#endi
11f0: 66 0a 20 20 2f 2a 20 74 68 65 20 64 65 66 61 75 f. /* the defau
1200: 6c 74 20 77 61 79 20 74 6f 20 72 65 74 75 72 6e lt way to return
1210: 20 73 74 72 75 63 74 73 20 2a 2f 0a 20 20 2f 2a structs */. /*
1220: 20 54 68 69 73 20 63 68 6f 69 63 65 20 68 65 72 This choice her
1230: 65 20 69 73 20 62 61 73 65 64 20 6f 6e 20 74 68 e is based on th
1240: 65 20 61 73 73 75 6d 70 74 69 6f 6e 20 74 68 61 e assumption tha
1250: 74 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 79 t the function y
1260: 6f 75 20 61 72 65 0a 20 20 20 2a 20 67 6f 69 6e ou are. * goin
1270: 67 20 74 6f 20 63 61 6c 6c 20 68 61 73 20 62 65 g to call has be
1280: 65 6e 20 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 en compiled with
1290: 20 74 68 65 20 73 61 6d 65 20 63 6f 6d 70 69 6c the same compil
12a0: 65 72 20 79 6f 75 20 61 72 65 20 75 73 69 6e 67 er you are using
12b0: 20 74 6f 0a 20 20 20 2a 20 69 6e 63 6c 75 64 65 to. * include
12c0: 20 74 68 69 73 20 66 69 6c 65 2e 0a 20 20 20 2a this file.. *
12d0: 20 49 66 20 79 6f 75 20 77 61 6e 74 20 74 6f 20 If you want to
12e0: 63 61 6c 6c 20 66 75 6e 63 74 69 6f 6e 73 20 77 call functions w
12f0: 69 74 68 20 61 6e 6f 74 68 65 72 20 73 74 72 75 ith another stru
1300: 63 74 20 72 65 74 75 72 6e 69 6e 67 20 63 6f 6e ct returning con
1310: 76 65 6e 74 69 6f 6e 2c 0a 20 20 20 2a 20 6a 75 vention,. * ju
1320: 73 74 20 20 23 64 65 66 69 6e 65 20 5f 5f 56 41 st #define __VA
1330: 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 20 2e _STRUCT_RETURN .
1340: 2e 2e 0a 20 20 20 2a 20 62 65 66 6f 72 65 20 6f ... * before o
1350: 72 20 61 66 74 65 72 20 23 69 6e 63 6c 75 64 69 r after #includi
1360: 6e 67 20 3c 76 61 63 61 6c 6c 2e 68 3e 2e 0a 20 ng <vacall.h>..
1370: 20 20 2a 2f 0a 23 69 66 6e 64 65 66 20 5f 5f 56 */.#ifndef __V
1380: 41 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 0a A_STRUCT_RETURN.
1390: 20 20 5f 5f 56 41 5f 53 54 52 55 43 54 5f 52 45 __VA_STRUCT_RE
13a0: 54 55 52 4e 09 09 3d 0a 23 69 66 20 64 65 66 69 TURN..=.#if defi
13b0: 6e 65 64 28 5f 5f 73 70 61 72 63 5f 5f 29 20 26 ned(__sparc__) &
13c0: 26 20 21 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 & !defined(__spa
13d0: 72 63 36 34 5f 5f 29 20 26 26 20 64 65 66 69 6e rc64__) && defin
13e0: 65 64 28 73 75 6e 29 20 26 26 20 64 65 66 69 6e ed(sun) && defin
13f0: 65 64 28 5f 5f 53 55 4e 50 52 4f 5f 43 29 20 2f ed(__SUNPRO_C) /
1400: 2a 20 53 55 4e 57 73 70 72 6f 20 63 63 20 2a 2f * SUNWspro cc */
1410: 0a 09 09 09 09 20 20 5f 5f 56 41 5f 53 55 4e 50 ..... __VA_SUNP
1420: 52 4f 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 ROCC_STRUCT_RETU
1430: 52 4e 2c 0a 23 65 6c 73 65 0a 23 69 66 20 64 65 RN,.#else.#if de
1440: 66 69 6e 65 64 28 5f 5f 50 43 43 5f 53 54 52 55 fined(__PCC_STRU
1450: 43 54 5f 52 45 54 55 52 4e 5f 5f 29 20 2f 2a 20 CT_RETURN__) /*
1460: 64 65 66 69 6e 65 64 20 74 68 72 6f 75 67 68 20 defined through
1470: 63 6f 6e 66 69 67 75 72 65 2c 20 73 65 65 20 61 configure, see a
1480: 62 6f 76 65 20 2a 2f 0a 09 09 09 09 20 20 5f 5f bove */..... __
1490: 56 41 5f 50 43 43 5f 53 54 52 55 43 54 5f 52 45 VA_PCC_STRUCT_RE
14a0: 54 55 52 4e 2c 0a 23 65 6c 73 65 0a 23 69 66 20 TURN,.#else.#if
14b0: 64 65 66 69 6e 65 64 28 5f 5f 53 4d 41 4c 4c 5f defined(__SMALL_
14c0: 53 54 52 55 43 54 5f 52 45 54 55 52 4e 5f 5f 29 STRUCT_RETURN__)
14d0: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 || defined(__mi
14e0: 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 66 69 psn32__) || defi
14f0: 6e 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 20 ned(__mips64__)
1500: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 41 52 4d || defined(__ARM
1510: 45 4c 5f 5f 29 2f 2a 20 64 65 66 69 6e 65 64 20 EL__)/* defined
1520: 74 68 72 6f 75 67 68 20 63 6f 6e 66 69 67 75 72 through configur
1530: 65 2c 20 73 65 65 20 61 62 6f 76 65 20 2a 2f 0a e, see above */.
1540: 09 09 09 09 20 20 5f 5f 56 41 5f 53 4d 41 4c 4c .... __VA_SMALL
1550: 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 20 7c _STRUCT_RETURN |
1560: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
1570: 6e 65 64 28 5f 5f 47 4e 55 43 5f 5f 29 0a 09 09 ned(__GNUC__)...
1580: 09 09 20 20 5f 5f 56 41 5f 47 43 43 5f 53 54 52 .. __VA_GCC_STR
1590: 55 43 54 5f 52 45 54 55 52 4e 20 7c 0a 23 65 6e UCT_RETURN |.#en
15a0: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
15b0: 5f 5f 69 33 38 36 5f 5f 29 20 26 26 20 64 65 66 __i386__) && def
15c0: 69 6e 65 64 28 4e 65 58 54 29 20 26 26 20 64 65 ined(NeXT) && de
15d0: 66 69 6e 65 64 28 5f 5f 47 4e 55 43 5f 5f 29 20 fined(__GNUC__)
15e0: 2f 2a 20 4e 65 58 54 20 67 63 63 2d 32 2e 35 2e /* NeXT gcc-2.5.
15f0: 38 20 2a 2f 0a 09 09 09 09 20 20 5f 5f 56 41 5f 8 */..... __VA_
1600: 4e 45 58 54 47 43 43 5f 53 54 52 55 43 54 5f 52 NEXTGCC_STRUCT_R
1610: 45 54 55 52 4e 20 7c 0a 23 65 6e 64 69 66 0a 23 ETURN |.#endif.#
1620: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 69 33 38 if defined(__i38
1630: 36 5f 5f 29 20 26 26 20 64 65 66 69 6e 65 64 28 6__) && defined(
1640: 5f 4d 53 43 5f 56 45 52 29 20 2f 2a 20 4d 53 56 _MSC_VER) /* MSV
1650: 43 20 34 2e 30 20 2a 2f 0a 09 09 09 09 20 20 5f C 4.0 */..... _
1660: 5f 56 41 5f 4d 53 56 43 5f 53 54 52 55 43 54 5f _VA_MSVC_STRUCT_
1670: 52 45 54 55 52 4e 20 7c 0a 23 65 6e 64 69 66 0a RETURN |.#endif.
1680: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 68 70 #if defined(__hp
1690: 70 61 5f 5f 29 20 26 26 20 64 65 66 69 6e 65 64 pa__) && defined
16a0: 28 5f 5f 47 4e 55 43 5f 5f 29 20 26 26 20 28 5f (__GNUC__) && (_
16b0: 5f 47 4e 55 43 5f 5f 20 3c 20 33 29 20 26 26 20 _GNUC__ < 3) &&
16c0: 28 5f 5f 47 4e 55 43 5f 4d 49 4e 4f 52 5f 5f 20 (__GNUC_MINOR__
16d0: 3c 20 37 29 0a 09 09 09 09 20 20 5f 5f 56 41 5f < 7)..... __VA_
16e0: 4f 4c 44 47 43 43 5f 53 54 52 55 43 54 5f 52 45 OLDGCC_STRUCT_RE
16f0: 54 55 52 4e 20 7c 0a 23 65 6e 64 69 66 0a 20 20 TURN |.#endif.
1700: 09 09 09 09 20 20 30 2c 0a 23 65 6e 64 69 66 0a .... 0,.#endif.
1710: 23 65 6e 64 69 66 0a 23 65 6e 64 69 66 0a 0a 20 #endif.#endif..
1720: 20 2f 2a 20 68 6f 77 20 74 6f 20 72 65 74 75 72 /* how to retur
1730: 6e 20 66 6c 6f 61 74 73 20 2a 2f 0a 23 69 66 20 n floats */.#if
1740: 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f defined(__m68k__
1750: 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f ) || (defined(__
1760: 73 70 61 72 63 5f 5f 29 20 26 26 20 21 64 65 66 sparc__) && !def
1770: 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f ined(__sparc64__
1780: 29 29 0a 20 20 5f 5f 56 41 5f 53 55 4e 43 43 5f )). __VA_SUNCC_
1790: 46 4c 4f 41 54 5f 52 45 54 55 52 4e 09 3d 20 31 FLOAT_RETURN.= 1
17a0: 3c 3c 35 2c 0a 23 65 6e 64 69 66 0a 23 69 66 20 <<5,.#endif.#if
17b0: 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f defined(__m68k__
17c0: 29 0a 20 20 5f 5f 56 41 5f 46 52 45 47 5f 46 4c ). __VA_FREG_FL
17d0: 4f 41 54 5f 52 45 54 55 52 4e 09 3d 20 31 3c 3c OAT_RETURN.= 1<<
17e0: 36 2c 0a 23 65 6e 64 69 66 0a 20 20 2f 2a 20 74 6,.#endif. /* t
17f0: 68 65 20 64 65 66 61 75 6c 74 20 77 61 79 20 74 he default way t
1800: 6f 20 72 65 74 75 72 6e 20 66 6c 6f 61 74 73 20 o return floats
1810: 2a 2f 0a 20 20 2f 2a 20 54 68 69 73 20 63 68 6f */. /* This cho
1820: 69 63 65 20 68 65 72 65 20 69 73 20 62 61 73 65 ice here is base
1830: 64 20 6f 6e 20 74 68 65 20 61 73 73 75 6d 70 74 d on the assumpt
1840: 69 6f 6e 20 74 68 61 74 20 74 68 65 20 66 75 6e ion that the fun
1850: 63 74 69 6f 6e 20 79 6f 75 20 61 72 65 0a 20 20 ction you are.
1860: 20 2a 20 67 6f 69 6e 67 20 74 6f 20 63 61 6c 6c * going to call
1870: 20 68 61 73 20 62 65 65 6e 20 63 6f 6d 70 69 6c has been compil
1880: 65 64 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 ed with the same
1890: 20 63 6f 6d 70 69 6c 65 72 20 79 6f 75 20 61 72 compiler you ar
18a0: 65 20 75 73 69 6e 67 20 74 6f 0a 20 20 20 2a 20 e using to. *
18b0: 69 6e 63 6c 75 64 65 20 74 68 69 73 20 66 69 6c include this fil
18c0: 65 2e 0a 20 20 20 2a 20 49 66 20 79 6f 75 20 77 e.. * If you w
18d0: 61 6e 74 20 74 6f 20 63 61 6c 6c 20 66 75 6e 63 ant to call func
18e0: 74 69 6f 6e 73 20 77 69 74 68 20 61 6e 6f 74 68 tions with anoth
18f0: 65 72 20 66 6c 6f 61 74 20 72 65 74 75 72 6e 69 er float returni
1900: 6e 67 20 63 6f 6e 76 65 6e 74 69 6f 6e 2c 0a 20 ng convention,.
1910: 20 20 2a 20 6a 75 73 74 20 20 23 64 65 66 69 6e * just #defin
1920: 65 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 52 45 54 e __VA_FLOAT_RET
1930: 55 52 4e 20 2e 2e 2e 0a 20 20 20 2a 20 62 65 66 URN .... * bef
1940: 6f 72 65 20 6f 72 20 61 66 74 65 72 20 23 69 6e ore or after #in
1950: 63 6c 75 64 69 6e 67 20 3c 76 61 63 61 6c 6c 2e cluding <vacall.
1960: 68 3e 2e 0a 20 20 20 2a 2f 0a 23 69 66 6e 64 65 h>.. */.#ifnde
1970: 66 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 52 45 54 f __VA_FLOAT_RET
1980: 55 52 4e 0a 23 69 66 20 28 64 65 66 69 6e 65 64 URN.#if (defined
1990: 28 5f 5f 6d 36 38 6b 5f 5f 29 20 7c 7c 20 28 64 (__m68k__) || (d
19a0: 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 5f 5f efined(__sparc__
19b0: 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f 5f ) && !defined(__
19c0: 73 70 61 72 63 36 34 5f 5f 29 29 29 20 26 26 20 sparc64__))) &&
19d0: 21 64 65 66 69 6e 65 64 28 5f 5f 47 4e 55 43 5f !defined(__GNUC_
19e0: 5f 29 20 26 26 20 64 65 66 69 6e 65 64 28 73 75 _) && defined(su
19f0: 6e 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f n) && !defined(_
1a00: 5f 53 55 4e 50 52 4f 5f 43 29 20 20 2f 2a 20 73 _SUNPRO_C) /* s
1a10: 75 6e 20 63 63 20 2a 2f 0a 20 20 5f 5f 56 41 5f un cc */. __VA_
1a20: 46 4c 4f 41 54 5f 52 45 54 55 52 4e 09 09 3d 20 FLOAT_RETURN..=
1a30: 5f 5f 56 41 5f 53 55 4e 43 43 5f 46 4c 4f 41 54 __VA_SUNCC_FLOAT
1a40: 5f 52 45 54 55 52 4e 2c 0a 23 65 6c 69 66 20 28 _RETURN,.#elif (
1a50: 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f defined(__m68k__
1a60: 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f 5f ) && !defined(__
1a70: 49 52 45 47 5f 46 4c 4f 41 54 5f 52 45 54 55 52 IREG_FLOAT_RETUR
1a80: 4e 5f 5f 29 29 0a 20 20 5f 5f 56 41 5f 46 4c 4f N__)). __VA_FLO
1a90: 41 54 5f 52 45 54 55 52 4e 09 09 3d 20 5f 5f 56 AT_RETURN..= __V
1aa0: 41 5f 46 52 45 47 5f 46 4c 4f 41 54 5f 52 45 54 A_FREG_FLOAT_RET
1ab0: 55 52 4e 2c 0a 23 65 6c 73 65 0a 20 20 5f 5f 56 URN,.#else. __V
1ac0: 41 5f 46 4c 4f 41 54 5f 52 45 54 55 52 4e 09 09 A_FLOAT_RETURN..
1ad0: 3d 20 30 2c 0a 23 65 6e 64 69 66 0a 23 65 6e 64 = 0,.#endif.#end
1ae0: 69 66 0a 0a 20 20 2f 2a 20 68 6f 77 20 74 6f 20 if.. /* how to
1af0: 70 61 73 73 20 73 74 72 75 63 74 73 20 2a 2f 0a pass structs */.
1b00: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 #if defined(__mi
1b10: 70 73 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 ps__) || defined
1b20: 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c (__mipsn32__) ||
1b30: 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 defined(__mips6
1b40: 34 5f 5f 29 0a 20 20 5f 5f 56 41 5f 53 47 49 43 4__). __VA_SGIC
1b50: 43 5f 53 54 52 55 43 54 5f 41 52 47 53 09 3d 20 C_STRUCT_ARGS.=
1b60: 31 3c 3c 37 2c 0a 23 65 6e 64 69 66 0a 23 69 66 1<<7,.#endif.#if
1b70: 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 defined(__power
1b80: 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 pc__) && !define
1b90: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
1ba0: 0a 20 20 5f 5f 56 41 5f 41 49 58 43 43 5f 53 54 . __VA_AIXCC_ST
1bb0: 52 55 43 54 5f 41 52 47 53 09 3d 20 31 3c 3c 37 RUCT_ARGS.= 1<<7
1bc0: 2c 0a 23 65 6e 64 69 66 0a 20 20 2f 2a 20 74 68 ,.#endif. /* th
1bd0: 65 20 64 65 66 61 75 6c 74 20 77 61 79 20 74 6f e default way to
1be0: 20 70 61 73 73 20 66 6c 6f 61 74 73 20 2a 2f 0a pass floats */.
1bf0: 20 20 2f 2a 20 54 68 69 73 20 63 68 6f 69 63 65 /* This choice
1c00: 20 68 65 72 65 20 69 73 20 62 61 73 65 64 20 6f here is based o
1c10: 6e 20 74 68 65 20 61 73 73 75 6d 70 74 69 6f 6e n the assumption
1c20: 20 74 68 61 74 20 74 68 65 20 66 75 6e 63 74 69 that the functi
1c30: 6f 6e 20 79 6f 75 20 61 72 65 0a 20 20 20 2a 20 on you are. *
1c40: 67 6f 69 6e 67 20 74 6f 20 63 61 6c 6c 20 68 61 going to call ha
1c50: 73 20 62 65 65 6e 20 63 6f 6d 70 69 6c 65 64 20 s been compiled
1c60: 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 63 6f with the same co
1c70: 6d 70 69 6c 65 72 20 79 6f 75 20 61 72 65 20 75 mpiler you are u
1c80: 73 69 6e 67 20 74 6f 0a 20 20 20 2a 20 69 6e 63 sing to. * inc
1c90: 6c 75 64 65 20 74 68 69 73 20 66 69 6c 65 2e 0a lude this file..
1ca0: 20 20 20 2a 20 49 66 20 79 6f 75 20 77 61 6e 74 * If you want
1cb0: 20 74 6f 20 63 61 6c 6c 20 66 75 6e 63 74 69 6f to call functio
1cc0: 6e 73 20 77 69 74 68 20 61 6e 6f 74 68 65 72 20 ns with another
1cd0: 66 6c 6f 61 74 20 70 61 73 73 69 6e 67 20 63 6f float passing co
1ce0: 6e 76 65 6e 74 69 6f 6e 2c 0a 20 20 20 2a 20 6a nvention,. * j
1cf0: 75 73 74 20 20 23 64 65 66 69 6e 65 20 5f 5f 56 ust #define __V
1d00: 41 5f 53 54 52 55 43 54 5f 41 52 47 53 20 2e 2e A_STRUCT_ARGS ..
1d10: 2e 0a 20 20 20 2a 20 62 65 66 6f 72 65 20 6f 72 .. * before or
1d20: 20 61 66 74 65 72 20 23 69 6e 63 6c 75 64 69 6e after #includin
1d30: 67 20 3c 76 61 63 61 6c 6c 2e 68 3e 2e 0a 20 20 g <vacall.h>..
1d40: 20 2a 2f 0a 23 69 66 6e 64 65 66 20 5f 5f 56 41 */.#ifndef __VA
1d50: 5f 53 54 52 55 43 54 5f 41 52 47 53 0a 23 69 66 _STRUCT_ARGS.#if
1d60: 20 28 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 (defined(__mips
1d70: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
1d80: 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 _mipsn32__) || d
1d90: 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 5f efined(__mips64_
1da0: 5f 29 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 _)) && !defined(
1db0: 5f 5f 47 4e 55 43 5f 5f 29 20 2f 2a 20 53 47 49 __GNUC__) /* SGI
1dc0: 20 6d 69 70 73 20 63 63 20 2a 2f 0a 20 20 5f 5f mips cc */. __
1dd0: 56 41 5f 53 54 52 55 43 54 5f 41 52 47 53 09 09 VA_STRUCT_ARGS..
1de0: 3d 20 5f 5f 56 41 5f 53 47 49 43 43 5f 53 54 52 = __VA_SGICC_STR
1df0: 55 43 54 5f 41 52 47 53 2c 0a 23 65 6c 73 65 0a UCT_ARGS,.#else.
1e00: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f #if defined(__po
1e10: 77 65 72 70 63 5f 5f 29 20 26 26 20 21 64 65 66 werpc__) && !def
1e20: 69 6e 65 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 ined(__powerpc64
1e30: 5f 5f 29 20 26 26 20 64 65 66 69 6e 65 64 28 5f __) && defined(_
1e40: 41 49 58 29 20 26 26 20 21 64 65 66 69 6e 65 64 AIX) && !defined
1e50: 28 5f 5f 47 4e 55 43 5f 5f 29 20 2f 2a 20 41 49 (__GNUC__) /* AI
1e60: 58 20 63 63 2c 20 78 6c 63 20 2a 2f 0a 20 20 5f X cc, xlc */. _
1e70: 5f 56 41 5f 53 54 52 55 43 54 5f 41 52 47 53 09 _VA_STRUCT_ARGS.
1e80: 09 3d 20 5f 5f 56 41 5f 41 49 58 43 43 5f 53 54 .= __VA_AIXCC_ST
1e90: 52 55 43 54 5f 41 52 47 53 2c 0a 23 65 6c 73 65 RUCT_ARGS,.#else
1ea0: 0a 20 20 5f 5f 56 41 5f 53 54 52 55 43 54 5f 41 . __VA_STRUCT_A
1eb0: 52 47 53 09 09 3d 20 30 2c 0a 23 65 6e 64 69 66 RGS..= 0,.#endif
1ec0: 0a 23 65 6e 64 69 66 0a 23 65 6e 64 69 66 0a 0a .#endif.#endif..
1ed0: 20 20 2f 2a 20 68 6f 77 20 74 6f 20 70 61 73 73 /* how to pass
1ee0: 20 66 6c 6f 61 74 73 20 2a 2f 0a 20 20 2f 2a 20 floats */. /*
1ef0: 41 4e 53 49 20 43 20 63 6f 6d 70 69 6c 65 72 73 ANSI C compilers
1f00: 20 61 6e 64 20 47 4e 55 20 67 63 63 20 70 61 73 and GNU gcc pas
1f10: 73 20 66 6c 6f 61 74 73 20 61 73 20 66 6c 6f 61 s floats as floa
1f20: 74 73 2e 0a 20 20 20 2a 20 4b 26 52 20 43 20 63 ts.. * K&R C c
1f30: 6f 6d 70 69 6c 65 72 73 20 70 61 73 73 20 66 6c ompilers pass fl
1f40: 6f 61 74 73 20 61 73 20 64 6f 75 62 6c 65 73 2e oats as doubles.
1f50: 20 57 65 20 64 6f 6e 27 74 20 73 75 70 70 6f 72 We don't suppor
1f60: 74 20 74 68 65 6d 20 61 6e 79 20 6d 6f 72 65 2e t them any more.
1f70: 0a 20 20 20 2a 2f 0a 20 20 5f 5f 56 41 5f 41 4e . */. __VA_AN
1f80: 53 49 5f 46 4c 4f 41 54 5f 41 52 47 53 09 09 3d SI_FLOAT_ARGS..=
1f90: 20 30 2c 20 20 20 20 2f 2a 20 70 61 73 73 20 66 0, /* pass f
1fa0: 6c 6f 61 74 73 20 61 73 20 66 6c 6f 61 74 73 20 loats as floats
1fb0: 2a 2f 0a 0a 20 20 2f 2a 20 68 6f 77 20 74 6f 20 */.. /* how to
1fc0: 70 61 73 73 20 61 6e 64 20 72 65 74 75 72 6e 20 pass and return
1fd0: 73 6d 61 6c 6c 20 69 6e 74 65 67 65 72 20 61 72 small integer ar
1fe0: 67 75 6d 65 6e 74 73 20 2a 2f 0a 20 20 5f 5f 56 guments */. __V
1ff0: 41 5f 41 4e 53 49 5f 49 4e 54 45 47 45 52 53 09 A_ANSI_INTEGERS.
2000: 09 3d 20 30 2c 20 2f 2a 20 6e 6f 20 70 72 6f 6d .= 0, /* no prom
2010: 6f 74 69 6f 6e 73 20 2a 2f 0a 20 20 5f 5f 56 41 otions */. __VA
2020: 5f 54 52 41 44 49 54 49 4f 4e 41 4c 5f 49 4e 54 _TRADITIONAL_INT
2030: 45 47 45 52 53 09 3d 20 30 2c 20 2f 2a 20 70 72 EGERS.= 0, /* pr
2040: 6f 6d 6f 74 65 20 5b 75 5d 63 68 61 72 2c 20 5b omote [u]char, [
2050: 75 5d 73 68 6f 72 74 20 74 6f 20 5b 75 5d 69 6e u]short to [u]in
2060: 74 20 2a 2f 0a 20 20 2f 2a 20 46 6f 72 74 75 6e t */. /* Fortun
2070: 61 74 65 6c 79 20 74 68 65 73 65 20 74 77 6f 20 ately these two
2080: 6d 65 74 68 6f 64 73 20 61 72 65 20 63 6f 6d 70 methods are comp
2090: 61 74 69 62 6c 65 2e 20 4f 75 72 20 6d 61 63 72 atible. Our macr
20a0: 6f 73 20 77 6f 72 6b 20 77 69 74 68 20 62 6f 74 os work with bot
20b0: 68 2e 20 2a 2f 0a 0a 20 20 2f 2a 20 73 74 61 63 h. */.. /* stac
20c0: 6b 20 63 6c 65 61 6e 75 70 20 70 6f 6c 69 63 79 k cleanup policy
20d0: 20 2a 2f 0a 20 20 5f 5f 56 41 5f 43 44 45 43 4c */. __VA_CDECL
20e0: 5f 43 4c 45 41 4e 55 50 09 09 3d 20 30 2c 20 2f _CLEANUP..= 0, /
20f0: 2a 20 63 61 6c 6c 65 72 20 70 6f 70 73 20 61 72 * caller pops ar
2100: 67 73 20 61 66 74 65 72 20 72 65 74 75 72 6e 20 gs after return
2110: 2a 2f 0a 20 20 5f 5f 56 41 5f 53 54 44 43 41 4c */. __VA_STDCAL
2120: 4c 5f 43 4c 45 41 4e 55 50 09 09 3d 20 31 3c 3c L_CLEANUP..= 1<<
2130: 39 2c 20 2f 2a 20 63 61 6c 6c 65 65 20 70 6f 70 9, /* callee pop
2140: 73 20 61 72 67 73 20 62 65 66 6f 72 65 20 72 65 s args before re
2150: 74 75 72 6e 20 2a 2f 0a 09 09 09 09 20 20 20 20 turn */.....
2160: 20 2f 2a 20 63 75 72 72 65 6e 74 6c 79 20 6f 6e /* currently on
2170: 6c 79 20 73 75 70 70 6f 72 74 65 64 20 6f 6e 20 ly supported on
2180: 5f 5f 69 33 38 36 5f 5f 20 2a 2f 0a 23 69 66 6e __i386__ */.#ifn
2190: 64 65 66 20 5f 5f 56 41 5f 43 4c 45 41 4e 55 50 def __VA_CLEANUP
21a0: 0a 20 20 5f 5f 56 41 5f 43 4c 45 41 4e 55 50 09 . __VA_CLEANUP.
21b0: 09 09 3d 20 5f 5f 56 41 5f 43 44 45 43 4c 5f 43 ..= __VA_CDECL_C
21c0: 4c 45 41 4e 55 50 2c 0a 23 65 6e 64 69 66 0a 0a LEANUP,.#endif..
21d0: 20 20 2f 2a 20 54 68 65 73 65 20 61 72 65 20 66 /* These are f
21e0: 6f 72 20 69 6e 74 65 72 6e 61 6c 20 75 73 65 20 or internal use
21f0: 6f 6e 6c 79 20 2a 2f 0a 23 69 66 20 64 65 66 69 only */.#if defi
2200: 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 7c 7c ned(__i386__) ||
2210: 20 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f defined(__m68k_
2220: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
2230: 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 mipsn32__) || de
2240: 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f fined(__mips64__
2250: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 73 ) || defined(__s
2260: 70 61 72 63 36 34 5f 5f 29 20 7c 7c 20 64 65 66 parc64__) || def
2270: 69 6e 65 64 28 5f 5f 61 6c 70 68 61 5f 5f 29 20 ined(__alpha__)
2280: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 61 72 6d || defined(__arm
2290: 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 __) || (defined(
22a0: 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 26 26 20 __powerpc__) &&
22b0: 21 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 !defined(__power
22c0: 70 63 36 34 5f 5f 29 29 20 7c 7c 20 64 65 66 69 pc64__)) || defi
22d0: 6e 65 64 28 5f 5f 63 6f 6e 76 65 78 5f 5f 29 20 ned(__convex__)
22e0: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 69 61 36 || defined(__ia6
22f0: 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 4__) || defined(
2300: 5f 5f 78 38 36 5f 36 34 5f 5f 29 20 7c 7c 20 64 __x86_64__) || d
2310: 65 66 69 6e 65 64 28 5f 5f 73 33 39 30 5f 5f 29 efined(__s390__)
2320: 0a 20 20 5f 5f 56 41 5f 52 45 47 49 53 54 45 52 . __VA_REGISTER
2330: 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 09 3d _STRUCT_RETURN.=
2340: 20 31 3c 3c 31 30 2c 0a 23 65 6e 64 69 66 0a 23 1<<10,.#endif.#
2350: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 if defined(__mip
2360: 73 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 s__) && !defined
2370: 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 26 26 (__mipsn32__) &&
2380: 20 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 !defined(__mips
2390: 36 34 5f 5f 29 0a 20 20 5f 5f 56 41 5f 46 4c 4f 64__). __VA_FLO
23a0: 41 54 5f 31 09 09 09 3d 20 31 3c 3c 31 31 2c 0a AT_1...= 1<<11,.
23b0: 20 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 32 09 09 __VA_FLOAT_2..
23c0: 09 3d 20 31 3c 3c 31 32 2c 0a 23 65 6e 64 69 66 .= 1<<12,.#endif
23d0: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d .#if defined(__m
23e0: 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 66 ipsn32__) || def
23f0: 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 ined(__mips64__)
2400: 0a 20 20 5f 5f 56 41 5f 52 45 47 49 53 54 45 52 . __VA_REGISTER
2410: 5f 46 4c 4f 41 54 53 54 52 55 43 54 5f 52 45 54 _FLOATSTRUCT_RET
2420: 55 52 4e 09 3d 20 31 3c 3c 31 33 2c 0a 20 20 5f URN.= 1<<13,. _
2430: 5f 56 41 5f 52 45 47 49 53 54 45 52 5f 44 4f 55 _VA_REGISTER_DOU
2440: 42 4c 45 53 54 52 55 43 54 5f 52 45 54 55 52 4e BLESTRUCT_RETURN
2450: 09 3d 20 31 3c 3c 31 34 2c 0a 23 65 6e 64 69 66 .= 1<<14,.#endif
2460: 0a 0a 20 20 5f 5f 56 41 5f 66 6c 61 67 5f 66 6f .. __VA_flag_fo
2470: 72 5f 62 72 6f 6b 65 6e 5f 63 6f 6d 70 69 6c 65 r_broken_compile
2480: 72 73 5f 74 68 61 74 5f 64 6f 6e 74 5f 6c 69 6b rs_that_dont_lik
2490: 65 5f 74 72 61 69 6c 69 6e 67 5f 63 6f 6d 6d 61 e_trailing_comma
24a0: 73 0a 7d 3b 0a 0a 2f 2a 0a 20 2a 20 44 65 66 69 s.};../*. * Defi
24b0: 6e 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 60 76 nition of the `v
24c0: 61 5f 61 6c 69 73 74 27 20 74 79 70 65 2e 0a 20 a_alist' type..
24d0: 2a 2f 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 */.typedef struc
24e0: 74 0a 7b 0a 20 20 2f 2a 20 73 6f 6d 65 20 76 61 t.{. /* some va
24f0: 5f 2e 2e 2e 20 6d 61 63 72 6f 73 20 6e 65 65 64 _... macros need
2500: 20 74 68 65 73 65 20 66 6c 61 67 73 20 2a 2f 0a these flags */.
2510: 20 20 69 6e 74 20 20 20 20 20 20 20 20 20 20 20 int
2520: 20 66 6c 61 67 73 3b 0a 20 20 2f 2a 20 63 75 72 flags;. /* cur
2530: 72 65 6e 74 20 70 6f 69 6e 74 65 72 20 69 6e 74 rent pointer int
2540: 6f 20 74 68 65 20 61 72 67 75 6d 65 6e 74 20 61 o the argument a
2550: 72 72 61 79 20 2a 2f 0a 20 20 75 6e 73 69 67 6e rray */. unsign
2560: 65 64 20 6c 6f 6e 67 20 20 61 70 74 72 3b 0a 20 ed long aptr;.
2570: 20 2f 2a 20 73 74 72 75 63 74 75 72 65 20 72 65 /* structure re
2580: 74 75 72 6e 20 70 6f 69 6e 74 65 72 2c 20 72 65 turn pointer, re
2590: 74 75 72 6e 20 74 79 70 65 2c 20 72 65 74 75 72 turn type, retur
25a0: 6e 20 74 79 70 65 20 73 69 7a 65 20 2a 2f 0a 20 n type size */.
25b0: 20 76 6f 69 64 2a 20 20 20 20 20 20 20 20 20 20 void*
25c0: 72 61 64 64 72 3b 0a 20 20 65 6e 75 6d 20 5f 5f raddr;. enum __
25d0: 56 41 74 79 70 65 20 20 72 74 79 70 65 3b 0a 20 VAtype rtype;.
25e0: 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 20 unsigned long
25f0: 72 73 69 7a 65 3b 0a 23 69 66 20 64 65 66 69 6e rsize;.#if defin
2600: 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 7c 7c 20 ed(__i386__) ||
2610: 28 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 (defined(__power
2620: 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 pc__) && !define
2630: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
2640: 20 26 26 20 64 65 66 69 6e 65 64 28 5f 5f 4d 41 && defined(__MA
2650: 43 48 5f 5f 29 20 26 26 20 64 65 66 69 6e 65 64 CH__) && defined
2660: 28 5f 5f 41 50 50 4c 45 5f 5f 29 29 0a 20 20 2f (__APPLE__)). /
2670: 2a 20 46 69 6c 6c 65 72 20 77 6f 72 64 2c 20 6e * Filler word, n
2680: 65 65 64 65 64 20 69 66 20 74 68 65 20 6e 75 6d eeded if the num
2690: 62 65 72 73 20 6f 66 20 77 6f 72 64 73 20 75 70 bers of words up
26a0: 20 74 6f 20 6e 6f 77 20 69 6e 20 74 68 69 73 20 to now in this
26b0: 73 74 72 75 63 74 75 72 65 20 2a 2f 0a 20 20 2f structure */. /
26c0: 2a 20 69 73 20 6f 64 64 20 28 62 65 63 61 75 73 * is odd (becaus
26d0: 65 20 6f 6e 20 4d 53 56 43 2c 20 61 6c 69 67 6e e on MSVC, align
26e0: 6f 66 28 64 6f 75 62 6c 65 29 20 3d 20 38 2c 20 of(double) = 8,
26f0: 6e 6f 72 6d 61 6c 6c 79 20 3d 20 34 3b 20 73 69 normally = 4; si
2700: 6d 69 6c 61 72 6c 79 2c 20 20 2a 2f 0a 20 20 2f milarly, */. /
2710: 2a 20 6f 6e 20 4d 61 63 4f 53 20 58 2c 20 74 68 * on MacOS X, th
2720: 65 20 41 70 70 6c 65 20 63 6f 6d 70 69 6c 65 72 e Apple compiler
2730: 20 68 61 73 20 61 6c 69 67 6e 6f 66 28 64 6f 75 has alignof(dou
2740: 62 6c 65 29 20 3d 20 38 20 77 68 65 72 65 61 73 ble) = 8 whereas
2750: 20 74 68 65 20 20 20 20 20 20 2a 2f 0a 20 20 2f the */. /
2760: 2a 20 73 74 61 6e 64 61 72 64 20 47 43 43 20 68 * standard GCC h
2770: 61 73 20 61 6c 69 67 6e 6f 66 28 64 6f 75 62 6c as alignof(doubl
2780: 65 29 20 3d 20 34 2e 20 20 20 20 20 20 20 20 20 e) = 4.
2790: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
27a0: 20 20 20 20 20 20 20 20 20 20 2a 2f 0a 20 20 5f */. _
27b0: 5f 76 61 77 6f 72 64 20 20 20 20 20 20 20 66 69 _vaword fi
27c0: 6c 6c 65 72 31 3b 0a 23 65 6e 64 69 66 0a 20 20 ller1;.#endif.
27d0: 2f 2a 20 74 65 6d 70 6f 72 61 72 79 20 73 74 6f /* temporary sto
27e0: 72 61 67 65 20 66 6f 72 20 72 65 74 75 72 6e 20 rage for return
27f0: 76 61 6c 75 65 20 2a 2f 0a 20 20 75 6e 69 6f 6e value */. union
2800: 20 7b 0a 20 20 20 20 63 68 61 72 20 20 20 20 20 {. char
2810: 20 20 20 20 20 20 20 20 20 20 20 5f 63 68 61 72 _char
2820: 3b 0a 20 20 20 20 73 69 67 6e 65 64 20 63 68 61 ;. signed cha
2830: 72 20 20 20 20 20 20 20 20 20 5f 73 63 68 61 72 r _schar
2840: 3b 0a 20 20 20 20 75 6e 73 69 67 6e 65 64 20 63 ;. unsigned c
2850: 68 61 72 20 20 20 20 20 20 20 5f 75 63 68 61 72 har _uchar
2860: 3b 0a 20 20 20 20 73 68 6f 72 74 20 20 20 20 20 ;. short
2870: 20 20 20 20 20 20 20 20 20 20 5f 73 68 6f 72 74 _short
2880: 3b 0a 20 20 20 20 75 6e 73 69 67 6e 65 64 20 73 ;. unsigned s
2890: 68 6f 72 74 20 20 20 20 20 20 5f 75 73 68 6f 72 hort _ushor
28a0: 74 3b 0a 20 20 20 20 69 6e 74 20 20 20 20 20 20 t;. int
28b0: 20 20 20 20 20 20 20 20 20 20 20 5f 69 6e 74 3b _int;
28c0: 0a 20 20 20 20 75 6e 73 69 67 6e 65 64 20 69 6e . unsigned in
28d0: 74 20 20 20 20 20 20 20 20 5f 75 69 6e 74 3b 0a t _uint;.
28e0: 20 20 20 20 6c 6f 6e 67 20 20 20 20 20 20 20 20 long
28f0: 20 20 20 20 20 20 20 20 5f 6c 6f 6e 67 3b 0a 20 _long;.
2900: 20 20 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 unsigned long
2910: 20 20 20 20 20 20 20 5f 75 6c 6f 6e 67 3b 0a 23 _ulong;.#
2920: 69 66 20 21 28 64 65 66 69 6e 65 64 28 5f 5f 6d if !(defined(__m
2930: 69 70 73 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 ips64__) || defi
2940: 6e 65 64 28 5f 5f 61 6c 70 68 61 5f 5f 29 20 7c ned(__alpha__) |
2950: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 | defined(__powe
2960: 72 70 63 36 34 5f 5f 29 29 20 26 26 20 64 65 66 rpc64__)) && def
2970: 69 6e 65 64 28 48 41 56 45 5f 4c 4f 4e 47 5f 4c ined(HAVE_LONG_L
2980: 4f 4e 47 5f 49 4e 54 29 0a 20 20 20 20 6c 6f 6e ONG_INT). lon
2990: 67 20 6c 6f 6e 67 20 20 20 20 20 20 20 20 20 20 g long
29a0: 20 5f 6c 6f 6e 67 6c 6f 6e 67 3b 0a 20 20 20 20 _longlong;.
29b0: 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f unsigned long lo
29c0: 6e 67 20 20 5f 75 6c 6f 6e 67 6c 6f 6e 67 3b 0a ng _ulonglong;.
29d0: 23 65 6e 64 69 66 0a 20 20 20 20 66 6c 6f 61 74 #endif. float
29e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f _
29f0: 66 6c 6f 61 74 3b 0a 20 20 20 20 64 6f 75 62 6c float;. doubl
2a00: 65 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f e _
2a10: 64 6f 75 62 6c 65 3b 0a 20 20 20 20 76 6f 69 64 double;. void
2a20: 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 *
2a30: 5f 70 74 72 3b 0a 20 20 20 20 5f 5f 76 61 77 6f _ptr;. __vawo
2a40: 72 64 20 20 20 20 20 20 20 20 20 20 20 20 5f 77 rd _w
2a50: 6f 72 64 73 5b 32 5d 3b 0a 20 20 7d 20 20 20 20 ords[2];. }
2a60: 20 20 20 20 20 20 20 20 20 20 74 6d 70 3b 0a 23 tmp;.#
2a70: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 69 33 38 if defined(__i38
2a80: 36 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 6__) || defined(
2a90: 5f 5f 6d 36 38 6b 5f 5f 29 20 7c 7c 20 28 64 65 __m68k__) || (de
2aa0: 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 5f 5f 29 fined(__sparc__)
2ab0: 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f 5f 73 && !defined(__s
2ac0: 70 61 72 63 36 34 5f 5f 29 29 20 7c 7c 20 64 65 parc64__)) || de
2ad0: 66 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f 29 20 fined(__hppa__)
2ae0: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 38 38 || defined(__m88
2af0: 6b 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 k__) || defined(
2b00: 5f 5f 69 61 36 34 5f 5f 29 0a 20 20 76 6f 69 64 __ia64__). void
2b10: 2a 20 20 20 20 20 20 20 20 20 20 73 74 72 75 63 * struc
2b20: 74 72 61 64 64 72 3b 0a 23 65 6e 64 69 66 0a 23 traddr;.#endif.#
2b30: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 if defined(__mip
2b40: 73 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 s__) || defined(
2b50: 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 __mipsn32__) ||
2b60: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 defined(__mips64
2b70: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
2b80: 5f 61 6c 70 68 61 5f 5f 29 20 7c 7c 20 64 65 66 _alpha__) || def
2b90: 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f 29 0a 20 ined(__hppa__).
2ba0: 20 6c 6f 6e 67 20 20 20 20 20 20 20 20 20 20 20 long
2bb0: 6d 65 6d 61 72 67 70 74 72 3b 0a 23 65 6e 64 69 memargptr;.#endi
2bc0: 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f f.#if defined(__
2bd0: 68 70 70 61 5f 5f 29 0a 20 20 6c 6f 6e 67 20 20 hppa__). long
2be0: 20 20 20 20 20 20 20 20 20 66 61 72 67 5f 6f 66 farg_of
2bf0: 66 73 65 74 3b 0a 20 20 6c 6f 6e 67 20 20 20 20 fset;. long
2c00: 20 20 20 20 20 20 20 64 61 72 67 5f 6f 66 66 73 darg_offs
2c10: 65 74 3b 0a 20 20 66 6c 6f 61 74 20 20 20 20 20 et;. float
2c20: 20 20 20 20 20 66 61 72 67 5b 34 5d 3b 0a 20 20 farg[4];.
2c30: 64 6f 75 62 6c 65 20 20 20 20 20 20 20 20 20 64 double d
2c40: 61 72 67 5b 32 5d 3b 0a 23 65 6e 64 69 66 0a 23 arg[2];.#endif.#
2c50: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 if defined(__mip
2c60: 73 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 s__) && !defined
2c70: 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 26 26 (__mipsn32__) &&
2c80: 20 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 !defined(__mips
2c90: 36 34 5f 5f 29 0a 20 20 69 6e 74 20 20 20 20 20 64__). int
2ca0: 20 20 20 20 20 20 20 61 6e 75 6d 3b 0a 20 20 66 anum;. f
2cb0: 6c 6f 61 74 20 20 20 20 20 20 20 20 20 20 66 61 loat fa
2cc0: 72 67 5b 32 5d 3b 0a 20 20 64 6f 75 62 6c 65 20 rg[2];. double
2cd0: 20 20 20 20 20 20 20 20 64 61 72 67 5b 32 5d 3b darg[2];
2ce0: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
2cf0: 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 ned(__mipsn32__)
2d00: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 || defined(__mi
2d10: 70 73 36 34 5f 5f 29 0a 20 20 69 6e 74 20 20 20 ps64__). int
2d20: 20 20 20 20 20 20 20 20 20 61 6e 75 6d 3b 0a 20 anum;.
2d30: 20 66 6c 6f 61 74 20 20 20 20 20 20 20 20 20 20 float
2d40: 66 61 72 67 5b 38 5d 3b 0a 20 20 64 6f 75 62 6c farg[8];. doubl
2d50: 65 20 20 20 20 20 20 20 20 20 64 61 72 67 5b 38 e darg[8
2d60: 5d 3b 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 ];.#endif.#if de
2d70: 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f fined(__sparc64_
2d80: 5f 29 0a 20 20 69 6e 74 20 20 20 20 20 20 20 20 _). int
2d90: 20 20 20 20 61 6e 75 6d 3b 0a 20 20 66 6c 6f 61 anum;. floa
2da0: 74 20 20 20 20 20 20 20 20 20 20 66 61 72 67 5b t farg[
2db0: 31 36 5d 3b 0a 20 20 64 6f 75 62 6c 65 20 20 20 16];. double
2dc0: 20 20 20 20 20 20 64 61 72 67 5b 31 36 5d 3b 0a darg[16];.
2dd0: 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e #endif.#if defin
2de0: 65 64 28 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 ed(__powerpc__)
2df0: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 || defined(__pow
2e00: 65 72 70 63 36 34 5f 5f 29 0a 20 20 64 6f 75 62 erpc64__). doub
2e10: 6c 65 2a 20 20 20 20 20 20 20 20 6d 65 6d 66 61 le* memfa
2e20: 72 67 70 74 72 3b 0a 20 20 64 6f 75 62 6c 65 20 rgptr;. double
2e30: 20 20 20 20 20 20 20 20 66 61 72 67 5b 31 33 5d farg[13]
2e40: 3b 0a 23 69 66 20 21 28 64 65 66 69 6e 65 64 28 ;.#if !(defined(
2e50: 5f 41 49 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 _AIX) || (define
2e60: 64 28 5f 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 d(__MACH__) && d
2e70: 65 66 69 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f efined(__APPLE__
2e80: 29 29 29 0a 20 20 5f 5f 76 61 77 6f 72 64 20 20 ))). __vaword
2e90: 20 20 20 20 20 72 65 67 61 72 67 5b 38 5d 3b 0a regarg[8];.
2ea0: 20 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 unsigned long
2eb0: 20 73 61 70 74 72 3b 0a 20 20 69 6e 74 20 20 20 saptr;. int
2ec0: 20 20 20 20 20 20 20 20 20 6f 6e 73 74 61 63 6b onstack
2ed0: 3b 0a 23 65 6e 64 69 66 0a 23 65 6e 64 69 66 0a ;.#endif.#endif.
2ee0: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 73 33 #if defined(__s3
2ef0: 39 30 5f 5f 29 0a 20 20 66 6c 6f 61 74 2a 20 20 90__). float*
2f00: 20 20 20 20 20 20 20 6d 65 6d 66 61 72 67 70 74 memfargpt
2f10: 72 3b 0a 20 20 64 6f 75 62 6c 65 2a 20 20 20 20 r;. double*
2f20: 20 20 20 20 6d 65 6d 64 61 72 67 70 74 72 3b 0a memdargptr;.
2f30: 20 20 66 6c 6f 61 74 20 20 20 20 20 20 20 20 20 float
2f40: 20 66 61 72 67 5b 32 5d 3b 0a 20 20 64 6f 75 62 farg[2];. doub
2f50: 6c 65 20 20 20 20 20 20 20 20 20 64 61 72 67 5b le darg[
2f60: 32 5d 3b 0a 20 20 5f 5f 76 61 77 6f 72 64 20 20 2];. __vaword
2f70: 20 20 20 20 20 72 65 67 61 72 67 5b 35 5d 3b 0a regarg[5];.
2f80: 20 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 unsigned long
2f90: 20 73 61 70 74 72 3b 0a 20 20 69 6e 74 20 20 20 saptr;. int
2fa0: 20 20 20 20 20 20 20 20 20 6f 6e 73 74 61 63 6b onstack
2fb0: 3b 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 ;.#endif.#if def
2fc0: 69 6e 65 64 28 5f 5f 69 61 36 34 5f 5f 29 0a 20 ined(__ia64__).
2fd0: 20 5f 5f 76 61 77 6f 72 64 2a 20 20 20 20 20 20 __vaword*
2fe0: 73 61 70 74 72 3b 0a 20 20 64 6f 75 62 6c 65 2a saptr;. double*
2ff0: 20 20 20 20 20 20 20 20 6d 65 6d 66 61 72 67 70 memfargp
3000: 74 72 3b 0a 20 20 64 6f 75 62 6c 65 20 20 20 20 tr;. double
3010: 20 20 20 20 20 66 61 72 67 5b 38 5d 3b 0a 23 65 farg[8];.#e
3020: 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 ndif.#if defined
3030: 28 5f 5f 78 38 36 5f 36 34 5f 5f 29 0a 20 20 64 (__x86_64__). d
3040: 6f 75 62 6c 65 2a 20 20 20 20 20 20 20 20 6d 65 ouble* me
3050: 6d 66 61 72 67 70 74 72 3b 0a 20 20 64 6f 75 62 mfargptr;. doub
3060: 6c 65 20 20 20 20 20 20 20 20 20 66 61 72 67 5b le farg[
3070: 38 5d 3b 0a 20 20 5f 5f 76 61 77 6f 72 64 2a 20 8];. __vaword*
3080: 20 20 20 20 20 6d 65 6d 69 61 72 67 70 74 72 3b memiargptr;
3090: 0a 20 20 5f 5f 76 61 77 6f 72 64 20 20 20 20 20 . __vaword
30a0: 20 20 69 61 72 67 5b 36 5d 3b 0a 23 65 6e 64 69 iarg[6];.#endi
30b0: 66 0a 7d 20 5f 5f 76 61 5f 61 6c 69 73 74 3b 0a f.} __va_alist;.
30c0: 0a 74 79 70 65 64 65 66 20 5f 5f 76 61 5f 61 6c .typedef __va_al
30d0: 69 73 74 2a 20 76 61 5f 61 6c 69 73 74 3b 0a 0a ist* va_alist;..
30e0: 0a 2f 2a 0a 20 2a 20 44 65 66 69 6e 69 74 69 6f ./*. * Definitio
30f0: 6e 20 6f 66 20 74 68 65 20 76 61 5f 73 74 61 72 n of the va_star
3100: 74 5f 78 78 78 20 6d 61 63 72 6f 73 2e 0a 20 2a t_xxx macros.. *
3110: 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 56 41 5f 53 /.#define __VA_S
3120: 54 41 52 54 5f 46 4c 41 47 53 20 20 5c 0a 20 20 TART_FLAGS \.
3130: 5f 5f 56 41 5f 53 54 52 55 43 54 5f 52 45 54 55 __VA_STRUCT_RETU
3140: 52 4e 20 7c 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f RN | __VA_FLOAT_
3150: 52 45 54 55 52 4e 20 7c 20 5f 5f 56 41 5f 53 54 RETURN | __VA_ST
3160: 52 55 43 54 5f 41 52 47 53 20 7c 20 5f 5f 56 41 RUCT_ARGS | __VA
3170: 5f 43 4c 45 41 4e 55 50 0a 23 64 65 66 69 6e 65 _CLEANUP.#define
3180: 20 5f 5f 76 61 5f 73 74 61 72 74 28 4c 49 53 54 __va_start(LIST
3190: 2c 52 45 54 54 59 50 45 29 20 20 5c 0a 20 20 28 ,RETTYPE) \. (
31a0: 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 3d 20 (LIST)->flags =
31b0: 5f 5f 56 41 5f 53 54 41 52 54 5f 46 4c 41 47 53 __VA_START_FLAGS
31c0: 2c 09 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 ,.....\. (LIST
31d0: 29 2d 3e 72 74 79 70 65 20 3d 20 28 52 45 54 54 )->rtype = (RETT
31e0: 59 50 45 29 09 09 09 09 09 09 5c 0a 20 20 29 0a YPE)......\. ).
31f0: 23 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 #define va_start
3200: 5f 76 6f 69 64 28 4c 49 53 54 29 09 20 5f 5f 76 _void(LIST). __v
3210: 61 5f 73 74 61 72 74 28 4c 49 53 54 2c 5f 5f 56 a_start(LIST,__V
3220: 41 76 6f 69 64 29 0a 23 64 65 66 69 6e 65 20 76 Avoid).#define v
3230: 61 5f 73 74 61 72 74 5f 63 68 61 72 28 4c 49 53 a_start_char(LIS
3240: 54 29 09 20 5f 5f 76 61 5f 73 74 61 72 74 28 4c T). __va_start(L
3250: 49 53 54 2c 5f 5f 56 41 63 68 61 72 29 0a 23 64 IST,__VAchar).#d
3260: 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 5f 73 efine va_start_s
3270: 63 68 61 72 28 4c 49 53 54 29 09 20 5f 5f 76 61 char(LIST). __va
3280: 5f 73 74 61 72 74 28 4c 49 53 54 2c 5f 5f 56 41 _start(LIST,__VA
3290: 73 63 68 61 72 29 0a 23 64 65 66 69 6e 65 20 76 schar).#define v
32a0: 61 5f 73 74 61 72 74 5f 75 63 68 61 72 28 4c 49 a_start_uchar(LI
32b0: 53 54 29 09 20 5f 5f 76 61 5f 73 74 61 72 74 28 ST). __va_start(
32c0: 4c 49 53 54 2c 5f 5f 56 41 75 63 68 61 72 29 0a LIST,__VAuchar).
32d0: 23 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 #define va_start
32e0: 5f 73 68 6f 72 74 28 4c 49 53 54 29 09 20 5f 5f _short(LIST). __
32f0: 76 61 5f 73 74 61 72 74 28 4c 49 53 54 2c 5f 5f va_start(LIST,__
3300: 56 41 73 68 6f 72 74 29 0a 23 64 65 66 69 6e 65 VAshort).#define
3310: 20 76 61 5f 73 74 61 72 74 5f 75 73 68 6f 72 74 va_start_ushort
3320: 28 4c 49 53 54 29 09 20 5f 5f 76 61 5f 73 74 61 (LIST). __va_sta
3330: 72 74 28 4c 49 53 54 2c 5f 5f 56 41 75 73 68 6f rt(LIST,__VAusho
3340: 72 74 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 73 rt).#define va_s
3350: 74 61 72 74 5f 69 6e 74 28 4c 49 53 54 29 09 20 tart_int(LIST).
3360: 5f 5f 76 61 5f 73 74 61 72 74 28 4c 49 53 54 2c __va_start(LIST,
3370: 5f 5f 56 41 69 6e 74 29 0a 23 64 65 66 69 6e 65 __VAint).#define
3380: 20 76 61 5f 73 74 61 72 74 5f 75 69 6e 74 28 4c va_start_uint(L
3390: 49 53 54 29 09 20 5f 5f 76 61 5f 73 74 61 72 74 IST). __va_start
33a0: 28 4c 49 53 54 2c 5f 5f 56 41 75 69 6e 74 29 0a (LIST,__VAuint).
33b0: 23 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 #define va_start
33c0: 5f 6c 6f 6e 67 28 4c 49 53 54 29 09 20 5f 5f 76 _long(LIST). __v
33d0: 61 5f 73 74 61 72 74 28 4c 49 53 54 2c 5f 5f 56 a_start(LIST,__V
33e0: 41 6c 6f 6e 67 29 0a 23 64 65 66 69 6e 65 20 76 Along).#define v
33f0: 61 5f 73 74 61 72 74 5f 75 6c 6f 6e 67 28 4c 49 a_start_ulong(LI
3400: 53 54 29 09 20 5f 5f 76 61 5f 73 74 61 72 74 28 ST). __va_start(
3410: 4c 49 53 54 2c 5f 5f 56 41 75 6c 6f 6e 67 29 0a LIST,__VAulong).
3420: 23 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 #define va_start
3430: 5f 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 29 09 _longlong(LIST).
3440: 20 5f 5f 76 61 5f 73 74 61 72 74 28 4c 49 53 54 __va_start(LIST
3450: 2c 5f 5f 56 41 6c 6f 6e 67 6c 6f 6e 67 29 0a 23 ,__VAlonglong).#
3460: 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 5f define va_start_
3470: 75 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 29 20 ulonglong(LIST)
3480: 5f 5f 76 61 5f 73 74 61 72 74 28 4c 49 53 54 2c __va_start(LIST,
3490: 5f 5f 56 41 75 6c 6f 6e 67 6c 6f 6e 67 29 0a 23 __VAulonglong).#
34a0: 64 65 66 69 6e 65 20 76 61 5f 73 74 61 72 74 5f define va_start_
34b0: 66 6c 6f 61 74 28 4c 49 53 54 29 09 20 5f 5f 76 float(LIST). __v
34c0: 61 5f 73 74 61 72 74 28 4c 49 53 54 2c 5f 5f 56 a_start(LIST,__V
34d0: 41 66 6c 6f 61 74 29 0a 23 64 65 66 69 6e 65 20 Afloat).#define
34e0: 76 61 5f 73 74 61 72 74 5f 64 6f 75 62 6c 65 28 va_start_double(
34f0: 4c 49 53 54 29 09 20 5f 5f 76 61 5f 73 74 61 72 LIST). __va_star
3500: 74 28 4c 49 53 54 2c 5f 5f 56 41 64 6f 75 62 6c t(LIST,__VAdoubl
3510: 65 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 73 74 e).#define va_st
3520: 61 72 74 5f 70 74 72 28 4c 49 53 54 2c 54 59 50 art_ptr(LIST,TYP
3530: 45 29 09 20 5f 5f 76 61 5f 73 74 61 72 74 28 4c E). __va_start(L
3540: 49 53 54 2c 5f 5f 56 41 76 6f 69 64 70 29 0a 0a IST,__VAvoidp)..
3550: 2f 2a 0a 20 2a 20 76 61 5f 73 74 61 72 74 5f 73 /*. * va_start_s
3560: 74 72 75 63 74 3a 20 50 72 65 70 61 72 69 6e 67 truct: Preparing
3570: 20 73 74 72 75 63 74 75 72 65 20 72 65 74 75 72 structure retur
3580: 6e 2e 0a 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 n.. */.#define v
3590: 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 28 4c a_start_struct(L
35a0: 49 53 54 2c 54 59 50 45 2c 54 59 50 45 5f 53 50 IST,TYPE,TYPE_SP
35b0: 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 5f LITTABLE) \. _
35c0: 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 28 va_start_struct(
35d0: 4c 49 53 54 2c 73 69 7a 65 6f 66 28 54 59 50 45 LIST,sizeof(TYPE
35e0: 29 2c 5f 5f 56 41 5f 61 6c 69 67 6e 6f 66 28 54 ),__VA_alignof(T
35f0: 59 50 45 29 2c 54 59 50 45 5f 53 50 4c 49 54 54 YPE),TYPE_SPLITT
3600: 41 42 4c 45 29 0a 2f 2a 20 5f 76 61 5f 73 74 61 ABLE)./* _va_sta
3610: 72 74 5f 73 74 72 75 63 74 28 29 20 69 73 20 6c rt_struct() is l
3620: 69 6b 65 20 76 61 5f 73 74 61 72 74 5f 73 74 72 ike va_start_str
3630: 75 63 74 28 29 2c 20 65 78 63 65 70 74 20 74 68 uct(), except th
3640: 61 74 20 79 6f 75 20 70 61 73 73 0a 20 2a 20 74 at you pass. * t
3650: 68 65 20 74 79 70 65 27 73 20 73 69 7a 65 20 61 he type's size a
3660: 6e 64 20 61 6c 69 67 6e 6d 65 6e 74 20 69 6e 73 nd alignment ins
3670: 74 65 61 64 20 6f 66 20 74 68 65 20 74 79 70 65 tead of the type
3680: 20 69 74 73 65 6c 66 2e 0a 20 2a 2f 0a 23 64 65 itself.. */.#de
3690: 66 69 6e 65 20 5f 76 61 5f 73 74 61 72 74 5f 73 fine _va_start_s
36a0: 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 45 5f truct(LIST,TYPE_
36b0: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c SIZE,TYPE_ALIGN,
36c0: 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 TYPE_SPLITTABLE)
36d0: 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 73 74 61 72 \. (__va_star
36e0: 74 28 4c 49 53 54 2c 5f 5f 56 41 73 74 72 75 63 t(LIST,__VAstruc
36f0: 74 29 2c 09 09 09 09 09 09 5c 0a 20 20 20 28 4c t),......\. (L
3700: 49 53 54 29 2d 3e 72 73 69 7a 65 20 3d 20 28 54 IST)->rsize = (T
3710: 59 50 45 5f 53 49 5a 45 29 2c 09 09 09 09 09 09 YPE_SIZE),......
3720: 5c 0a 20 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c \. ((LIST)->fl
3730: 61 67 73 20 26 20 5f 5f 56 41 5f 53 55 4e 50 52 ags & __VA_SUNPR
3740: 4f 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 OCC_STRUCT_RETUR
3750: 4e 09 09 09 09 5c 0a 20 20 20 20 3f 20 5f 5f 76 N....\. ? __v
3760: 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 32 28 a_start_struct2(
3770: 4c 49 53 54 29 09 09 09 09 09 09 5c 0a 20 20 20 LIST)......\.
3780: 20 3a 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 : ((LIST)->flag
3790: 73 20 26 20 28 5f 5f 56 41 5f 50 43 43 5f 53 54 s & (__VA_PCC_ST
37a0: 52 55 43 54 5f 52 45 54 55 52 4e 20 7c 20 5f 5f RUCT_RETURN | __
37b0: 56 41 5f 53 55 4e 43 43 5f 53 54 52 55 43 54 5f VA_SUNCC_STRUCT_
37c0: 52 45 54 55 52 4e 29 20 5c 0a 20 20 20 20 20 20 RETURN) \.
37d0: 20 3f 20 28 28 54 59 50 45 5f 53 49 5a 45 29 20 ? ((TYPE_SIZE)
37e0: 3c 3d 20 73 69 7a 65 6f 66 28 5f 5f 76 61 5f 73 <= sizeof(__va_s
37f0: 74 72 75 63 74 5f 62 75 66 66 65 72 29 20 7c 7c truct_buffer) ||
3800: 20 5f 5f 76 61 5f 65 72 72 6f 72 32 28 54 59 50 __va_error2(TYP
3810: 45 5f 53 49 5a 45 29 2c 20 5c 0a 20 20 20 20 20 E_SIZE), \.
3820: 20 20 20 20 20 28 4c 49 53 54 29 2d 3e 72 61 64 (LIST)->rad
3830: 64 72 20 3d 20 26 5f 5f 76 61 5f 73 74 72 75 63 dr = &__va_struc
3840: 74 5f 62 75 66 66 65 72 2c 09 09 09 09 5c 0a 20 t_buffer,....\.
3850: 20 20 20 20 20 20 20 20 20 30 09 09 09 09 09 09 0......
3860: 09 09 5c 0a 20 20 20 20 20 20 20 20 20 29 09 09 ..\. )..
3870: 09 09 09 09 09 09 5c 0a 20 20 20 20 20 20 20 3a ......\. :
3880: 20 28 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 (((LIST)->flags
3890: 20 26 20 5f 5f 56 41 5f 53 4d 41 4c 4c 5f 53 54 & __VA_SMALL_ST
38a0: 52 55 43 54 5f 52 45 54 55 52 4e 29 09 09 09 5c RUCT_RETURN)...\
38b0: 0a 20 20 20 20 20 20 20 20 20 20 26 26 20 5f 5f . && __
38c0: 76 61 5f 72 65 67 5f 73 74 72 75 63 74 5f 72 65 va_reg_struct_re
38d0: 74 75 72 6e 28 4c 49 53 54 2c 54 59 50 45 5f 53 turn(LIST,TYPE_S
38e0: 49 5a 45 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 IZE,TYPE_SPLITTA
38f0: 42 4c 45 29 09 5c 0a 20 20 20 20 20 20 20 20 20 BLE).\.
3900: 20 3f 20 28 28 4c 49 53 54 29 2d 3e 72 61 64 64 ? ((LIST)->radd
3910: 72 20 3d 20 26 28 4c 49 53 54 29 2d 3e 74 6d 70 r = &(LIST)->tmp
3920: 2c 09 09 09 09 5c 0a 20 20 20 20 20 20 20 20 20 ,....\.
3930: 20 20 20 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 __va_start_s
3940: 74 72 75 63 74 31 28 4c 49 53 54 2c 54 59 50 45 truct1(LIST,TYPE
3950: 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e _SIZE,TYPE_ALIGN
3960: 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 ,TYPE_SPLITTABLE
3970: 29 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 ) \.
3980: 29 09 09 09 09 09 09 09 09 5c 0a 20 20 20 20 20 )........\.
3990: 20 20 20 20 20 3a 20 5f 5f 76 61 5f 73 74 61 72 : __va_star
39a0: 74 5f 73 74 72 75 63 74 32 28 4c 49 53 54 29 09 t_struct2(LIST).
39b0: 09 09 09 09 5c 0a 20 20 29 29 20 20 29 20 20 29 ....\. )) ) )
39c0: 0a 2f 2a 20 44 65 74 65 72 6d 69 6e 65 73 20 77 ./* Determines w
39d0: 68 65 74 68 65 72 20 61 20 73 74 72 75 63 74 75 hether a structu
39e0: 72 65 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 re is returned i
39f0: 6e 20 72 65 67 69 73 74 65 72 73 2c 0a 20 2a 20 n registers,. *
3a00: 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 69 74 73 depending on its
3a10: 20 73 69 7a 65 20 61 6e 64 20 69 74 73 20 77 6f size and its wo
3a20: 72 64 2d 73 70 6c 69 74 74 61 62 6c 65 20 66 6c rd-splittable fl
3a30: 61 67 2e 0a 20 2a 2f 0a 23 69 66 20 28 64 65 66 ag.. */.#if (def
3a40: 69 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 26 ined(__i386__) &
3a50: 26 20 64 65 66 69 6e 65 64 28 5f 57 49 4e 33 32 & defined(_WIN32
3a60: 29 29 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f )).#define __va_
3a70: 72 65 67 5f 73 74 72 75 63 74 5f 72 65 74 75 72 reg_struct_retur
3a80: 6e 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 n(LIST,TYPE_SIZE
3a90: 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 ,TYPE_SPLITTABLE
3aa0: 29 20 20 5c 0a 20 20 28 28 54 59 50 45 5f 53 49 ) \. ((TYPE_SI
3ab0: 5a 45 29 20 3d 3d 20 31 20 7c 7c 20 28 54 59 50 ZE) == 1 || (TYP
3ac0: 45 5f 53 49 5a 45 29 20 3d 3d 20 32 20 7c 7c 20 E_SIZE) == 2 ||
3ad0: 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 34 (TYPE_SIZE) == 4
3ae0: 09 09 5c 0a 20 20 20 7c 7c 20 28 28 54 59 50 45 ..\. || ((TYPE
3af0: 5f 53 49 5a 45 29 20 3d 3d 20 38 09 09 09 09 09 _SIZE) == 8.....
3b00: 09 09 5c 0a 20 20 20 20 20 20 20 26 26 20 28 28 ..\. && ((
3b10: 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 26 20 (LIST)->flags &
3b20: 5f 5f 56 41 5f 4d 53 56 43 5f 53 54 52 55 43 54 __VA_MSVC_STRUCT
3b30: 5f 52 45 54 55 52 4e 29 09 09 09 5c 0a 20 20 20 _RETURN)...\.
3b40: 20 20 20 20 20 20 20 20 7c 7c 20 28 28 54 59 50 || ((TYP
3b50: 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 09 09 09 E_SPLITTABLE)...
3b60: 09 09 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 ..\.
3b70: 20 20 20 26 26 20 28 28 4c 49 53 54 29 2d 3e 66 && ((LIST)->f
3b80: 6c 61 67 73 20 26 20 5f 5f 56 41 5f 47 43 43 5f lags & __VA_GCC_
3b90: 53 54 52 55 43 54 5f 52 45 54 55 52 4e 29 09 09 STRUCT_RETURN)..
3ba0: 5c 0a 20 20 29 20 20 20 29 20 20 20 29 20 20 20 \. ) ) )
3bb0: 29 0a 2f 2a 20 54 75 72 6e 20 6f 6e 20 5f 5f 56 )./* Turn on __V
3bc0: 41 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55 43 A_REGISTER_STRUC
3bd0: 54 5f 52 45 54 55 52 4e 20 69 66 20 5f 5f 56 41 T_RETURN if __VA
3be0: 5f 53 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 _SMALL_STRUCT_RE
3bf0: 54 55 52 4e 20 77 61 73 20 73 65 74 0a 20 2a 20 TURN was set. *
3c00: 61 6e 64 20 74 68 65 20 73 74 72 75 63 74 20 77 and the struct w
3c10: 69 6c 6c 20 61 63 74 75 61 6c 6c 79 20 62 65 20 ill actually be
3c20: 72 65 74 75 72 6e 65 64 20 69 6e 20 72 65 67 69 returned in regi
3c30: 73 74 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 sters.. */.#defi
3c40: 6e 65 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 ne __va_start_st
3c50: 72 75 63 74 31 28 4c 49 53 54 2c 54 59 50 45 5f ruct1(LIST,TYPE_
3c60: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c SIZE,TYPE_ALIGN,
3c70: 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 TYPE_SPLITTABLE)
3c80: 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 \. ((LIST)->f
3c90: 6c 61 67 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 lags |= __VA_REG
3ca0: 49 53 54 45 52 5f 53 54 52 55 43 54 5f 52 45 54 ISTER_STRUCT_RET
3cb0: 55 52 4e 2c 20 30 29 0a 23 65 6e 64 69 66 0a 23 URN, 0).#endif.#
3cc0: 69 66 20 28 64 65 66 69 6e 65 64 28 5f 5f 69 33 if (defined(__i3
3cd0: 38 36 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 86__) && !define
3ce0: 64 28 5f 57 49 4e 33 32 29 29 20 7c 7c 20 64 65 d(_WIN32)) || de
3cf0: 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f 29 20 fined(__m68k__)
3d00: 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f 61 72 || (defined(__ar
3d10: 6d 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 m__) && !defined
3d20: 28 5f 5f 41 52 4d 45 4c 5f 5f 29 29 20 7c 7c 20 (__ARMEL__)) ||
3d30: 28 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 (defined(__power
3d40: 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 pc__) && !define
3d50: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
3d60: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 63 ) || defined(__c
3d70: 6f 6e 76 65 78 5f 5f 29 20 7c 7c 20 64 65 66 69 onvex__) || defi
3d80: 6e 65 64 28 5f 5f 73 33 39 30 5f 5f 29 0a 23 64 ned(__s390__).#d
3d90: 65 66 69 6e 65 20 5f 5f 76 61 5f 72 65 67 5f 73 efine __va_reg_s
3da0: 74 72 75 63 74 5f 72 65 74 75 72 6e 28 4c 49 53 truct_return(LIS
3db0: 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 T,TYPE_SIZE,TYPE
3dc0: 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a _SPLITTABLE) \.
3dd0: 20 20 28 28 54 59 50 45 5f 53 49 5a 45 29 20 3d ((TYPE_SIZE) =
3de0: 3d 20 31 20 7c 7c 20 28 54 59 50 45 5f 53 49 5a = 1 || (TYPE_SIZ
3df0: 45 29 20 3d 3d 20 32 20 7c 7c 20 28 54 59 50 45 E) == 2 || (TYPE
3e00: 5f 53 49 5a 45 29 20 3d 3d 20 34 09 09 5c 0a 20 _SIZE) == 4..\.
3e10: 20 20 7c 7c 20 28 28 54 59 50 45 5f 53 49 5a 45 || ((TYPE_SIZE
3e20: 29 20 3d 3d 20 38 20 26 26 20 28 54 59 50 45 5f ) == 8 && (TYPE_
3e30: 53 50 4c 49 54 54 41 42 4c 45 29 09 09 09 09 5c SPLITTABLE)....\
3e40: 0a 20 20 20 20 20 20 20 26 26 20 28 28 4c 49 53 . && ((LIS
3e50: 54 29 2d 3e 66 6c 61 67 73 20 26 20 5f 5f 56 41 T)->flags & __VA
3e60: 5f 47 43 43 5f 53 54 52 55 43 54 5f 52 45 54 55 _GCC_STRUCT_RETU
3e70: 52 4e 29 09 09 09 5c 0a 20 20 29 20 20 20 29 0a RN)...\. ) ).
3e80: 2f 2a 20 54 75 72 6e 20 6f 6e 20 5f 5f 56 41 5f /* Turn on __VA_
3e90: 52 45 47 49 53 54 45 52 5f 53 54 52 55 43 54 5f REGISTER_STRUCT_
3ea0: 52 45 54 55 52 4e 20 69 66 20 5f 5f 56 41 5f 53 RETURN if __VA_S
3eb0: 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 54 55 MALL_STRUCT_RETU
3ec0: 52 4e 20 77 61 73 20 73 65 74 0a 20 2a 20 61 6e RN was set. * an
3ed0: 64 20 74 68 65 20 73 74 72 75 63 74 20 77 69 6c d the struct wil
3ee0: 6c 20 61 63 74 75 61 6c 6c 79 20 62 65 20 72 65 l actually be re
3ef0: 74 75 72 6e 65 64 20 69 6e 20 72 65 67 69 73 74 turned in regist
3f00: 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 6e 65 ers.. */.#define
3f10: 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 75 __va_start_stru
3f20: 63 74 31 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 ct1(LIST,TYPE_SI
3f30: 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c 54 59 ZE,TYPE_ALIGN,TY
3f40: 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 PE_SPLITTABLE)
3f50: 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 \. ((LIST)->fla
3f60: 67 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 49 53 gs |= __VA_REGIS
3f70: 54 45 52 5f 53 54 52 55 43 54 5f 52 45 54 55 52 TER_STRUCT_RETUR
3f80: 4e 2c 20 30 29 0a 23 65 6e 64 69 66 0a 0a 23 69 N, 0).#endif..#i
3f90: 66 20 64 65 66 69 6e 65 64 28 5f 5f 41 52 4d 45 f defined(__ARME
3fa0: 4c 5f 5f 29 0a 2f 2a 20 73 74 72 75 63 74 73 20 L__)./* structs
3fb0: 6f 66 20 73 69 7a 65 20 33 20 61 6c 73 6f 20 77 of size 3 also w
3fc0: 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64 20 ill be returned
3fd0: 69 6e 20 72 65 67 69 73 74 65 72 20 2a 2f 0a 23 in register */.#
3fe0: 64 65 66 69 6e 65 20 5f 5f 76 61 5f 72 65 67 5f define __va_reg_
3ff0: 73 74 72 75 63 74 5f 72 65 74 75 72 6e 28 4c 49 struct_return(LI
4000: 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 ST,TYPE_SIZE,TYP
4010: 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c E_SPLITTABLE) \
4020: 0a 20 20 20 20 28 28 54 59 50 45 5f 53 49 5a 45 . ((TYPE_SIZE
4030: 29 20 3c 3d 20 34 29 0a 2f 2a 20 54 75 72 6e 20 ) <= 4)./* Turn
4040: 6f 6e 20 5f 5f 56 41 5f 52 45 47 49 53 54 45 52 on __VA_REGISTER
4050: 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 20 69 _STRUCT_RETURN i
4060: 66 20 5f 5f 56 41 5f 53 4d 41 4c 4c 5f 53 54 52 f __VA_SMALL_STR
4070: 55 43 54 5f 52 45 54 55 52 4e 20 77 61 73 20 73 UCT_RETURN was s
4080: 65 74 0a 20 2a 20 61 6e 64 20 74 68 65 20 73 74 et. * and the st
4090: 72 75 63 74 20 77 69 6c 6c 20 61 63 74 75 61 6c ruct will actual
40a0: 6c 79 20 62 65 20 72 65 74 75 72 6e 65 64 20 69 ly be returned i
40b0: 6e 20 72 65 67 69 73 74 65 72 73 2e 0a 20 2a 2f n registers.. */
40c0: 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f 73 74 .#define __va_st
40d0: 61 72 74 5f 73 74 72 75 63 74 31 28 4c 49 53 54 art_struct1(LIST
40e0: 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f ,TYPE_SIZE,TYPE_
40f0: 41 4c 49 47 4e 2c 54 59 50 45 5f 53 50 4c 49 54 ALIGN,TYPE_SPLIT
4100: 54 41 42 4c 45 29 20 20 5c 0a 20 20 28 28 4c 49 TABLE) \. ((LI
4110: 53 54 29 2d 3e 66 6c 61 67 73 20 7c 3d 20 5f 5f ST)->flags |= __
4120: 56 41 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55 VA_REGISTER_STRU
4130: 43 54 5f 52 45 54 55 52 4e 2c 20 30 29 0a 23 65 CT_RETURN, 0).#e
4140: 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 ndif.#if defined
4150: 28 5f 5f 61 6c 70 68 61 5f 5f 29 0a 23 64 65 66 (__alpha__).#def
4160: 69 6e 65 20 5f 5f 76 61 5f 72 65 67 5f 73 74 72 ine __va_reg_str
4170: 75 63 74 5f 72 65 74 75 72 6e 28 4c 49 53 54 2c uct_return(LIST,
4180: 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 53 TYPE_SIZE,TYPE_S
4190: 50 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 PLITTABLE) \.
41a0: 28 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 ((TYPE_SIZE) ==
41b0: 31 20 7c 7c 20 28 54 59 50 45 5f 53 49 5a 45 29 1 || (TYPE_SIZE)
41c0: 20 3d 3d 20 32 20 7c 7c 20 28 54 59 50 45 5f 53 == 2 || (TYPE_S
41d0: 49 5a 45 29 20 3d 3d 20 34 20 7c 7c 20 28 54 59 IZE) == 4 || (TY
41e0: 50 45 5f 53 49 5a 45 29 20 3d 3d 20 38 09 5c 0a PE_SIZE) == 8.\.
41f0: 20 20 20 7c 7c 20 28 28 54 59 50 45 5f 53 49 5a || ((TYPE_SIZ
4200: 45 29 20 3d 3d 20 31 36 20 26 26 20 28 54 59 50 E) == 16 && (TYP
4210: 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 09 09 09 E_SPLITTABLE)...
4220: 09 5c 0a 20 20 20 20 20 20 20 26 26 20 28 28 4c .\. && ((L
4230: 49 53 54 29 2d 3e 66 6c 61 67 73 20 26 20 5f 5f IST)->flags & __
4240: 56 41 5f 47 43 43 5f 53 54 52 55 43 54 5f 52 45 VA_GCC_STRUCT_RE
4250: 54 55 52 4e 29 09 09 09 5c 0a 20 20 29 20 20 20 TURN)...\. )
4260: 29 0a 2f 2a 20 54 75 72 6e 20 6f 6e 20 5f 5f 56 )./* Turn on __V
4270: 41 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55 43 A_REGISTER_STRUC
4280: 54 5f 52 45 54 55 52 4e 20 69 66 20 5f 5f 56 41 T_RETURN if __VA
4290: 5f 53 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 _SMALL_STRUCT_RE
42a0: 54 55 52 4e 20 77 61 73 20 73 65 74 0a 20 2a 20 TURN was set. *
42b0: 61 6e 64 20 74 68 65 20 73 74 72 75 63 74 20 77 and the struct w
42c0: 69 6c 6c 20 61 63 74 75 61 6c 6c 79 20 62 65 20 ill actually be
42d0: 72 65 74 75 72 6e 65 64 20 69 6e 20 72 65 67 69 returned in regi
42e0: 73 74 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 sters.. */.#defi
42f0: 6e 65 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 ne __va_start_st
4300: 72 75 63 74 31 28 4c 49 53 54 2c 54 59 50 45 5f ruct1(LIST,TYPE_
4310: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c SIZE,TYPE_ALIGN,
4320: 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 TYPE_SPLITTABLE)
4330: 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 \. ((LIST)->f
4340: 6c 61 67 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 lags |= __VA_REG
4350: 49 53 54 45 52 5f 53 54 52 55 43 54 5f 52 45 54 ISTER_STRUCT_RET
4360: 55 52 4e 2c 20 30 29 0a 23 65 6e 64 69 66 0a 23 URN, 0).#endif.#
4370: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 68 70 70 if defined(__hpp
4380: 61 5f 5f 29 0a 23 64 65 66 69 6e 65 20 5f 5f 76 a__).#define __v
4390: 61 5f 72 65 67 5f 73 74 72 75 63 74 5f 72 65 74 a_reg_struct_ret
43a0: 75 72 6e 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 urn(LIST,TYPE_SI
43b0: 5a 45 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 42 ZE,TYPE_SPLITTAB
43c0: 4c 45 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 LE) \. ((LIST)
43d0: 2d 3e 66 6c 61 67 73 20 26 20 5f 5f 56 41 5f 4f ->flags & __VA_O
43e0: 4c 44 47 43 43 5f 53 54 52 55 43 54 5f 52 45 54 LDGCC_STRUCT_RET
43f0: 55 52 4e 09 09 09 09 5c 0a 20 20 20 3f 20 28 28 URN....\. ? ((
4400: 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 31 20 TYPE_SIZE) == 1
4410: 7c 7c 20 28 54 59 50 45 5f 53 49 5a 45 29 20 3d || (TYPE_SIZE) =
4420: 3d 20 32 20 7c 7c 20 28 54 59 50 45 5f 53 49 5a = 2 || (TYPE_SIZ
4430: 45 29 20 3d 3d 20 34 29 09 09 5c 0a 20 20 20 3a E) == 4)..\. :
4440: 20 28 28 54 59 50 45 5f 53 49 5a 45 29 20 3c 3d ((TYPE_SIZE) <=
4450: 20 38 29 09 09 09 09 09 09 09 5c 0a 20 20 29 0a 8).......\. ).
4460: 2f 2a 20 54 65 73 74 20 62 6f 74 68 20 5f 5f 56 /* Test both __V
4470: 41 5f 4f 4c 44 47 43 43 5f 53 54 52 55 43 54 5f A_OLDGCC_STRUCT_
4480: 52 45 54 55 52 4e 20 61 6e 64 20 5f 5f 56 41 5f RETURN and __VA_
4490: 53 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 54 SMALL_STRUCT_RET
44a0: 55 52 4e 20 61 74 20 72 75 6e 20 74 69 6d 65 2e URN at run time.
44b0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
44c0: 5f 73 74 61 72 74 5f 73 74 72 75 63 74 31 28 4c _start_struct1(L
44d0: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
44e0: 50 45 5f 41 4c 49 47 4e 2c 54 59 50 45 5f 53 50 PE_ALIGN,TYPE_SP
44f0: 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 30 LITTABLE) \. 0
4500: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
4510: 6e 65 64 28 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 ned(__mips__) &&
4520: 20 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 !defined(__mips
4530: 6e 33 32 5f 5f 29 20 26 26 20 21 64 65 66 69 6e n32__) && !defin
4540: 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 20 7c ed(__mips64__) |
4550: 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 | (defined(__spa
4560: 72 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 rc__) && !define
4570: 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 29 20 d(__sparc64__))
4580: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 38 38 || defined(__m88
4590: 6b 5f 5f 29 0a 23 64 65 66 69 6e 65 20 5f 5f 76 k__).#define __v
45a0: 61 5f 72 65 67 5f 73 74 72 75 63 74 5f 72 65 74 a_reg_struct_ret
45b0: 75 72 6e 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 urn(LIST,TYPE_SI
45c0: 5a 45 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 42 ZE,TYPE_SPLITTAB
45d0: 4c 45 29 20 20 5c 0a 20 20 28 28 54 59 50 45 5f LE) \. ((TYPE_
45e0: 53 49 5a 45 29 20 3d 3d 20 31 20 7c 7c 20 28 54 SIZE) == 1 || (T
45f0: 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 32 20 7c YPE_SIZE) == 2 |
4600: 7c 20 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d | (TYPE_SIZE) ==
4610: 20 34 29 0a 2f 2a 20 54 65 73 74 20 5f 5f 56 41 4)./* Test __VA
4620: 5f 53 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 45 _SMALL_STRUCT_RE
4630: 54 55 52 4e 20 69 6e 73 74 65 61 64 20 6f 66 20 TURN instead of
4640: 5f 5f 56 41 5f 52 45 47 49 53 54 45 52 5f 53 54 __VA_REGISTER_ST
4650: 52 55 43 54 5f 52 45 54 55 52 4e 2e 20 2a 2f 0a RUCT_RETURN. */.
4660: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 #if defined(__mi
4670: 70 73 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 ps__) && !define
4680: 64 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 26 d(__mipsn32__) &
4690: 26 20 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 & !defined(__mip
46a0: 73 36 34 5f 5f 29 0a 23 64 65 66 69 6e 65 20 5f s64__).#define _
46b0: 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 _va_start_struct
46c0: 31 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 1(LIST,TYPE_SIZE
46d0: 2c 54 59 50 45 5f 41 4c 49 47 4e 2c 54 59 50 45 ,TYPE_ALIGN,TYPE
46e0: 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a _SPLITTABLE) \.
46f0: 20 20 28 28 4c 49 53 54 29 2d 3e 61 6e 75 6d 2b ((LIST)->anum+
4700: 2b 2c 09 09 09 09 09 09 09 5c 0a 20 20 20 30 09 +,.......\. 0.
4710: 09 09 09 09 09 09 09 09 5c 0a 20 20 29 0a 23 65 ........\. ).#e
4720: 6c 73 65 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 lse.#define __va
4730: 5f 73 74 61 72 74 5f 73 74 72 75 63 74 31 28 4c _start_struct1(L
4740: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
4750: 50 45 5f 41 4c 49 47 4e 2c 54 59 50 45 5f 53 50 PE_ALIGN,TYPE_SP
4760: 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 30 LITTABLE) \. 0
4770: 0a 23 65 6e 64 69 66 0a 23 65 6e 64 69 66 0a 23 .#endif.#endif.#
4780: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 if defined(__mip
4790: 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 66 69 6e sn32__) || defin
47a0: 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 0a 23 ed(__mips64__).#
47b0: 64 65 66 69 6e 65 20 5f 5f 76 61 5f 72 65 67 5f define __va_reg_
47c0: 73 74 72 75 63 74 5f 72 65 74 75 72 6e 28 4c 49 struct_return(LI
47d0: 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 ST,TYPE_SIZE,TYP
47e0: 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c E_SPLITTABLE) \
47f0: 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 . ((LIST)->flag
4800: 73 20 26 20 5f 5f 56 41 5f 47 43 43 5f 53 54 52 s & __VA_GCC_STR
4810: 55 43 54 5f 52 45 54 55 52 4e 09 09 09 09 5c 0a UCT_RETURN....\.
4820: 20 20 20 3f 20 28 28 54 59 50 45 5f 53 49 5a 45 ? ((TYPE_SIZE
4830: 29 20 3d 3d 20 31 20 7c 7c 20 28 54 59 50 45 5f ) == 1 || (TYPE_
4840: 53 49 5a 45 29 20 3d 3d 20 32 20 7c 7c 20 28 54 SIZE) == 2 || (T
4850: 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 34 20 7c YPE_SIZE) == 4 |
4860: 7c 20 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d | (TYPE_SIZE) ==
4870: 20 38 29 20 5c 0a 20 20 20 3a 20 28 28 54 59 50 8) \. : ((TYP
4880: 45 5f 53 49 5a 45 29 20 3c 3d 20 31 36 29 09 09 E_SIZE) <= 16)..
4890: 09 09 09 09 5c 0a 20 20 29 0a 2f 2a 20 54 75 72 ....\. )./* Tur
48a0: 6e 20 6f 6e 20 5f 5f 56 41 5f 52 45 47 49 53 54 n on __VA_REGIST
48b0: 45 52 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e ER_STRUCT_RETURN
48c0: 20 69 66 20 5f 5f 56 41 5f 53 4d 41 4c 4c 5f 53 if __VA_SMALL_S
48d0: 54 52 55 43 54 5f 52 45 54 55 52 4e 20 77 61 73 TRUCT_RETURN was
48e0: 20 73 65 74 0a 20 2a 20 61 6e 64 20 74 68 65 20 set. * and the
48f0: 73 74 72 75 63 74 20 77 69 6c 6c 20 61 63 74 75 struct will actu
4900: 61 6c 6c 79 20 62 65 20 72 65 74 75 72 6e 65 64 ally be returned
4910: 20 69 6e 20 72 65 67 69 73 74 65 72 73 2e 20 41 in registers. A
4920: 6c 73 6f 20 74 75 72 6e 20 6f 6e 0a 20 2a 20 5f lso turn on. * _
4930: 5f 56 41 5f 52 45 47 49 53 54 45 52 5f 46 4c 4f _VA_REGISTER_FLO
4940: 41 54 53 54 52 55 43 54 5f 52 45 54 55 52 4e 20 ATSTRUCT_RETURN
4950: 6f 72 20 5f 5f 56 41 5f 52 45 47 49 53 54 45 52 or __VA_REGISTER
4960: 5f 44 4f 55 42 4c 45 53 54 52 55 43 54 5f 52 45 _DOUBLESTRUCT_RE
4970: 54 55 52 4e 20 69 66 0a 20 2a 20 74 68 65 20 73 TURN if. * the s
4980: 74 72 75 63 74 20 77 69 6c 6c 20 62 65 20 72 65 truct will be re
4990: 74 75 72 6e 65 64 20 69 6e 20 66 6c 6f 61 74 69 turned in floati
49a0: 6e 67 2d 70 6f 69 6e 74 20 72 65 67 69 73 74 65 ng-point registe
49b0: 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 6e 65 20 rs.. */.#define
49c0: 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 __va_start_struc
49d0: 74 31 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a t1(LIST,TYPE_SIZ
49e0: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c 54 59 50 E,TYPE_ALIGN,TYP
49f0: 45 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c E_SPLITTABLE) \
4a00: 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 . ((LIST)->flag
4a10: 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 49 53 54 s |= __VA_REGIST
4a20: 45 52 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e ER_STRUCT_RETURN
4a30: 2c 09 09 09 09 5c 0a 20 20 20 28 54 59 50 45 5f ,....\. (TYPE_
4a40: 41 4c 49 47 4e 29 20 3d 3d 20 73 69 7a 65 6f 66 ALIGN) == sizeof
4a50: 28 66 6c 6f 61 74 29 20 26 26 20 28 54 59 50 45 (float) && (TYPE
4a60: 5f 53 50 4c 49 54 54 41 42 4c 45 29 09 09 09 09 _SPLITTABLE)....
4a70: 5c 0a 20 20 20 20 26 26 20 28 28 54 59 50 45 5f \. && ((TYPE_
4a80: 53 49 5a 45 29 20 3d 3d 20 73 69 7a 65 6f 66 28 SIZE) == sizeof(
4a90: 66 6c 6f 61 74 29 20 7c 7c 20 28 54 59 50 45 5f float) || (TYPE_
4aa0: 53 49 5a 45 29 20 3d 3d 20 32 2a 73 69 7a 65 6f SIZE) == 2*sizeo
4ab0: 66 28 66 6c 6f 61 74 29 29 09 09 5c 0a 20 20 20 f(float))..\.
4ac0: 20 26 26 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 && ((LIST)->fla
4ad0: 67 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 49 53 gs |= __VA_REGIS
4ae0: 54 45 52 5f 46 4c 4f 41 54 53 54 52 55 43 54 5f TER_FLOATSTRUCT_
4af0: 52 45 54 55 52 4e 29 2c 09 09 09 5c 0a 20 20 20 RETURN),...\.
4b00: 28 54 59 50 45 5f 41 4c 49 47 4e 29 20 3d 3d 20 (TYPE_ALIGN) ==
4b10: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 20 26 sizeof(double) &
4b20: 26 20 28 54 59 50 45 5f 53 50 4c 49 54 54 41 42 & (TYPE_SPLITTAB
4b30: 4c 45 29 09 09 09 09 5c 0a 20 20 20 20 26 26 20 LE)....\. &&
4b40: 28 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d 20 ((TYPE_SIZE) ==
4b50: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 20 7c sizeof(double) |
4b60: 7c 20 28 54 59 50 45 5f 53 49 5a 45 29 20 3d 3d | (TYPE_SIZE) ==
4b70: 20 32 2a 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 2*sizeof(double
4b80: 29 29 09 5c 0a 20 20 20 20 26 26 20 28 28 4c 49 )).\. && ((LI
4b90: 53 54 29 2d 3e 66 6c 61 67 73 20 7c 3d 20 5f 5f ST)->flags |= __
4ba0: 56 41 5f 52 45 47 49 53 54 45 52 5f 44 4f 55 42 VA_REGISTER_DOUB
4bb0: 4c 45 53 54 52 55 43 54 5f 52 45 54 55 52 4e 29 LESTRUCT_RETURN)
4bc0: 2c 09 09 09 5c 0a 20 20 20 30 29 0a 23 65 6e 64 ,...\. 0).#end
4bd0: 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f if.#if defined(_
4be0: 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 0a 23 64 _powerpc64__).#d
4bf0: 65 66 69 6e 65 20 5f 5f 76 61 5f 72 65 67 5f 73 efine __va_reg_s
4c00: 74 72 75 63 74 5f 72 65 74 75 72 6e 28 4c 49 53 truct_return(LIS
4c10: 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 T,TYPE_SIZE,TYPE
4c20: 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a _SPLITTABLE) \.
4c30: 20 20 30 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 0.#define __va
4c40: 5f 73 74 61 72 74 5f 73 74 72 75 63 74 31 28 4c _start_struct1(L
4c50: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
4c60: 50 45 5f 41 4c 49 47 4e 2c 54 59 50 45 5f 53 50 PE_ALIGN,TYPE_SP
4c70: 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 30 LITTABLE) \. 0
4c80: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
4c90: 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 ned(__sparc64__)
4ca0: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 69 61 || defined(__ia
4cb0: 36 34 5f 5f 29 0a 23 64 65 66 69 6e 65 20 5f 5f 64__).#define __
4cc0: 76 61 5f 72 65 67 5f 73 74 72 75 63 74 5f 72 65 va_reg_struct_re
4cd0: 74 75 72 6e 28 4c 49 53 54 2c 54 59 50 45 5f 53 turn(LIST,TYPE_S
4ce0: 49 5a 45 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 IZE,TYPE_SPLITTA
4cf0: 42 4c 45 29 20 20 5c 0a 20 20 28 28 54 59 50 45 BLE) \. ((TYPE
4d00: 5f 53 49 5a 45 29 20 3c 3d 20 33 32 29 0a 2f 2a _SIZE) <= 32)./*
4d10: 20 54 75 72 6e 20 6f 6e 20 5f 5f 56 41 5f 52 45 Turn on __VA_RE
4d20: 47 49 53 54 45 52 5f 53 54 52 55 43 54 5f 52 45 GISTER_STRUCT_RE
4d30: 54 55 52 4e 20 69 66 20 5f 5f 56 41 5f 53 4d 41 TURN if __VA_SMA
4d40: 4c 4c 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e LL_STRUCT_RETURN
4d50: 20 77 61 73 20 73 65 74 0a 20 2a 20 61 6e 64 20 was set. * and
4d60: 74 68 65 20 73 74 72 75 63 74 20 77 69 6c 6c 20 the struct will
4d70: 61 63 74 75 61 6c 6c 79 20 62 65 20 72 65 74 75 actually be retu
4d80: 72 6e 65 64 20 69 6e 20 72 65 67 69 73 74 65 72 rned in register
4d90: 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f s.. */.#define _
4da0: 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 _va_start_struct
4db0: 31 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 1(LIST,TYPE_SIZE
4dc0: 2c 54 59 50 45 5f 41 4c 49 47 4e 2c 54 59 50 45 ,TYPE_ALIGN,TYPE
4dd0: 5f 53 50 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a _SPLITTABLE) \.
4de0: 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 ((LIST)->flags
4df0: 20 7c 3d 20 5f 5f 56 41 5f 52 45 47 49 53 54 45 |= __VA_REGISTE
4e00: 52 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 2c R_STRUCT_RETURN,
4e10: 09 09 09 09 5c 0a 20 20 20 30 29 0a 23 65 6e 64 ....\. 0).#end
4e20: 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f if.#if defined(_
4e30: 5f 78 38 36 5f 36 34 5f 5f 29 0a 23 64 65 66 69 _x86_64__).#defi
4e40: 6e 65 20 5f 5f 76 61 5f 72 65 67 5f 73 74 72 75 ne __va_reg_stru
4e50: 63 74 5f 72 65 74 75 72 6e 28 4c 49 53 54 2c 54 ct_return(LIST,T
4e60: 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 53 50 YPE_SIZE,TYPE_SP
4e70: 4c 49 54 54 41 42 4c 45 29 20 20 5c 0a 20 20 28 LITTABLE) \. (
4e80: 28 54 59 50 45 5f 53 49 5a 45 29 20 3c 3d 20 31 (TYPE_SIZE) <= 1
4e90: 36 29 0a 2f 2a 20 54 75 72 6e 20 6f 6e 20 5f 5f 6)./* Turn on __
4ea0: 56 41 5f 52 45 47 49 53 54 45 52 5f 53 54 52 55 VA_REGISTER_STRU
4eb0: 43 54 5f 52 45 54 55 52 4e 20 69 66 20 5f 5f 56 CT_RETURN if __V
4ec0: 41 5f 53 4d 41 4c 4c 5f 53 54 52 55 43 54 5f 52 A_SMALL_STRUCT_R
4ed0: 45 54 55 52 4e 20 77 61 73 20 73 65 74 0a 20 2a ETURN was set. *
4ee0: 20 61 6e 64 20 74 68 65 20 73 74 72 75 63 74 20 and the struct
4ef0: 77 69 6c 6c 20 61 63 74 75 61 6c 6c 79 20 62 65 will actually be
4f00: 20 72 65 74 75 72 6e 65 64 20 69 6e 20 72 65 67 returned in reg
4f10: 69 73 74 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 isters.. */.#def
4f20: 69 6e 65 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 ine __va_start_s
4f30: 74 72 75 63 74 31 28 4c 49 53 54 2c 54 59 50 45 truct1(LIST,TYPE
4f40: 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e _SIZE,TYPE_ALIGN
4f50: 2c 54 59 50 45 5f 53 50 4c 49 54 54 41 42 4c 45 ,TYPE_SPLITTABLE
4f60: 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e ) \. ((LIST)->
4f70: 66 6c 61 67 73 20 7c 3d 20 5f 5f 56 41 5f 52 45 flags |= __VA_RE
4f80: 47 49 53 54 45 52 5f 53 54 52 55 43 54 5f 52 45 GISTER_STRUCT_RE
4f90: 54 55 52 4e 2c 09 09 09 09 5c 0a 20 20 20 30 29 TURN,....\. 0)
4fa0: 0a 23 65 6e 64 69 66 0a 2f 2a 0a 20 2a 20 50 72 .#endif./*. * Pr
4fb0: 65 70 61 72 69 6e 67 20 73 74 72 75 63 74 75 72 eparing structur
4fc0: 65 20 72 65 74 75 72 6e 20 69 6e 20 6d 65 6d 6f e return in memo
4fd0: 72 79 2e 0a 20 2a 2f 0a 23 69 66 20 64 65 66 69 ry.. */.#if defi
4fe0: 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 0a 2f 2a ned(__i386__)./*
4ff0: 20 52 65 74 75 72 6e 20 73 74 72 75 63 74 75 72 Return structur
5000: 65 20 70 6f 69 6e 74 65 72 20 69 73 20 70 61 73 e pointer is pas
5010: 73 65 64 20 69 6e 20 61 20 73 70 65 63 69 61 6c sed in a special
5020: 20 72 65 67 69 73 74 65 72 20 6f 72 20 61 73 20 register or as
5030: 66 69 72 73 74 20 61 72 67 2e 20 2a 2f 0a 23 64 first arg. */.#d
5040: 65 66 69 6e 65 20 5f 5f 76 61 5f 73 74 61 72 74 efine __va_start
5050: 5f 73 74 72 75 63 74 32 28 4c 49 53 54 29 20 20 _struct2(LIST)
5060: 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 \. ((LIST)->fla
5070: 67 73 20 26 20 5f 5f 56 41 5f 4e 45 58 54 47 43 gs & __VA_NEXTGC
5080: 43 5f 53 54 52 55 43 54 5f 52 45 54 55 52 4e 09 C_STRUCT_RETURN.
5090: 09 09 09 5c 0a 20 20 20 3f 20 28 28 4c 49 53 54 ...\. ? ((LIST
50a0: 29 2d 3e 72 61 64 64 72 20 3d 20 28 4c 49 53 54 )->raddr = (LIST
50b0: 29 2d 3e 73 74 72 75 63 74 72 61 64 64 72 2c 20 )->structraddr,
50c0: 30 29 09 20 2f 2a 20 73 70 65 63 69 61 6c 20 72 0). /* special r
50d0: 65 67 69 73 74 65 72 20 2a 2f 09 5c 0a 20 20 20 egister */.\.
50e0: 3a 20 28 28 4c 49 53 54 29 2d 3e 72 61 64 64 72 : ((LIST)->raddr
50f0: 20 3d 20 2a 28 76 6f 69 64 2a 20 2a 29 28 28 4c = *(void* *)((L
5100: 49 53 54 29 2d 3e 61 70 74 72 29 2c 09 09 2f 2a IST)->aptr),../*
5110: 20 66 69 72 73 74 20 61 72 67 20 2a 2f 09 5c 0a first arg */.\.
5120: 20 20 20 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 (LIST)->ap
5130: 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 76 6f 69 tr += sizeof(voi
5140: 64 2a 29 2c 09 09 09 09 09 5c 0a 20 20 20 20 20 d*),.....\.
5150: 20 30 09 09 09 09 09 09 09 09 09 5c 0a 20 20 29 0.........\. )
5160: 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 ).#endif.#if d
5170: 65 66 69 6e 65 64 28 5f 5f 61 6c 70 68 61 5f 5f efined(__alpha__
5180: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 61 ) || defined(__a
5190: 72 6d 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 rm__) || defined
51a0: 28 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 7c 7c (__powerpc__) ||
51b0: 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 defined(__power
51c0: 70 63 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e pc64__) || defin
51d0: 65 64 28 5f 5f 63 6f 6e 76 65 78 5f 5f 29 20 20 ed(__convex__)
51e0: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 73 33 39 || defined(__s39
51f0: 30 5f 5f 29 0a 2f 2a 20 52 65 74 75 72 6e 20 73 0__)./* Return s
5200: 74 72 75 63 74 75 72 65 20 70 6f 69 6e 74 65 72 tructure pointer
5210: 20 69 73 20 70 61 73 73 65 64 20 61 73 20 66 69 is passed as fi
5220: 72 73 74 20 61 72 67 2e 20 2a 2f 0a 23 64 65 66 rst arg. */.#def
5230: 69 6e 65 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 ine __va_start_s
5240: 74 72 75 63 74 32 28 4c 49 53 54 29 20 20 5c 0a truct2(LIST) \.
5250: 20 20 28 28 4c 49 53 54 29 2d 3e 72 61 64 64 72 ((LIST)->raddr
5260: 20 3d 20 2a 28 76 6f 69 64 2a 20 2a 29 28 28 4c = *(void* *)((L
5270: 49 53 54 29 2d 3e 61 70 74 72 29 2c 09 09 09 09 IST)->aptr),....
5280: 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 \. (LIST)->apt
5290: 72 20 2b 3d 20 73 69 7a 65 6f 66 28 76 6f 69 64 r += sizeof(void
52a0: 2a 29 2c 09 09 09 09 09 5c 0a 20 20 20 30 09 09 *),.....\. 0..
52b0: 09 09 09 09 09 09 09 5c 0a 20 20 29 0a 23 65 6e .......\. ).#en
52c0: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
52d0: 5f 5f 6d 69 70 73 5f 5f 29 20 7c 7c 20 64 65 66 __mips__) || def
52e0: 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f ined(__mipsn32__
52f0: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d ) || defined(__m
5300: 69 70 73 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 ips64__) || defi
5310: 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 ned(__sparc64__)
5320: 0a 2f 2a 20 52 65 74 75 72 6e 20 73 74 72 75 63 ./* Return struc
5330: 74 75 72 65 20 70 6f 69 6e 74 65 72 20 69 73 20 ture pointer is
5340: 70 61 73 73 65 64 20 61 73 20 66 69 72 73 74 20 passed as first
5350: 61 72 67 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 arg. */.#define
5360: 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 __va_start_struc
5370: 74 32 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 28 t2(LIST) \. ((
5380: 4c 49 53 54 29 2d 3e 72 61 64 64 72 20 3d 20 2a LIST)->raddr = *
5390: 28 76 6f 69 64 2a 20 2a 29 28 28 4c 49 53 54 29 (void* *)((LIST)
53a0: 2d 3e 61 70 74 72 29 2c 09 09 09 09 5c 0a 20 20 ->aptr),....\.
53b0: 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d (LIST)->aptr +=
53c0: 20 73 69 7a 65 6f 66 28 76 6f 69 64 2a 29 2c 09 sizeof(void*),.
53d0: 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d ....\. (LIST)-
53e0: 3e 61 6e 75 6d 2b 2b 2c 09 09 09 09 09 09 09 5c >anum++,.......\
53f0: 0a 20 20 20 30 09 09 09 09 09 09 09 09 09 5c 0a . 0.........\.
5400: 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 ).#endif.#if d
5410: 65 66 69 6e 65 64 28 5f 5f 78 38 36 5f 36 34 5f efined(__x86_64_
5420: 5f 29 0a 2f 2a 20 52 65 74 75 72 6e 20 73 74 72 _)./* Return str
5430: 75 63 74 75 72 65 20 70 6f 69 6e 74 65 72 20 69 ucture pointer i
5440: 73 20 70 61 73 73 65 64 20 61 73 20 66 69 72 73 s passed as firs
5450: 74 20 61 72 67 2e 20 2a 2f 0a 23 64 65 66 69 6e t arg. */.#defin
5460: 65 20 5f 5f 76 61 5f 73 74 61 72 74 5f 73 74 72 e __va_start_str
5470: 75 63 74 32 28 4c 49 53 54 29 20 20 5c 0a 20 20 uct2(LIST) \.
5480: 28 28 4c 49 53 54 29 2d 3e 72 61 64 64 72 20 3d ((LIST)->raddr =
5490: 20 28 76 6f 69 64 20 2a 29 28 2a 28 4c 49 53 54 (void *)(*(LIST
54a0: 29 2d 3e 6d 65 6d 69 61 72 67 70 74 72 2b 2b 29 )->memiargptr++)
54b0: 2c 09 09 09 5c 0a 20 20 20 30 09 09 09 09 09 09 ,...\. 0......
54c0: 09 09 09 5c 0a 20 20 29 0a 23 65 6e 64 69 66 0a ...\. ).#endif.
54d0: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d 36 #if defined(__m6
54e0: 38 6b 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e 65 8k__) || (define
54f0: 64 28 5f 5f 73 70 61 72 63 5f 5f 29 20 26 26 20 d(__sparc__) &&
5500: 21 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 !defined(__sparc
5510: 36 34 5f 5f 29 29 20 7c 7c 20 64 65 66 69 6e 65 64__)) || define
5520: 64 28 5f 5f 68 70 70 61 5f 5f 29 20 7c 7c 20 64 d(__hppa__) || d
5530: 65 66 69 6e 65 64 28 5f 5f 6d 38 38 6b 5f 5f 29 efined(__m88k__)
5540: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 69 61 || defined(__ia
5550: 36 34 5f 5f 29 0a 2f 2a 20 52 65 74 75 72 6e 20 64__)./* Return
5560: 73 74 72 75 63 74 75 72 65 20 70 6f 69 6e 74 65 structure pointe
5570: 72 20 69 73 20 70 61 73 73 65 64 20 69 6e 20 61 r is passed in a
5580: 20 73 70 65 63 69 61 6c 20 72 65 67 69 73 74 65 special registe
5590: 72 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f r. */.#define __
55a0: 76 61 5f 73 74 61 72 74 5f 73 74 72 75 63 74 32 va_start_struct2
55b0: 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 28 4c 49 (LIST) \. ((LI
55c0: 53 54 29 2d 3e 72 61 64 64 72 20 3d 20 28 4c 49 ST)->raddr = (LI
55d0: 53 54 29 2d 3e 73 74 72 75 63 74 72 61 64 64 72 ST)->structraddr
55e0: 2c 20 30 29 0a 23 65 6e 64 69 66 0a 0a 0a 2f 2a , 0).#endif.../*
55f0: 0a 20 2a 20 44 65 66 69 6e 69 74 69 6f 6e 20 6f . * Definition o
5600: 66 20 74 68 65 20 76 61 5f 61 72 67 5f 78 78 78 f the va_arg_xxx
5610: 20 6d 61 63 72 6f 73 2e 0a 20 2a 2f 0a 0a 2f 2a macros.. */../*
5620: 20 50 61 64 64 69 6e 67 20 6f 66 20 6e 6f 6e 2d Padding of non-
5630: 73 74 72 75 63 74 20 61 72 67 75 6d 65 6e 74 73 struct arguments
5640: 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 . */.#define __v
5650: 61 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f 53 a_argsize(TYPE_S
5660: 49 5a 45 29 20 20 5c 0a 20 20 28 28 28 54 59 50 IZE) \. (((TYP
5670: 45 5f 53 49 5a 45 29 20 2b 20 73 69 7a 65 6f 66 E_SIZE) + sizeof
5680: 28 5f 5f 76 61 77 6f 72 64 29 2d 31 29 20 26 20 (__vaword)-1) &
5690: 2d 28 6c 6f 6e 67 29 73 69 7a 65 6f 66 28 5f 5f -(long)sizeof(__
56a0: 76 61 77 6f 72 64 29 29 0a 23 69 66 20 64 65 66 vaword)).#if def
56b0: 69 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 7c ined(__i386__) |
56c0: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b | defined(__m68k
56d0: 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 __) || (defined(
56e0: 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 20 21 64 65 __mips__) && !de
56f0: 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 32 5f fined(__mipsn32_
5700: 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f _) && !defined(_
5710: 5f 6d 69 70 73 36 34 5f 5f 29 29 20 7c 7c 20 28 _mips64__)) || (
5720: 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 5f defined(__sparc_
5730: 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f _) && !defined(_
5740: 5f 73 70 61 72 63 36 34 5f 5f 29 29 20 7c 7c 20 _sparc64__)) ||
5750: 64 65 66 69 6e 65 64 28 5f 5f 61 6c 70 68 61 5f defined(__alpha_
5760: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
5770: 61 72 6d 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e arm__) || (defin
5780: 65 64 28 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 ed(__powerpc__)
5790: 26 26 20 21 64 65 66 69 6e 65 64 28 5f 5f 70 6f && !defined(__po
57a0: 77 65 72 70 63 36 34 5f 5f 29 20 26 26 20 28 64 werpc64__) && (d
57b0: 65 66 69 6e 65 64 28 5f 41 49 58 29 20 7c 7c 20 efined(_AIX) ||
57c0: 28 64 65 66 69 6e 65 64 28 5f 5f 4d 41 43 48 5f (defined(__MACH_
57d0: 5f 29 20 26 26 20 64 65 66 69 6e 65 64 28 5f 5f _) && defined(__
57e0: 41 50 50 4c 45 5f 5f 29 29 29 29 20 7c 7c 20 64 APPLE__)))) || d
57f0: 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 70 63 efined(__powerpc
5800: 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 64__) || defined
5810: 28 5f 5f 6d 38 38 6b 5f 5f 29 20 7c 7c 20 64 65 (__m88k__) || de
5820: 66 69 6e 65 64 28 5f 5f 63 6f 6e 76 65 78 5f 5f fined(__convex__
5830: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 69 ) || defined(__i
5840: 61 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 a64__) || define
5850: 64 28 5f 5f 78 38 36 5f 36 34 5f 5f 29 0a 2f 2a d(__x86_64__)./*
5860: 20 61 72 67 73 20 67 72 6f 77 20 75 70 20 2a 2f args grow up */
5870: 0a 2f 2a 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 ./* small struct
5880: 75 72 65 73 20 3c 20 31 20 77 6f 72 64 20 61 72 ures < 1 word ar
5890: 65 20 61 64 6a 75 73 74 65 64 20 64 65 70 65 6e e adjusted depen
58a0: 64 69 6e 67 20 6f 6e 20 63 6f 6d 70 69 6c 65 72 ding on compiler
58b0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
58c0: 5f 61 72 67 5f 6c 65 66 74 61 64 6a 75 73 74 65 _arg_leftadjuste
58d0: 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 d(LIST,TYPE_SIZE
58e0: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a ,TYPE_ALIGN) \.
58f0: 20 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 ((LIST)->aptr
5900: 2b 3d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 += __va_argsize(
5910: 54 59 50 45 5f 53 49 5a 45 29 2c 09 09 09 09 5c TYPE_SIZE),....\
5920: 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 . (LIST)->aptr
5930: 20 2d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 - __va_argsize(
5940: 54 59 50 45 5f 53 49 5a 45 29 09 09 09 09 5c 0a TYPE_SIZE)....\.
5950: 20 20 29 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 ).#define __va
5960: 5f 61 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 _arg_rightadjust
5970: 65 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a ed(LIST,TYPE_SIZ
5980: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c E,TYPE_ALIGN) \
5990: 0a 20 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 . ((LIST)->aptr
59a0: 20 2b 3d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 += __va_argsize
59b0: 28 54 59 50 45 5f 53 49 5a 45 29 2c 09 09 09 09 (TYPE_SIZE),....
59c0: 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 \. (LIST)->apt
59d0: 72 20 2d 20 28 28 54 59 50 45 5f 53 49 5a 45 29 r - ((TYPE_SIZE)
59e0: 20 3c 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f < sizeof(__vawo
59f0: 72 64 29 09 09 09 5c 0a 09 09 20 20 20 3f 20 28 rd)...\... ? (
5a00: 54 59 50 45 5f 53 49 5a 45 29 09 09 09 09 09 5c TYPE_SIZE).....\
5a10: 0a 09 09 20 20 20 3a 20 5f 5f 76 61 5f 61 72 67 ... : __va_arg
5a20: 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 09 size(TYPE_SIZE).
5a30: 09 09 09 5c 0a 09 09 20 20 29 09 09 09 09 09 09 ...\... )......
5a40: 09 5c 0a 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 .\. ).#endif.#i
5a50: 66 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 f defined(__powe
5a60: 72 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e rpc__) && !defin
5a70: 65 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f ed(__powerpc64__
5a80: 29 20 26 26 20 21 28 64 65 66 69 6e 65 64 28 5f ) && !(defined(_
5a90: 41 49 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 AIX) || (defined
5aa0: 28 5f 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 65 (__MACH__) && de
5ab0: 66 69 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f 29 fined(__APPLE__)
5ac0: 29 29 0a 2f 2a 20 61 72 67 73 20 67 72 6f 77 20 ))./* args grow
5ad0: 75 70 20 2a 2f 0a 2f 2a 20 73 6d 61 6c 6c 20 73 up */./* small s
5ae0: 74 72 75 63 74 75 72 65 73 20 3c 20 31 20 77 6f tructures < 1 wo
5af0: 72 64 20 61 72 65 20 61 64 6a 75 73 74 65 64 20 rd are adjusted
5b00: 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 63 6f 6d depending on com
5b10: 70 69 6c 65 72 20 2a 2f 0a 2f 2a 20 41 6c 73 6f piler */./* Also
5b20: 20 6d 61 6b 65 20 73 75 72 65 20 77 65 20 73 77 make sure we sw
5b30: 69 74 63 68 20 74 6f 20 74 68 65 20 73 74 61 63 itch to the stac
5b40: 6b 20 70 6f 69 6e 74 65 72 20 61 66 74 65 72 20 k pointer after
5b50: 38 20 61 72 67 73 20 2a 2f 0a 23 64 65 66 69 6e 8 args */.#defin
5b60: 65 20 5f 5f 76 61 5f 61 72 67 5f 6c 65 66 74 61 e __va_arg_lefta
5b70: 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 djusted(LIST,TYP
5b80: 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 E_SIZE,TYPE_ALIG
5b90: 4e 29 20 20 5c 0a 20 20 28 28 28 28 4c 49 53 54 N) \. ((((LIST
5ba0: 29 2d 3e 6f 6e 73 74 61 63 6b 20 3d 3d 20 30 20 )->onstack == 0
5bb0: 26 26 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 && (LIST)->aptr
5bc0: 3e 3d 20 28 6c 6f 6e 67 29 26 28 4c 49 53 54 29 >= (long)&(LIST)
5bd0: 2d 3e 72 65 67 61 72 67 5b 38 5d 29 09 5c 0a 20 ->regarg[8]).\.
5be0: 20 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e 6f 6e ? ((LIST)->on
5bf0: 73 74 61 63 6b 3d 31 2c 20 28 4c 49 53 54 29 2d stack=1, (LIST)-
5c00: 3e 61 70 74 72 20 3d 20 28 4c 49 53 54 29 2d 3e >aptr = (LIST)->
5c10: 73 61 70 74 72 29 20 3a 20 30 29 2c 09 09 5c 0a saptr) : 0),..\.
5c20: 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 (LIST)->aptr
5c30: 2b 3d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 += __va_argsize(
5c40: 54 59 50 45 5f 53 49 5a 45 29 2c 09 09 09 09 5c TYPE_SIZE),....\
5c50: 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 . (LIST)->aptr
5c60: 20 2d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 - __va_argsize(
5c70: 54 59 50 45 5f 53 49 5a 45 29 09 09 09 09 5c 0a TYPE_SIZE)....\.
5c80: 20 20 29 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 ).#define __va
5c90: 5f 61 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 _arg_rightadjust
5ca0: 65 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a ed(LIST,TYPE_SIZ
5cb0: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c E,TYPE_ALIGN) \
5cc0: 0a 20 20 28 28 28 28 4c 49 53 54 29 2d 3e 6f 6e . ((((LIST)->on
5cd0: 73 74 61 63 6b 20 3d 3d 20 30 20 26 26 20 28 4c stack == 0 && (L
5ce0: 49 53 54 29 2d 3e 61 70 74 72 20 3e 3d 20 28 6c IST)->aptr >= (l
5cf0: 6f 6e 67 29 26 28 4c 49 53 54 29 2d 3e 72 65 67 ong)&(LIST)->reg
5d00: 61 72 67 5b 38 5d 29 09 5c 0a 20 20 20 20 3f 20 arg[8]).\. ?
5d10: 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 63 6b ((LIST)->onstack
5d20: 3d 31 2c 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 =1, (LIST)->aptr
5d30: 20 3d 20 28 4c 49 53 54 29 2d 3e 73 61 70 74 72 = (LIST)->saptr
5d40: 29 20 3a 20 30 29 2c 09 09 5c 0a 20 20 20 28 4c ) : 0),..\. (L
5d50: 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 5f 5f IST)->aptr += __
5d60: 76 61 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f va_argsize(TYPE_
5d70: 53 49 5a 45 29 2c 09 09 09 09 5c 0a 20 20 20 28 SIZE),....\. (
5d80: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 28 28 LIST)->aptr - ((
5d90: 54 59 50 45 5f 53 49 5a 45 29 20 3c 20 73 69 7a TYPE_SIZE) < siz
5da0: 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 09 09 09 eof(__vaword)...
5db0: 5c 0a 09 09 20 20 20 3f 20 28 54 59 50 45 5f 53 \... ? (TYPE_S
5dc0: 49 5a 45 29 09 09 09 09 09 5c 0a 09 09 20 20 20 IZE).....\...
5dd0: 3a 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 54 : __va_argsize(T
5de0: 59 50 45 5f 53 49 5a 45 29 09 09 09 09 5c 0a 09 YPE_SIZE)....\..
5df0: 09 20 20 29 09 09 09 09 09 09 09 5c 0a 20 20 29 . ).......\. )
5e00: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
5e10: 6e 65 64 28 5f 5f 73 33 39 30 5f 5f 29 0a 2f 2a ned(__s390__)./*
5e20: 20 61 72 67 73 20 67 72 6f 77 20 75 70 20 2a 2f args grow up */
5e30: 0a 2f 2a 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 ./* small struct
5e40: 75 72 65 73 20 3c 20 31 20 77 6f 72 64 20 61 72 ures < 1 word ar
5e50: 65 20 61 64 6a 75 73 74 65 64 20 64 65 70 65 6e e adjusted depen
5e60: 64 69 6e 67 20 6f 6e 20 63 6f 6d 70 69 6c 65 72 ding on compiler
5e70: 20 2a 2f 0a 2f 2a 20 41 6c 73 6f 20 6d 61 6b 65 */./* Also make
5e80: 20 73 75 72 65 20 77 65 20 73 77 69 74 63 68 20 sure we switch
5e90: 74 6f 20 74 68 65 20 73 74 61 63 6b 20 70 6f 69 to the stack poi
5ea0: 6e 74 65 72 20 61 66 74 65 72 20 35 20 61 72 67 nter after 5 arg
5eb0: 73 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 s */.#define __v
5ec0: 61 5f 61 72 67 5f 6c 65 66 74 61 64 6a 75 73 74 a_arg_leftadjust
5ed0: 65 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a ed(LIST,TYPE_SIZ
5ee0: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c E,TYPE_ALIGN) \
5ef0: 0a 20 20 28 28 28 28 4c 49 53 54 29 2d 3e 6f 6e . ((((LIST)->on
5f00: 73 74 61 63 6b 20 3d 3d 20 30 20 26 26 20 28 4c stack == 0 && (L
5f10: 49 53 54 29 2d 3e 61 70 74 72 20 3e 3d 20 28 6c IST)->aptr >= (l
5f20: 6f 6e 67 29 26 28 4c 49 53 54 29 2d 3e 72 65 67 ong)&(LIST)->reg
5f30: 61 72 67 5b 35 5d 29 09 5c 0a 20 20 20 20 3f 20 arg[5]).\. ?
5f40: 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 63 6b ((LIST)->onstack
5f50: 3d 31 2c 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 =1, (LIST)->aptr
5f60: 20 3d 20 28 4c 49 53 54 29 2d 3e 73 61 70 74 72 = (LIST)->saptr
5f70: 29 20 3a 20 30 29 2c 09 09 5c 0a 20 20 20 28 4c ) : 0),..\. (L
5f80: 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 5f 5f IST)->aptr += __
5f90: 76 61 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f va_argsize(TYPE_
5fa0: 53 49 5a 45 29 2c 09 09 09 09 5c 0a 20 20 20 28 SIZE),....\. (
5fb0: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 5f 5f LIST)->aptr - __
5fc0: 76 61 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f va_argsize(TYPE_
5fd0: 53 49 5a 45 29 09 09 09 09 5c 0a 20 20 29 0a 23 SIZE)....\. ).#
5fe0: 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 72 67 5f define __va_arg_
5ff0: 72 69 67 68 74 61 64 6a 75 73 74 65 64 28 4c 49 rightadjusted(LI
6000: 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 ST,TYPE_SIZE,TYP
6010: 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 28 E_ALIGN) \. ((
6020: 28 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 63 (((LIST)->onstac
6030: 6b 20 3d 3d 20 30 20 26 26 20 28 28 4c 49 53 54 k == 0 && ((LIST
6040: 29 2d 3e 61 70 74 72 20 3e 3d 20 28 6c 6f 6e 67 )->aptr >= (long
6050: 29 26 28 4c 49 53 54 29 2d 3e 72 65 67 61 72 67 )&(LIST)->regarg
6060: 5b 35 5d 29 29 20 5c 0a 20 20 20 7c 7c 20 28 28 [5])) \. || ((
6070: 54 59 50 45 5f 53 49 5a 45 29 20 3e 20 73 69 7a TYPE_SIZE) > siz
6080: 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 20 26 26 eof(__vaword) &&
6090: 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 3e 3d (LIST)->aptr >=
60a0: 20 28 6c 6f 6e 67 29 26 28 4c 49 53 54 29 2d 3e (long)&(LIST)->
60b0: 72 65 67 61 72 67 5b 34 5d 29 29 20 5c 0a 20 20 regarg[4])) \.
60c0: 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 ? ((LIST)->ons
60d0: 74 61 63 6b 3d 31 2c 20 28 4c 49 53 54 29 2d 3e tack=1, (LIST)->
60e0: 61 70 74 72 20 3d 20 28 4c 49 53 54 29 2d 3e 73 aptr = (LIST)->s
60f0: 61 70 74 72 29 20 3a 20 30 29 2c 09 09 5c 0a 20 aptr) : 0),..\.
6100: 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b (LIST)->aptr +
6110: 3d 20 5f 5f 76 61 5f 61 72 67 73 69 7a 65 28 54 = __va_argsize(T
6120: 59 50 45 5f 53 49 5a 45 29 2c 09 09 09 09 5c 0a YPE_SIZE),....\.
6130: 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 (LIST)->aptr
6140: 2d 20 28 28 54 59 50 45 5f 53 49 5a 45 29 20 3c - ((TYPE_SIZE) <
6150: 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 sizeof(__vaword
6160: 29 09 09 09 5c 0a 09 09 20 20 20 3f 20 28 54 59 )...\... ? (TY
6170: 50 45 5f 53 49 5a 45 29 09 09 09 09 09 5c 0a 09 PE_SIZE).....\..
6180: 09 20 20 20 3a 20 5f 5f 76 61 5f 61 72 67 73 69 . : __va_argsi
6190: 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 09 09 09 ze(TYPE_SIZE)...
61a0: 09 5c 0a 09 09 20 20 29 09 09 09 09 09 09 09 5c .\... ).......\
61b0: 0a 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 . ).#endif.#if
61c0: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 defined(__mipsn3
61d0: 32 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 2__) || defined(
61e0: 5f 5f 6d 69 70 73 36 34 5f 5f 29 20 7c 7c 20 64 __mips64__) || d
61f0: 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 efined(__sparc64
6200: 5f 5f 29 0a 2f 2a 20 61 72 67 73 20 67 72 6f 77 __)./* args grow
6210: 20 75 70 20 2a 2f 0a 2f 2a 20 73 6d 61 6c 6c 20 up */./* small
6220: 73 74 72 75 63 74 75 72 65 73 20 3c 20 31 20 77 structures < 1 w
6230: 6f 72 64 20 61 72 65 20 61 64 6a 75 73 74 65 64 ord are adjusted
6240: 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 63 6f depending on co
6250: 6d 70 69 6c 65 72 20 2a 2f 0a 23 64 65 66 69 6e mpiler */.#defin
6260: 65 20 5f 5f 76 61 5f 61 72 67 5f 6c 65 66 74 61 e __va_arg_lefta
6270: 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 djusted(LIST,TYP
6280: 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 E_SIZE,TYPE_ALIG
6290: 4e 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d N) \. ((LIST)-
62a0: 3e 61 6e 75 6d 20 2b 3d 20 5f 5f 76 61 5f 61 72 >anum += __va_ar
62b0: 67 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 gsize(TYPE_SIZE)
62c0: 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 /sizeof(__vaword
62d0: 29 2c 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d ),..\. (LIST)-
62e0: 3e 61 70 74 72 20 2b 3d 20 5f 5f 76 61 5f 61 72 >aptr += __va_ar
62f0: 67 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 gsize(TYPE_SIZE)
6300: 2c 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 ,....\. (LIST)
6310: 2d 3e 61 70 74 72 20 2d 20 5f 5f 76 61 5f 61 72 ->aptr - __va_ar
6320: 67 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 gsize(TYPE_SIZE)
6330: 09 09 09 09 5c 0a 20 20 29 0a 23 64 65 66 69 6e ....\. ).#defin
6340: 65 20 5f 5f 76 61 5f 61 72 67 5f 72 69 67 68 74 e __va_arg_right
6350: 61 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 adjusted(LIST,TY
6360: 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 PE_SIZE,TYPE_ALI
6370: 47 4e 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 GN) \. ((LIST)
6380: 2d 3e 61 6e 75 6d 20 2b 3d 20 5f 5f 76 61 5f 61 ->anum += __va_a
6390: 72 67 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 rgsize(TYPE_SIZE
63a0: 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 )/sizeof(__vawor
63b0: 64 29 2c 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 d),..\. (LIST)
63c0: 2d 3e 61 70 74 72 20 2b 3d 20 5f 5f 76 61 5f 61 ->aptr += __va_a
63d0: 72 67 73 69 7a 65 28 54 59 50 45 5f 53 49 5a 45 rgsize(TYPE_SIZE
63e0: 29 2c 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 ),....\. (LIST
63f0: 29 2d 3e 61 70 74 72 20 2d 20 28 28 54 59 50 45 )->aptr - ((TYPE
6400: 5f 53 49 5a 45 29 20 3c 20 73 69 7a 65 6f 66 28 _SIZE) < sizeof(
6410: 5f 5f 76 61 77 6f 72 64 29 09 09 09 5c 0a 09 09 __vaword)...\...
6420: 20 20 20 3f 20 28 54 59 50 45 5f 53 49 5a 45 29 ? (TYPE_SIZE)
6430: 09 09 09 09 09 5c 0a 09 09 20 20 20 3a 20 5f 5f .....\... : __
6440: 76 61 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f va_argsize(TYPE_
6450: 53 49 5a 45 29 09 09 09 09 5c 0a 09 09 20 20 29 SIZE)....\... )
6460: 09 09 09 09 09 09 09 5c 0a 20 20 29 0a 23 65 6e .......\. ).#en
6470: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
6480: 5f 5f 68 70 70 61 5f 5f 29 0a 2f 2a 20 61 72 67 __hppa__)./* arg
6490: 73 20 67 72 6f 77 20 64 6f 77 6e 20 2a 2f 0a 23 s grow down */.#
64a0: 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 72 67 5f define __va_arg_
64b0: 6c 65 66 74 61 64 6a 75 73 74 65 64 28 4c 49 53 leftadjusted(LIS
64c0: 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 T,TYPE_SIZE,TYPE
64d0: 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 28 4c _ALIGN) \. ((L
64e0: 49 53 54 29 2d 3e 61 70 74 72 20 3d 20 28 4c 49 IST)->aptr = (LI
64f0: 53 54 29 2d 3e 61 70 74 72 20 2d 20 5f 5f 76 61 ST)->aptr - __va
6500: 5f 61 72 67 73 69 7a 65 28 54 59 50 45 5f 53 49 _argsize(TYPE_SI
6510: 5a 45 29 2c 09 09 5c 0a 20 20 20 28 28 54 59 50 ZE),..\. ((TYP
6520: 45 5f 53 49 5a 45 29 20 3e 20 34 20 26 26 20 28 E_SIZE) > 4 && (
6530: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 26 3d 20 (LIST)->aptr &=
6540: 2d 38 29 29 2c 09 09 09 09 5c 0a 20 20 20 28 4c -8)),....\. (L
6550: 49 53 54 29 2d 3e 61 70 74 72 09 09 09 09 09 09 IST)->aptr......
6560: 09 09 5c 0a 20 20 29 0a 23 64 65 66 69 6e 65 20 ..\. ).#define
6570: 5f 5f 76 61 5f 61 72 67 5f 72 69 67 68 74 61 64 __va_arg_rightad
6580: 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 45 justed(LIST,TYPE
6590: 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e _SIZE,TYPE_ALIGN
65a0: 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e ) \. ((LIST)->
65b0: 61 70 74 72 20 3d 20 28 4c 49 53 54 29 2d 3e 61 aptr = (LIST)->a
65c0: 70 74 72 20 2d 20 5f 5f 76 61 5f 61 72 67 73 69 ptr - __va_argsi
65d0: 7a 65 28 54 59 50 45 5f 53 49 5a 45 29 2c 09 09 ze(TYPE_SIZE),..
65e0: 5c 0a 20 20 20 28 28 54 59 50 45 5f 53 49 5a 45 \. ((TYPE_SIZE
65f0: 29 20 3e 20 34 20 26 26 20 28 28 4c 49 53 54 29 ) > 4 && ((LIST)
6600: 2d 3e 61 70 74 72 20 26 3d 20 2d 38 29 29 2c 09 ->aptr &= -8)),.
6610: 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e ...\. (LIST)->
6620: 61 70 74 72 20 2b 20 28 28 2d 28 54 59 50 45 5f aptr + ((-(TYPE_
6630: 53 49 5a 45 29 29 20 26 20 33 29 09 09 09 09 09 SIZE)) & 3).....
6640: 5c 0a 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 \. ).#endif.#if
6650: 20 64 65 66 69 6e 65 64 28 5f 5f 69 33 38 36 5f defined(__i386_
6660: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
6670: 61 6c 70 68 61 5f 5f 29 20 7c 7c 20 64 65 66 69 alpha__) || defi
6680: 6e 65 64 28 5f 5f 69 61 36 34 5f 5f 29 20 7c 7c ned(__ia64__) ||
6690: 20 64 65 66 69 6e 65 64 28 5f 5f 41 52 4d 45 4c defined(__ARMEL
66a0: 5f 5f 29 0a 2f 2a 20 6c 69 74 74 6c 65 20 65 6e __)./* little en
66b0: 64 69 61 6e 20 2d 3e 20 73 6d 61 6c 6c 20 61 72 dian -> small ar
66c0: 67 73 20 3c 20 31 20 77 6f 72 64 20 61 72 65 20 gs < 1 word are
66d0: 61 64 6a 75 73 74 65 64 20 74 6f 20 74 68 65 20 adjusted to the
66e0: 6c 65 66 74 20 2a 2f 0a 23 64 65 66 69 6e 65 20 left */.#define
66f0: 5f 5f 76 61 5f 61 72 67 5f 61 64 6a 75 73 74 65 __va_arg_adjuste
6700: 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 d(LIST,TYPE_SIZE
6710: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a ,TYPE_ALIGN) \.
6720: 20 20 5f 5f 76 61 5f 61 72 67 5f 6c 65 66 74 61 __va_arg_lefta
6730: 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 djusted(LIST,TYP
6740: 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 E_SIZE,TYPE_ALIG
6750: 4e 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 N).#endif.#if de
6760: 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f 29 20 fined(__m68k__)
6770: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 || defined(__mip
6780: 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 66 69 6e sn32__) || defin
6790: 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 20 7c ed(__mips64__) |
67a0: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 | defined(__spar
67b0: 63 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 c__) || defined(
67c0: 5f 5f 73 70 61 72 63 36 34 5f 5f 29 20 7c 7c 20 __sparc64__) ||
67d0: 64 65 66 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f defined(__hppa__
67e0: 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f ) || (defined(__
67f0: 61 72 6d 5f 5f 29 20 26 26 20 21 64 65 66 69 6e arm__) && !defin
6800: 65 64 28 5f 5f 41 52 4d 45 4c 5f 5f 29 29 20 7c ed(__ARMEL__)) |
6810: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 | defined(__powe
6820: 72 70 63 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 rpc__) || define
6830: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
6840: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 38 || defined(__m8
6850: 38 6b 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 8k__) || defined
6860: 28 5f 5f 63 6f 6e 76 65 78 5f 5f 29 20 7c 7c 20 (__convex__) ||
6870: 64 65 66 69 6e 65 64 28 5f 5f 73 33 39 30 5f 5f defined(__s390__
6880: 29 0a 2f 2a 20 62 69 67 20 65 6e 64 69 61 6e 20 )./* big endian
6890: 2d 3e 20 73 6d 61 6c 6c 20 61 72 67 73 20 3c 20 -> small args <
68a0: 31 20 77 6f 72 64 20 61 72 65 20 61 64 6a 75 73 1 word are adjus
68b0: 74 65 64 20 74 6f 20 74 68 65 20 72 69 67 68 74 ted to the right
68c0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
68d0: 5f 61 72 67 5f 61 64 6a 75 73 74 65 64 28 4c 49 _arg_adjusted(LI
68e0: 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 ST,TYPE_SIZE,TYP
68f0: 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 5f 5f E_ALIGN) \. __
6900: 76 61 5f 61 72 67 5f 72 69 67 68 74 61 64 6a 75 va_arg_rightadju
6910: 73 74 65 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 sted(LIST,TYPE_S
6920: 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 0a IZE,TYPE_ALIGN).
6930: 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e #endif.#if defin
6940: 65 64 28 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 20 ed(__mips__) &&
6950: 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e !defined(__mipsn
6960: 33 32 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 32__) && !define
6970: 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 0a 2f 2a d(__mips64__)./*
6980: 20 62 69 67 20 65 6e 64 69 61 6e 20 2d 3e 20 73 big endian -> s
6990: 6d 61 6c 6c 20 61 72 67 73 20 3c 20 31 20 77 6f mall args < 1 wo
69a0: 72 64 20 61 72 65 20 61 64 6a 75 73 74 65 64 20 rd are adjusted
69b0: 74 6f 20 74 68 65 20 72 69 67 68 74 20 2a 2f 0a to the right */.
69c0: 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 72 67 #define __va_arg
69d0: 5f 61 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 _adjusted(LIST,T
69e0: 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c YPE_SIZE,TYPE_AL
69f0: 49 47 4e 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 IGN) \. ((LIST
6a00: 29 2d 3e 61 6e 75 6d 2b 2b 2c 20 5f 5f 76 61 5f )->anum++, __va_
6a10: 61 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 65 arg_rightadjuste
6a20: 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 d(LIST,TYPE_SIZE
6a30: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 29 0a 23 65 ,TYPE_ALIGN)).#e
6a40: 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 ndif.#if defined
6a50: 28 5f 5f 78 38 36 5f 36 34 5f 5f 29 0a 2f 2a 20 (__x86_64__)./*
6a60: 74 68 65 20 66 69 72 73 74 20 36 20 61 72 67 75 the first 6 argu
6a70: 6d 65 6e 74 20 77 6f 72 64 73 20 61 72 65 20 70 ment words are p
6a80: 61 73 73 65 64 20 69 6e 20 72 65 67 69 73 74 65 assed in registe
6a90: 72 73 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f rs */.#define __
6aa0: 76 61 5f 61 72 67 5f 61 64 6a 75 73 74 65 64 28 va_arg_adjusted(
6ab0: 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 LIST,TYPE_SIZE,T
6ac0: 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 YPE_ALIGN) \.
6ad0: 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 69 61 72 67 ((LIST)->memiarg
6ae0: 70 74 72 20 2b 20 28 28 54 59 50 45 5f 53 49 5a ptr + ((TYPE_SIZ
6af0: 45 29 20 2b 20 73 69 7a 65 6f 66 28 5f 5f 76 61 E) + sizeof(__va
6b00: 77 6f 72 64 29 2d 31 29 20 2f 20 73 69 7a 65 6f word)-1) / sizeo
6b10: 66 28 5f 5f 76 61 77 6f 72 64 29 20 3c 3d 20 26 f(__vaword) <= &
6b20: 28 4c 49 53 54 29 2d 3e 69 61 72 67 5b 36 5d 20 (LIST)->iarg[6]
6b30: 5c 0a 20 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e \. ? ((LIST)->
6b40: 6d 65 6d 69 61 72 67 70 74 72 20 2b 3d 20 28 28 memiargptr += ((
6b50: 54 59 50 45 5f 53 49 5a 45 29 20 2b 20 73 69 7a TYPE_SIZE) + siz
6b60: 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 2d 31 29 eof(__vaword)-1)
6b70: 20 2f 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f / sizeof(__vawo
6b80: 72 64 29 2c 20 5c 0a 20 20 20 20 20 20 28 4c 49 rd), \. (LI
6b90: 53 54 29 2d 3e 6d 65 6d 69 61 72 67 70 74 72 20 ST)->memiargptr
6ba0: 2d 20 28 28 54 59 50 45 5f 53 49 5a 45 29 20 2b - ((TYPE_SIZE) +
6bb0: 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 sizeof(__vaword
6bc0: 29 2d 31 29 20 2f 20 73 69 7a 65 6f 66 28 5f 5f )-1) / sizeof(__
6bd0: 76 61 77 6f 72 64 29 20 5c 0a 20 20 20 20 20 29 vaword) \. )
6be0: 09 09 09 09 09 09 09 09 09 5c 0a 20 20 20 3a 20 .........\. :
6bf0: 28 76 6f 69 64 2a 29 5f 5f 76 61 5f 61 72 67 5f (void*)__va_arg_
6c00: 6c 65 66 74 61 64 6a 75 73 74 65 64 28 4c 49 53 leftadjusted(LIS
6c10: 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 T,TYPE_SIZE,TYPE
6c20: 5f 41 4c 49 47 4e 29 09 09 5c 0a 20 20 29 0a 23 _ALIGN)..\. ).#
6c30: 65 6e 64 69 66 0a 23 64 65 66 69 6e 65 20 5f 5f endif.#define __
6c40: 76 61 5f 61 72 67 28 4c 49 53 54 2c 54 59 50 45 va_arg(LIST,TYPE
6c50: 29 20 20 5c 0a 20 20 2a 28 54 59 50 45 2a 29 5f ) \. *(TYPE*)_
6c60: 5f 76 61 5f 61 72 67 5f 61 64 6a 75 73 74 65 64 _va_arg_adjusted
6c70: 28 4c 49 53 54 2c 73 69 7a 65 6f 66 28 54 59 50 (LIST,sizeof(TYP
6c80: 45 29 2c 5f 5f 56 41 5f 61 6c 69 67 6e 6f 66 28 E),__VA_alignof(
6c90: 54 59 50 45 29 29 0a 0a 2f 2a 20 49 6e 74 65 67 TYPE))../* Integ
6ca0: 65 72 20 61 72 67 75 6d 65 6e 74 73 2e 20 2a 2f er arguments. */
6cb0: 0a 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 72 67 ..#define va_arg
6cc0: 5f 63 68 61 72 28 4c 49 53 54 29 09 5f 5f 76 61 _char(LIST).__va
6cd0: 5f 61 72 67 28 4c 49 53 54 2c 63 68 61 72 29 0a _arg(LIST,char).
6ce0: 23 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 73 #define va_arg_s
6cf0: 63 68 61 72 28 4c 49 53 54 29 09 5f 5f 76 61 5f char(LIST).__va_
6d00: 61 72 67 28 4c 49 53 54 2c 73 69 67 6e 65 64 20 arg(LIST,signed
6d10: 63 68 61 72 29 0a 23 64 65 66 69 6e 65 20 76 61 char).#define va
6d20: 5f 61 72 67 5f 75 63 68 61 72 28 4c 49 53 54 29 _arg_uchar(LIST)
6d30: 09 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 2c 75 .__va_arg(LIST,u
6d40: 6e 73 69 67 6e 65 64 20 63 68 61 72 29 0a 23 64 nsigned char).#d
6d50: 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 73 68 6f efine va_arg_sho
6d60: 72 74 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 72 rt(LIST).__va_ar
6d70: 67 28 4c 49 53 54 2c 73 68 6f 72 74 29 0a 23 64 g(LIST,short).#d
6d80: 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 75 73 68 efine va_arg_ush
6d90: 6f 72 74 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 ort(LIST).__va_a
6da0: 72 67 28 4c 49 53 54 2c 75 6e 73 69 67 6e 65 64 rg(LIST,unsigned
6db0: 20 73 68 6f 72 74 29 0a 23 64 65 66 69 6e 65 20 short).#define
6dc0: 76 61 5f 61 72 67 5f 69 6e 74 28 4c 49 53 54 29 va_arg_int(LIST)
6dd0: 09 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 2c 69 .__va_arg(LIST,i
6de0: 6e 74 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 nt).#define va_a
6df0: 72 67 5f 75 69 6e 74 28 4c 49 53 54 29 09 5f 5f rg_uint(LIST).__
6e00: 76 61 5f 61 72 67 28 4c 49 53 54 2c 75 6e 73 69 va_arg(LIST,unsi
6e10: 67 6e 65 64 20 69 6e 74 29 0a 23 64 65 66 69 6e gned int).#defin
6e20: 65 20 76 61 5f 61 72 67 5f 6c 6f 6e 67 28 4c 49 e va_arg_long(LI
6e30: 53 54 29 09 5f 5f 76 61 5f 61 72 67 28 4c 49 53 ST).__va_arg(LIS
6e40: 54 2c 6c 6f 6e 67 29 0a 23 64 65 66 69 6e 65 20 T,long).#define
6e50: 76 61 5f 61 72 67 5f 75 6c 6f 6e 67 28 4c 49 53 va_arg_ulong(LIS
6e60: 54 29 09 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 T).__va_arg(LIST
6e70: 2c 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 29 0a ,unsigned long).
6e80: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 6d .#if defined(__m
6e90: 69 70 73 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 ips64__) || defi
6ea0: 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 ned(__sparc64__)
6eb0: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 61 6c || defined(__al
6ec0: 70 68 61 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 pha__) || define
6ed0: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
6ee0: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 69 61 || defined(__ia
6ef0: 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 64__) || defined
6f00: 28 5f 5f 78 38 36 5f 36 34 5f 5f 29 0a 2f 2a 20 (__x86_64__)./*
6f10: 60 6c 6f 6e 67 20 6c 6f 6e 67 27 20 61 6e 64 20 `long long' and
6f20: 60 6c 6f 6e 67 27 20 61 72 65 20 69 64 65 6e 74 `long' are ident
6f30: 69 63 61 6c 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 ical. */.#define
6f40: 20 76 61 5f 61 72 67 5f 6c 6f 6e 67 6c 6f 6e 67 va_arg_longlong
6f50: 09 09 76 61 5f 61 72 67 5f 6c 6f 6e 67 0a 23 64 ..va_arg_long.#d
6f60: 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 75 6c 6f efine va_arg_ulo
6f70: 6e 67 6c 6f 6e 67 09 76 61 5f 61 72 67 5f 75 6c nglong.va_arg_ul
6f80: 6f 6e 67 0a 23 65 6c 69 66 20 64 65 66 69 6e 65 ong.#elif define
6f90: 64 28 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 0a 2f d(__mipsn32__)./
6fa0: 2a 20 60 6c 6f 6e 67 20 6c 6f 6e 67 27 20 66 69 * `long long' fi
6fb0: 74 73 20 69 6e 20 5f 5f 76 61 77 6f 72 64 2e 20 ts in __vaword.
6fc0: 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 72 */.#define va_ar
6fd0: 67 5f 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 29 g_longlong(LIST)
6fe0: 09 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 2c 6c .__va_arg(LIST,l
6ff0: 6f 6e 67 20 6c 6f 6e 67 29 0a 23 64 65 66 69 6e ong long).#defin
7000: 65 20 76 61 5f 61 72 67 5f 75 6c 6f 6e 67 6c 6f e va_arg_ulonglo
7010: 6e 67 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 72 ng(LIST).__va_ar
7020: 67 28 4c 49 53 54 2c 75 6e 73 69 67 6e 65 64 20 g(LIST,unsigned
7030: 6c 6f 6e 67 20 6c 6f 6e 67 29 0a 23 65 6c 69 66 long long).#elif
7040: 20 64 65 66 69 6e 65 64 28 5f 5f 69 33 38 36 5f defined(__i386_
7050: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
7060: 6d 36 38 6b 5f 5f 29 20 7c 7c 20 64 65 66 69 6e m68k__) || defin
7070: 65 64 28 5f 5f 6d 69 70 73 5f 5f 29 20 7c 7c 20 ed(__mips__) ||
7080: 28 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 (defined(__sparc
7090: 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 __) && !defined(
70a0: 5f 5f 73 70 61 72 63 36 34 5f 5f 29 29 20 7c 7c __sparc64__)) ||
70b0: 20 64 65 66 69 6e 65 64 28 5f 5f 68 70 70 61 5f defined(__hppa_
70c0: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
70d0: 61 72 6d 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 arm__) || define
70e0: 64 28 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 7c d(__powerpc__) |
70f0: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 38 38 6b | defined(__m88k
7100: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
7110: 5f 63 6f 6e 76 65 78 5f 5f 29 20 7c 7c 20 64 65 _convex__) || de
7120: 66 69 6e 65 64 28 5f 5f 73 33 39 30 5f 5f 29 0a fined(__s390__).
7130: 2f 2a 20 60 6c 6f 6e 67 20 6c 6f 6e 67 27 73 20 /* `long long's
7140: 61 72 65 20 70 61 73 73 65 64 20 65 6d 62 65 64 are passed embed
7150: 64 65 64 20 6f 6e 20 74 68 65 20 61 72 67 20 73 ded on the arg s
7160: 74 61 63 6b 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 tack. */.#define
7170: 20 76 61 5f 61 72 67 5f 6c 6f 6e 67 6c 6f 6e 67 va_arg_longlong
7180: 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 72 67 5f (LIST).__va_arg_
7190: 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 2c 6c 6f longlong(LIST,lo
71a0: 6e 67 20 6c 6f 6e 67 29 0a 23 64 65 66 69 6e 65 ng long).#define
71b0: 20 76 61 5f 61 72 67 5f 75 6c 6f 6e 67 6c 6f 6e va_arg_ulonglon
71c0: 67 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 72 67 g(LIST).__va_arg
71d0: 5f 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 2c 75 _longlong(LIST,u
71e0: 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e nsigned long lon
71f0: 67 29 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f g).#if defined(_
7200: 5f 69 33 38 36 5f 5f 29 20 7c 7c 20 64 65 66 69 _i386__) || defi
7210: 6e 65 64 28 5f 5f 6d 36 38 6b 5f 5f 29 20 7c 7c ned(__m68k__) ||
7220: 20 28 64 65 66 69 6e 65 64 28 5f 5f 61 72 6d 5f (defined(__arm_
7230: 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f _) && !defined(_
7240: 5f 41 52 4d 45 4c 5f 5f 29 29 20 7c 7c 20 28 64 _ARMEL__)) || (d
7250: 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 70 63 efined(__powerpc
7260: 5f 5f 29 20 26 26 20 28 64 65 66 69 6e 65 64 28 __) && (defined(
7270: 5f 41 49 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 _AIX) || (define
7280: 64 28 5f 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 d(__MACH__) && d
7290: 65 66 69 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f efined(__APPLE__
72a0: 29 29 29 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 )))) || defined(
72b0: 5f 5f 63 6f 6e 76 65 78 5f 5f 29 0a 2f 2a 20 60 __convex__)./* `
72c0: 6c 6f 6e 67 20 6c 6f 6e 67 27 73 20 61 72 65 20 long long's are
72d0: 28 61 74 20 6d 6f 73 74 29 20 77 6f 72 64 2d 61 (at most) word-a
72e0: 6c 69 67 6e 65 64 2e 20 2a 2f 0a 23 64 65 66 69 ligned. */.#defi
72f0: 6e 65 20 5f 5f 76 61 5f 61 72 67 5f 6c 6f 6e 67 ne __va_arg_long
7300: 6c 6f 6e 67 28 4c 49 53 54 2c 54 59 50 45 29 09 long(LIST,TYPE).
7310: 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 2c 54 59 __va_arg(LIST,TY
7320: 50 45 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 PE).#endif.#if d
7330: 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 5f 5f 29 efined(__mips__)
7340: 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f 5f 70 || (defined(__p
7350: 6f 77 65 72 70 63 5f 5f 29 20 26 26 20 21 28 64 owerpc__) && !(d
7360: 65 66 69 6e 65 64 28 5f 41 49 58 29 20 7c 7c 20 efined(_AIX) ||
7370: 28 64 65 66 69 6e 65 64 28 5f 5f 4d 41 43 48 5f (defined(__MACH_
7380: 5f 29 20 26 26 20 64 65 66 69 6e 65 64 28 5f 5f _) && defined(__
7390: 41 50 50 4c 45 5f 5f 29 29 29 29 20 7c 7c 20 64 APPLE__)))) || d
73a0: 65 66 69 6e 65 64 28 5f 5f 6d 38 38 6b 5f 5f 29 efined(__m88k__)
73b0: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 41 52 || defined(__AR
73c0: 4d 45 4c 5f 5f 29 0a 2f 2a 20 60 6c 6f 6e 67 20 MEL__)./* `long
73d0: 6c 6f 6e 67 27 73 20 68 61 76 65 20 61 6c 69 67 long's have alig
73e0: 6e 6d 65 6e 74 20 38 2e 20 2a 2f 0a 23 64 65 66 nment 8. */.#def
73f0: 69 6e 65 20 5f 5f 76 61 5f 61 72 67 5f 6c 6f 6e ine __va_arg_lon
7400: 67 6c 6f 6e 67 28 4c 49 53 54 2c 54 59 50 45 29 glong(LIST,TYPE)
7410: 09 09 09 09 09 5c 0a 20 20 28 28 4c 49 53 54 29 .....\. ((LIST)
7420: 2d 3e 61 70 74 72 20 3d 20 28 28 28 4c 49 53 54 ->aptr = (((LIST
7430: 29 2d 3e 61 70 74 72 2b 5f 5f 56 41 5f 61 6c 69 )->aptr+__VA_ali
7440: 67 6e 6f 66 28 54 59 50 45 29 2d 31 29 20 26 20 gnof(TYPE)-1) &
7450: 2d 28 6c 6f 6e 67 29 5f 5f 56 41 5f 61 6c 69 67 -(long)__VA_alig
7460: 6e 6f 66 28 54 59 50 45 29 29 2c 20 5c 0a 20 20 nof(TYPE)), \.
7470: 20 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 2c 54 __va_arg(LIST,T
7480: 59 50 45 29 29 0a 23 65 6e 64 69 66 0a 23 69 66 YPE)).#endif.#if
7490: 20 28 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 (defined(__spar
74a0: 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 c__) && !defined
74b0: 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 29 20 7c (__sparc64__)) |
74c0: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 73 33 39 30 | defined(__s390
74d0: 5f 5f 29 0a 2f 2a 20 57 69 74 68 69 6e 20 74 68 __)./* Within th
74e0: 65 20 61 72 67 20 73 74 61 63 6b 2c 20 74 68 65 e arg stack, the
74f0: 20 61 6c 69 67 6e 6d 65 6e 74 20 69 73 20 6f 6e alignment is on
7500: 6c 79 20 34 2c 20 6e 6f 74 20 38 2e 20 2a 2f 0a ly 4, not 8. */.
7510: 2f 2a 20 42 65 77 61 72 65 20 61 67 61 69 6e 73 /* Beware agains
7520: 74 20 75 6e 61 6c 69 67 6e 65 64 20 61 63 63 65 t unaligned acce
7530: 73 73 65 73 21 20 2a 2f 0a 23 64 65 66 69 6e 65 sses! */.#define
7540: 20 5f 5f 76 61 5f 61 72 67 5f 6c 6f 6e 67 6c 6f __va_arg_longlo
7550: 6e 67 28 4c 49 53 54 2c 54 59 50 45 29 09 09 09 ng(LIST,TYPE)...
7560: 09 09 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 74 ..\. ((LIST)->t
7570: 6d 70 2e 5f 77 6f 72 64 73 5b 30 5d 20 3d 20 28 mp._words[0] = (
7580: 28 5f 5f 76 61 77 6f 72 64 2a 29 28 28 4c 49 53 (__vaword*)((LIS
7590: 54 29 2d 3e 61 70 74 72 29 29 5b 30 5d 2c 09 09 T)->aptr))[0],..
75a0: 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e 74 6d 70 \. (LIST)->tmp
75b0: 2e 5f 77 6f 72 64 73 5b 31 5d 20 3d 20 28 28 5f ._words[1] = ((_
75c0: 5f 76 61 77 6f 72 64 2a 29 28 28 4c 49 53 54 29 _vaword*)((LIST)
75d0: 2d 3e 61 70 74 72 29 29 5b 31 5d 2c 09 09 5c 0a ->aptr))[1],..\.
75e0: 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 (LIST)->aptr
75f0: 2b 3d 20 73 69 7a 65 6f 66 28 54 59 50 45 29 2c += sizeof(TYPE),
7600: 09 09 09 09 09 5c 0a 20 20 20 28 54 59 50 45 29 .....\. (TYPE)
7610: 28 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 6c 6f ((LIST)->tmp._lo
7620: 6e 67 6c 6f 6e 67 29 09 09 09 09 09 5c 0a 20 20 nglong).....\.
7630: 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 ).#endif.#if def
7640: 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f 29 0a 2f ined(__hppa__)./
7650: 2a 20 60 6c 6f 6e 67 20 6c 6f 6e 67 27 73 20 68 * `long long's h
7660: 61 76 65 20 61 6c 69 67 6e 6d 65 6e 74 20 38 2e ave alignment 8.
7670: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
7680: 5f 61 72 67 5f 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 _arg_longlong(LI
7690: 53 54 2c 54 59 50 45 29 09 09 09 09 09 5c 0a 20 ST,TYPE).....\.
76a0: 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 3d ((LIST)->aptr =
76b0: 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 26 ((LIST)->aptr &
76c0: 20 2d 28 6c 6f 6e 67 29 5f 5f 56 41 5f 61 6c 69 -(long)__VA_ali
76d0: 67 6e 6f 66 28 54 59 50 45 29 29 2c 09 09 5c 0a gnof(TYPE)),..\.
76e0: 20 20 20 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 __va_arg(LIST
76f0: 2c 54 59 50 45 29 29 0a 23 65 6e 64 69 66 0a 23 ,TYPE)).#endif.#
7700: 65 6e 64 69 66 0a 0a 2f 2a 20 46 6c 6f 61 74 69 endif../* Floati
7710: 6e 67 20 70 6f 69 6e 74 20 61 72 67 75 6d 65 6e ng point argumen
7720: 74 73 2e 20 2a 2f 0a 0a 23 69 66 20 64 65 66 69 ts. */..#if defi
7730: 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 7c 7c ned(__i386__) ||
7740: 20 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b 5f defined(__m68k_
7750: 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f _) || defined(__
7760: 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 64 65 mipsn32__) || de
7770: 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f fined(__mips64__
7780: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 73 ) || defined(__s
7790: 70 61 72 63 5f 5f 29 20 7c 7c 20 64 65 66 69 6e parc__) || defin
77a0: 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f 29 20 ed(__sparc64__)
77b0: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 61 6c 70 || defined(__alp
77c0: 68 61 5f 5f 29 20 7c 7c 20 28 64 65 66 69 6e 65 ha__) || (define
77d0: 64 28 5f 5f 61 72 6d 5f 5f 29 20 26 26 20 21 64 d(__arm__) && !d
77e0: 65 66 69 6e 65 64 28 5f 5f 41 52 4d 45 4c 5f 5f efined(__ARMEL__
77f0: 29 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f )) || defined(__
7800: 70 6f 77 65 72 70 63 5f 5f 29 20 7c 7c 20 64 65 powerpc__) || de
7810: 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 70 63 36 fined(__powerpc6
7820: 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 4__) || defined(
7830: 5f 5f 63 6f 6e 76 65 78 5f 5f 29 20 7c 7c 20 64 __convex__) || d
7840: 65 66 69 6e 65 64 28 5f 5f 69 61 36 34 5f 5f 29 efined(__ia64__)
7850: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 78 38 || defined(__x8
7860: 36 5f 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 6_64__) || defin
7870: 65 64 28 5f 5f 73 33 39 30 5f 5f 29 0a 23 64 65 ed(__s390__).#de
7880: 66 69 6e 65 20 5f 5f 76 61 5f 61 6c 69 67 6e 5f fine __va_align_
7890: 64 6f 75 62 6c 65 28 4c 49 53 54 29 0a 23 65 6e double(LIST).#en
78a0: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
78b0: 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 20 21 64 65 __mips__) && !de
78c0: 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 32 5f fined(__mipsn32_
78d0: 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 28 5f _) && !defined(_
78e0: 5f 6d 69 70 73 36 34 5f 5f 29 20 7c 7c 20 64 65 _mips64__) || de
78f0: 66 69 6e 65 64 28 5f 5f 6d 38 38 6b 5f 5f 29 20 fined(__m88k__)
7900: 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 41 52 4d || defined(__ARM
7910: 45 4c 5f 5f 29 0a 2f 2a 20 5f 5f 56 41 5f 61 6c EL__)./* __VA_al
7920: 69 67 6e 6f 66 28 64 6f 75 62 6c 65 29 20 3e 20 ignof(double) >
7930: 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 sizeof(__vaword)
7940: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
7950: 5f 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 _align_double(LI
7960: 53 54 29 20 20 5c 0a 20 20 28 4c 49 53 54 29 2d ST) \. (LIST)-
7970: 3e 61 70 74 72 20 3d 20 28 28 4c 49 53 54 29 2d >aptr = ((LIST)-
7980: 3e 61 70 74 72 20 2b 20 73 69 7a 65 6f 66 28 64 >aptr + sizeof(d
7990: 6f 75 62 6c 65 29 2d 31 29 20 26 20 2d 28 6c 6f ouble)-1) & -(lo
79a0: 6e 67 29 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 ng)sizeof(double
79b0: 29 2c 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 ),.#endif.#if de
79c0: 66 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f 29 0a fined(__hppa__).
79d0: 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 6c 69 #define __va_ali
79e0: 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 20 gn_double(LIST)
79f0: 20 5c 0a 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 \. (LIST)->apt
7a00: 72 20 3d 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 r = (LIST)->aptr
7a10: 20 26 20 2d 28 6c 6f 6e 67 29 73 69 7a 65 6f 66 & -(long)sizeof
7a20: 28 64 6f 75 62 6c 65 29 2c 0a 23 65 6e 64 69 66 (double),.#endif
7a30: 0a 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f ..#if defined(__
7a40: 73 70 61 72 63 5f 5f 29 20 26 26 20 21 64 65 66 sparc__) && !def
7a50: 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 5f 5f ined(__sparc64__
7a60: 29 0a 2f 2a 20 42 65 77 61 72 65 20 61 67 61 69 )./* Beware agai
7a70: 6e 73 74 20 75 6e 61 6c 69 67 6e 65 64 20 60 64 nst unaligned `d
7a80: 6f 75 62 6c 65 27 20 61 63 63 65 73 73 65 73 21 ouble' accesses!
7a90: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 */.#define va_a
7aa0: 72 67 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 20 rg_double(LIST)
7ab0: 20 5c 0a 20 20 28 5f 5f 76 61 5f 61 6c 69 67 6e \. (__va_align
7ac0: 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 09 09 09 _double(LIST)...
7ad0: 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e ...\. (LIST)->
7ae0: 74 6d 70 2e 5f 77 6f 72 64 73 5b 30 5d 20 3d 20 tmp._words[0] =
7af0: 28 28 5f 5f 76 61 77 6f 72 64 2a 29 28 28 4c 49 ((__vaword*)((LI
7b00: 53 54 29 2d 3e 61 70 74 72 29 29 5b 30 5d 2c 09 ST)->aptr))[0],.
7b10: 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e 74 6d .\. (LIST)->tm
7b20: 70 2e 5f 77 6f 72 64 73 5b 31 5d 20 3d 20 28 28 p._words[1] = ((
7b30: 5f 5f 76 61 77 6f 72 64 2a 29 28 28 4c 49 53 54 __vaword*)((LIST
7b40: 29 2d 3e 61 70 74 72 29 29 5b 31 5d 2c 09 09 5c )->aptr))[1],..\
7b50: 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 . (LIST)->aptr
7b60: 20 2b 3d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c += sizeof(doubl
7b70: 65 29 2c 09 09 09 09 09 5c 0a 20 20 20 28 4c 49 e),.....\. (LI
7b80: 53 54 29 2d 3e 74 6d 70 2e 5f 64 6f 75 62 6c 65 ST)->tmp._double
7b90: 09 09 09 09 09 09 09 5c 0a 20 20 29 0a 23 65 6e .......\. ).#en
7ba0: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
7bb0: 5f 5f 61 6c 70 68 61 5f 5f 29 0a 2f 2a 20 54 68 __alpha__)./* Th
7bc0: 65 20 66 69 72 73 74 20 36 20 66 6c 6f 61 74 69 e first 6 floati
7bd0: 6e 67 20 70 6f 69 6e 74 20 72 65 67 69 73 74 65 ng point registe
7be0: 72 73 20 68 61 76 65 20 62 65 65 6e 20 73 74 6f rs have been sto
7bf0: 72 65 64 20 69 6e 20 61 6e 6f 74 68 65 72 20 70 red in another p
7c00: 6c 61 63 65 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 lace. */.#define
7c10: 20 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c va_arg_double(L
7c20: 49 53 54 29 20 20 5c 0a 20 20 28 28 28 4c 49 53 IST) \. (((LIS
7c30: 54 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 T)->aptr += size
7c40: 6f 66 28 64 6f 75 62 6c 65 29 29 20 3c 3d 20 28 of(double)) <= (
7c50: 4c 49 53 54 29 2d 3e 6d 65 6d 61 72 67 70 74 72 LIST)->memargptr
7c60: 09 09 5c 0a 20 20 20 3f 20 2a 28 64 6f 75 62 6c ..\. ? *(doubl
7c70: 65 2a 29 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 e*)((LIST)->aptr
7c80: 20 2d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 - sizeof(double
7c90: 29 20 2d 20 36 2a 73 69 7a 65 6f 66 28 64 6f 75 ) - 6*sizeof(dou
7ca0: 62 6c 65 29 29 09 5c 0a 20 20 20 3a 20 2a 28 64 ble)).\. : *(d
7cb0: 6f 75 62 6c 65 2a 29 28 28 4c 49 53 54 29 2d 3e ouble*)((LIST)->
7cc0: 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 64 6f aptr - sizeof(do
7cd0: 75 62 6c 65 29 29 09 09 09 09 5c 0a 20 20 29 0a uble))....\. ).
7ce0: 23 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 66 #define va_arg_f
7cf0: 6c 6f 61 74 28 4c 49 53 54 29 20 20 5c 0a 20 20 loat(LIST) \.
7d00: 28 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b (((LIST)->aptr +
7d10: 3d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 = sizeof(double)
7d20: 29 20 3c 3d 20 28 4c 49 53 54 29 2d 3e 6d 65 6d ) <= (LIST)->mem
7d30: 61 72 67 70 74 72 09 09 5c 0a 20 20 20 3f 20 2f argptr..\. ? /
7d40: 2a 20 54 68 65 20 66 69 72 73 74 20 36 20 61 72 * The first 6 ar
7d50: 67 73 20 68 61 76 65 20 62 65 65 6e 20 70 75 74 gs have been put
7d60: 20 69 6e 74 6f 20 6d 65 6d 6f 72 79 20 62 79 20 into memory by
7d70: 22 73 74 74 22 20 69 6e 73 74 72 75 63 74 69 6f "stt" instructio
7d80: 6e 73 20 2a 2f 5c 0a 20 20 20 20 20 2f 2a 20 28 ns */\. /* (
7d90: 73 65 65 20 76 61 63 61 6c 6c 2d 61 6c 70 68 61 see vacall-alpha
7da0: 2e 73 21 29 2e 20 54 68 65 72 65 66 6f 72 65 20 .s!). Therefore
7db0: 6c 6f 61 64 20 74 68 65 6d 20 61 73 20 64 6f 75 load them as dou
7dc0: 62 6c 65 73 2e 20 2a 2f 09 5c 0a 20 20 20 20 20 bles. */.\.
7dd0: 2f 2a 20 57 68 65 6e 20 76 69 65 77 65 64 20 61 /* When viewed a
7de0: 73 20 66 6c 6f 61 74 73 2c 20 74 68 65 20 76 61 s floats, the va
7df0: 6c 75 65 20 77 69 6c 6c 20 62 65 20 74 68 65 20 lue will be the
7e00: 63 6f 72 72 65 63 74 20 6f 6e 65 2e 20 2a 2f 09 correct one. */.
7e10: 5c 0a 20 20 20 20 20 28 66 6c 6f 61 74 29 2a 28 \. (float)*(
7e20: 64 6f 75 62 6c 65 2a 29 28 28 4c 49 53 54 29 2d double*)((LIST)-
7e30: 3e 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 64 >aptr - sizeof(d
7e40: 6f 75 62 6c 65 29 20 2d 20 36 2a 73 69 7a 65 6f ouble) - 6*sizeo
7e50: 66 28 64 6f 75 62 6c 65 29 29 20 5c 0a 20 20 20 f(double)) \.
7e60: 3a 20 2f 2a 20 54 68 65 73 65 20 61 72 67 73 20 : /* These args
7e70: 68 61 76 65 20 62 65 65 6e 20 70 75 74 20 69 6e have been put in
7e80: 74 6f 20 6d 65 6d 6f 72 79 20 62 79 20 22 73 74 to memory by "st
7e90: 73 22 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 2c s" instructions,
7ea0: 20 2a 2f 09 5c 0a 20 20 20 20 20 2f 2a 20 74 68 */.\. /* th
7eb0: 65 72 65 66 6f 72 65 20 6c 6f 61 64 20 74 68 65 erefore load the
7ec0: 6d 20 61 73 20 66 6c 6f 61 74 73 2e 20 2a 2f 09 m as floats. */.
7ed0: 09 09 09 5c 0a 20 20 20 20 20 2a 28 66 6c 6f 61 ...\. *(floa
7ee0: 74 2a 29 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 t*)((LIST)->aptr
7ef0: 20 2d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 - sizeof(double
7f00: 29 29 09 09 09 09 5c 0a 20 20 29 0a 23 65 6e 64 ))....\. ).#end
7f10: 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f if.#if defined(_
7f20: 5f 68 70 70 61 5f 5f 29 0a 2f 2a 20 54 68 65 20 _hppa__)./* The
7f30: 66 69 72 73 74 20 34 20 66 6c 6f 61 74 20 72 65 first 4 float re
7f40: 67 69 73 74 65 72 73 20 61 6e 64 20 74 68 65 20 gisters and the
7f50: 66 69 72 73 74 20 32 20 64 6f 75 62 6c 65 20 72 first 2 double r
7f60: 65 67 69 73 74 65 72 73 20 61 72 65 20 73 74 6f egisters are sto
7f70: 72 65 64 0a 20 2a 20 65 6c 73 65 77 68 65 72 65 red. * elsewhere
7f80: 2e 0a 20 2a 2f 0a 23 69 66 20 31 20 2f 2a 20 67 .. */.#if 1 /* g
7f90: 63 63 2d 32 2e 35 2e 32 20 70 61 73 73 65 73 20 cc-2.5.2 passes
7fa0: 74 68 65 73 65 20 61 72 67 73 20 69 6e 20 67 65 these args in ge
7fb0: 6e 65 72 61 6c 20 72 65 67 69 73 74 65 72 73 21 neral registers!
7fc0: 20 41 20 62 75 67 2c 20 49 20 74 68 69 6e 6b 2e A bug, I think.
7fd0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 */.#define va_a
7fe0: 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 29 20 20 rg_float(LIST)
7ff0: 5c 0a 20 20 28 2a 28 66 6c 6f 61 74 2a 29 28 28 \. (*(float*)((
8000: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 3d 20 73 LIST)->aptr -= s
8010: 69 7a 65 6f 66 28 66 6c 6f 61 74 29 29 29 0a 23 izeof(float))).#
8020: 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 64 6f define va_arg_do
8030: 75 62 6c 65 28 4c 49 53 54 29 20 20 5c 0a 20 20 uble(LIST) \.
8040: 28 5f 5f 76 61 5f 61 6c 69 67 6e 5f 64 6f 75 62 (__va_align_doub
8050: 6c 65 28 4c 49 53 54 29 09 09 09 09 09 09 5c 0a le(LIST)......\.
8060: 20 20 20 2a 28 64 6f 75 62 6c 65 2a 29 28 28 4c *(double*)((L
8070: 49 53 54 29 2d 3e 61 70 74 72 20 2d 3d 20 73 69 IST)->aptr -= si
8080: 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 09 zeof(double))...
8090: 09 5c 0a 20 20 29 0a 23 65 6c 73 65 20 2f 2a 20 .\. ).#else /*
80a0: 74 68 69 73 20 77 6f 75 6c 64 20 62 65 20 63 6f this would be co
80b0: 72 72 65 63 74 20 69 66 20 74 68 65 20 61 72 67 rrect if the arg
80c0: 73 20 77 65 72 65 20 70 61 73 73 65 64 20 69 6e s were passed in
80d0: 20 66 6c 6f 61 74 20 72 65 67 69 73 74 65 72 73 float registers
80e0: 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f . */.#define va_
80f0: 61 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 29 20 arg_float(LIST)
8100: 20 5c 0a 20 20 28 28 28 4c 49 53 54 29 2d 3e 61 \. (((LIST)->a
8110: 70 74 72 20 2d 3d 20 73 69 7a 65 6f 66 28 66 6c ptr -= sizeof(fl
8120: 6f 61 74 29 29 20 3e 3d 20 28 4c 49 53 54 29 2d oat)) >= (LIST)-
8130: 3e 6d 65 6d 61 72 67 70 74 72 09 09 09 5c 0a 20 >memargptr...\.
8140: 20 20 3f 20 2f 2a 20 54 68 65 20 66 69 72 73 74 ? /* The first
8150: 20 34 20 66 6c 6f 61 74 20 61 72 67 73 20 61 72 4 float args ar
8160: 65 20 73 74 6f 72 65 64 20 73 65 70 61 72 61 74 e stored separat
8170: 65 6c 79 2e 20 2a 2f 09 09 5c 0a 20 20 20 20 20 ely. */..\.
8180: 2a 28 66 6c 6f 61 74 2a 29 28 28 4c 49 53 54 29 *(float*)((LIST)
8190: 2d 3e 61 70 74 72 20 2b 20 28 4c 49 53 54 29 2d ->aptr + (LIST)-
81a0: 3e 66 61 72 67 5f 6f 66 66 73 65 74 29 09 09 09 >farg_offset)...
81b0: 5c 0a 20 20 20 3a 20 2a 28 66 6c 6f 61 74 2a 29 \. : *(float*)
81c0: 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 29 09 09 ((LIST)->aptr)..
81d0: 09 09 09 09 5c 0a 20 20 29 0a 23 64 65 66 69 6e ....\. ).#defin
81e0: 65 20 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 e va_arg_double(
81f0: 4c 49 53 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 LIST) \. (__va
8200: 5f 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 _align_double(LI
8210: 53 54 29 09 09 09 09 09 09 5c 0a 20 20 20 28 28 ST)......\. ((
8220: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 3d 20 (LIST)->aptr -=
8230: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 20 sizeof(double))
8240: 3e 3d 20 28 4c 49 53 54 29 2d 3e 6d 65 6d 61 72 >= (LIST)->memar
8250: 67 70 74 72 09 09 5c 0a 20 20 20 20 3f 20 2f 2a gptr..\. ? /*
8260: 20 54 68 65 20 66 69 72 73 74 20 32 20 64 6f 75 The first 2 dou
8270: 62 6c 65 20 61 72 67 73 20 61 72 65 20 73 74 6f ble args are sto
8280: 72 65 64 20 73 65 70 61 72 61 74 65 6c 79 2e 20 red separately.
8290: 2a 2f 09 09 5c 0a 20 20 20 20 20 20 2a 28 64 6f */..\. *(do
82a0: 75 62 6c 65 2a 29 28 28 4c 49 53 54 29 2d 3e 61 uble*)((LIST)->a
82b0: 70 74 72 20 2b 20 28 4c 49 53 54 29 2d 3e 64 61 ptr + (LIST)->da
82c0: 72 67 5f 6f 66 66 73 65 74 29 09 09 09 5c 0a 20 rg_offset)...\.
82d0: 20 20 20 3a 20 2a 28 64 6f 75 62 6c 65 2a 29 28 : *(double*)(
82e0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 29 09 09 09 (LIST)->aptr)...
82f0: 09 09 09 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 ...\. )).#endif
8300: 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 .#endif.#if defi
8310: 6e 65 64 28 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 ned(__mips__) &&
8320: 20 21 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 !defined(__mips
8330: 6e 33 32 5f 5f 29 20 26 26 20 21 64 65 66 69 6e n32__) && !defin
8340: 65 64 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 0a 2f ed(__mips64__)./
8350: 2a 20 54 68 65 20 66 69 72 73 74 20 30 2c 31 2c * The first 0,1,
8360: 32 20 72 65 67 69 73 74 65 72 73 20 61 72 65 20 2 registers are
8370: 73 74 6f 72 65 64 20 65 6c 73 65 77 68 65 72 65 stored elsewhere
8380: 20 69 66 20 74 68 65 79 20 61 72 65 20 66 6c 6f if they are flo
8390: 61 74 69 6e 67 2d 70 6f 69 6e 74 0a 20 2a 20 70 ating-point. * p
83a0: 61 72 61 6d 65 74 65 72 73 2e 0a 20 2a 2f 0a 23 arameters.. */.#
83b0: 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 66 6c define va_arg_fl
83c0: 6f 61 74 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 oat(LIST) \. (
83d0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 (LIST)->aptr +=
83e0: 73 69 7a 65 6f 66 28 66 6c 6f 61 74 29 2c 09 09 sizeof(float),..
83f0: 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e ...\. (LIST)->
8400: 61 6e 75 6d 2b 2b 2c 09 09 09 09 09 09 09 5c 0a anum++,.......\.
8410: 20 20 20 28 28 4c 49 53 54 29 2d 3e 61 6e 75 6d ((LIST)->anum
8420: 20 3d 3d 20 31 09 09 09 09 09 09 09 5c 0a 20 20 == 1.......\.
8430: 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 ? ((LIST)->fla
8440: 67 73 20 7c 3d 20 5f 5f 56 41 5f 46 4c 4f 41 54 gs |= __VA_FLOAT
8450: 5f 31 2c 20 28 4c 49 53 54 29 2d 3e 66 61 72 67 _1, (LIST)->farg
8460: 5b 30 5d 29 09 09 09 5c 0a 20 20 20 20 3a 20 28 [0])...\. : (
8470: 28 4c 49 53 54 29 2d 3e 61 6e 75 6d 20 3d 3d 20 (LIST)->anum ==
8480: 32 20 26 26 20 28 28 4c 49 53 54 29 2d 3e 66 6c 2 && ((LIST)->fl
8490: 61 67 73 20 26 20 5f 5f 56 41 5f 46 4c 4f 41 54 ags & __VA_FLOAT
84a0: 5f 31 29 09 09 5c 0a 20 20 20 20 20 20 20 3f 20 _1)..\. ?
84b0: 28 2f 2a 20 28 4c 49 53 54 29 2d 3e 66 6c 61 67 (/* (LIST)->flag
84c0: 73 20 7c 3d 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f s |= __VA_FLOAT_
84d0: 32 2c 20 2a 2f 20 28 4c 49 53 54 29 2d 3e 66 61 2, */ (LIST)->fa
84e0: 72 67 5b 31 5d 29 09 09 5c 0a 20 20 20 20 20 20 rg[1])..\.
84f0: 20 3a 20 2a 28 66 6c 6f 61 74 2a 29 28 28 4c 49 : *(float*)((LI
8500: 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 69 7a 65 ST)->aptr - size
8510: 6f 66 28 66 6c 6f 61 74 29 29 09 09 09 5c 0a 20 of(float))...\.
8520: 20 29 29 20 20 29 0a 23 64 65 66 69 6e 65 20 76 )) ).#define v
8530: 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c 49 53 a_arg_double(LIS
8540: 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 61 6c T) \. (__va_al
8550: 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 ign_double(LIST)
8560: 09 09 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 ......\. (LIST
8570: 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f )->aptr += sizeo
8580: 66 28 64 6f 75 62 6c 65 29 2c 09 09 09 09 09 5c f(double),.....\
8590: 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 6e 75 6d . (LIST)->anum
85a0: 2b 2b 2c 09 09 09 09 09 09 09 5c 0a 20 20 20 28 ++,.......\. (
85b0: 28 4c 49 53 54 29 2d 3e 61 6e 75 6d 20 3d 3d 20 (LIST)->anum ==
85c0: 31 09 09 09 09 09 09 09 5c 0a 20 20 20 20 3f 20 1.......\. ?
85d0: 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 7c ((LIST)->flags |
85e0: 3d 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 31 2c 20 = __VA_FLOAT_1,
85f0: 28 4c 49 53 54 29 2d 3e 64 61 72 67 5b 30 5d 29 (LIST)->darg[0])
8600: 09 09 09 5c 0a 20 20 20 20 3a 20 28 28 4c 49 53 ...\. : ((LIS
8610: 54 29 2d 3e 61 6e 75 6d 20 3d 3d 20 32 20 26 26 T)->anum == 2 &&
8620: 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 ((LIST)->flags
8630: 26 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 31 29 09 & __VA_FLOAT_1).
8640: 09 5c 0a 20 20 20 20 20 20 20 3f 20 28 2f 2a 20 .\. ? (/*
8650: 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 7c 3d (LIST)->flags |=
8660: 20 5f 5f 56 41 5f 46 4c 4f 41 54 5f 32 2c 20 2a __VA_FLOAT_2, *
8670: 2f 20 28 4c 49 53 54 29 2d 3e 64 61 72 67 5b 31 / (LIST)->darg[1
8680: 5d 29 09 09 5c 0a 20 20 20 20 20 20 20 3a 20 2a ])..\. : *
8690: 28 64 6f 75 62 6c 65 2a 29 28 28 4c 49 53 54 29 (double*)((LIST)
86a0: 2d 3e 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 ->aptr - sizeof(
86b0: 64 6f 75 62 6c 65 29 29 09 09 09 5c 0a 20 20 29 double))...\. )
86c0: 29 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 ) ).#endif.#if
86d0: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 defined(__mipsn3
86e0: 32 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 2__) || defined(
86f0: 5f 5f 6d 69 70 73 36 34 5f 5f 29 0a 2f 2a 20 54 __mips64__)./* T
8700: 68 65 20 66 69 72 73 74 20 30 2c 2e 2e 2c 38 20 he first 0,..,8
8710: 72 65 67 69 73 74 65 72 73 20 61 72 65 20 73 74 registers are st
8720: 6f 72 65 64 20 65 6c 73 65 77 68 65 72 65 20 69 ored elsewhere i
8730: 66 20 74 68 65 79 20 61 72 65 20 66 6c 6f 61 74 f they are float
8740: 69 6e 67 2d 70 6f 69 6e 74 0a 20 2a 20 70 61 72 ing-point. * par
8750: 61 6d 65 74 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 ameters.. */.#de
8760: 66 69 6e 65 20 76 61 5f 61 72 67 5f 66 6c 6f 61 fine va_arg_floa
8770: 74 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 5f 5f t(LIST) \. (__
8780: 76 61 5f 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 va_align_double(
8790: 4c 49 53 54 29 09 09 09 09 09 09 5c 0a 20 20 20 LIST)......\.
87a0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 (LIST)->aptr +=
87b0: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 2c 09 sizeof(double),.
87c0: 09 09 09 09 5c 0a 20 20 20 28 2b 2b 28 4c 49 53 ....\. (++(LIS
87d0: 54 29 2d 3e 61 6e 75 6d 20 3c 3d 20 38 09 09 09 T)->anum <= 8...
87e0: 09 09 09 09 5c 0a 20 20 20 20 3f 20 28 4c 49 53 ....\. ? (LIS
87f0: 54 29 2d 3e 66 61 72 67 5b 28 4c 49 53 54 29 2d T)->farg[(LIST)-
8800: 3e 61 6e 75 6d 20 2d 20 31 5d 09 09 09 09 09 5c >anum - 1].....\
8810: 0a 20 20 20 20 3a 20 2a 28 66 6c 6f 61 74 2a 29 . : *(float*)
8820: 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 ((LIST)->aptr -
8830: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 sizeof(double)).
8840: 09 09 09 5c 0a 20 20 29 29 0a 23 64 65 66 69 6e ...\. )).#defin
8850: 65 20 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 e va_arg_double(
8860: 4c 49 53 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 LIST) \. (__va
8870: 5f 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 _align_double(LI
8880: 53 54 29 09 09 09 09 09 09 5c 0a 20 20 20 28 4c ST)......\. (L
8890: 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 IST)->aptr += si
88a0: 7a 65 6f 66 28 64 6f 75 62 6c 65 29 2c 09 09 09 zeof(double),...
88b0: 09 09 5c 0a 20 20 20 28 2b 2b 28 4c 49 53 54 29 ..\. (++(LIST)
88c0: 2d 3e 61 6e 75 6d 20 3c 3d 20 38 09 09 09 09 09 ->anum <= 8.....
88d0: 09 09 5c 0a 20 20 20 20 3f 20 28 4c 49 53 54 29 ..\. ? (LIST)
88e0: 2d 3e 64 61 72 67 5b 28 4c 49 53 54 29 2d 3e 61 ->darg[(LIST)->a
88f0: 6e 75 6d 20 2d 20 31 5d 09 09 09 09 09 5c 0a 20 num - 1].....\.
8900: 20 20 20 3a 20 2a 28 64 6f 75 62 6c 65 2a 29 28 : *(double*)(
8910: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 (LIST)->aptr - s
8920: 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 izeof(double))..
8930: 09 09 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 0a ..\. )).#endif.
8940: 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 73 70 #if defined(__sp
8950: 61 72 63 36 34 5f 5f 29 0a 2f 2a 20 54 68 65 20 arc64__)./* The
8960: 66 69 72 73 74 20 30 2c 2e 2e 2c 31 36 20 72 65 first 0,..,16 re
8970: 67 69 73 74 65 72 73 20 61 72 65 20 73 74 6f 72 gisters are stor
8980: 65 64 20 65 6c 73 65 77 68 65 72 65 20 69 66 20 ed elsewhere if
8990: 74 68 65 79 20 61 72 65 20 66 6c 6f 61 74 69 6e they are floatin
89a0: 67 2d 70 6f 69 6e 74 0a 20 2a 20 70 61 72 61 6d g-point. * param
89b0: 65 74 65 72 73 2e 0a 20 2a 2f 0a 23 64 65 66 69 eters.. */.#defi
89c0: 6e 65 20 76 61 5f 61 72 67 5f 66 6c 6f 61 74 28 ne va_arg_float(
89d0: 4c 49 53 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 LIST) \. (__va
89e0: 5f 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 _align_double(LI
89f0: 53 54 29 09 09 09 09 09 09 5c 0a 20 20 20 28 4c ST)......\. (L
8a00: 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 IST)->aptr += si
8a10: 7a 65 6f 66 28 64 6f 75 62 6c 65 29 2c 09 09 09 zeof(double),...
8a20: 09 09 5c 0a 20 20 20 28 2b 2b 28 4c 49 53 54 29 ..\. (++(LIST)
8a30: 2d 3e 61 6e 75 6d 20 3c 3d 20 31 36 09 09 09 09 ->anum <= 16....
8a40: 09 09 5c 0a 20 20 20 20 3f 20 28 4c 49 53 54 29 ..\. ? (LIST)
8a50: 2d 3e 66 61 72 67 5b 28 4c 49 53 54 29 2d 3e 61 ->farg[(LIST)->a
8a60: 6e 75 6d 20 2d 20 31 5d 09 09 09 09 09 5c 0a 20 num - 1].....\.
8a70: 20 20 20 3a 20 2a 28 66 6c 6f 61 74 2a 29 28 28 : *(float*)((
8a80: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 69 LIST)->aptr - si
8a90: 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 09 zeof(double))...
8aa0: 09 5c 0a 20 20 29 29 0a 23 64 65 66 69 6e 65 20 .\. )).#define
8ab0: 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c 49 va_arg_double(LI
8ac0: 53 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 61 ST) \. (__va_a
8ad0: 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 54 lign_double(LIST
8ae0: 29 09 09 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 )......\. (LIS
8af0: 54 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 T)->aptr += size
8b00: 6f 66 28 64 6f 75 62 6c 65 29 2c 09 09 09 09 09 of(double),.....
8b10: 5c 0a 20 20 20 28 2b 2b 28 4c 49 53 54 29 2d 3e \. (++(LIST)->
8b20: 61 6e 75 6d 20 3c 3d 20 31 36 09 09 09 09 09 09 anum <= 16......
8b30: 5c 0a 20 20 20 20 3f 20 28 4c 49 53 54 29 2d 3e \. ? (LIST)->
8b40: 64 61 72 67 5b 28 4c 49 53 54 29 2d 3e 61 6e 75 darg[(LIST)->anu
8b50: 6d 20 2d 20 31 5d 09 09 09 09 09 5c 0a 20 20 20 m - 1].....\.
8b60: 20 3a 20 2a 28 64 6f 75 62 6c 65 2a 29 28 28 4c : *(double*)((L
8b70: 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 69 7a IST)->aptr - siz
8b80: 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 09 09 eof(double))....
8b90: 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 0a 23 69 \. )).#endif.#i
8ba0: 66 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 f defined(__powe
8bb0: 72 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e rpc__) && !defin
8bc0: 65 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f ed(__powerpc64__
8bd0: 29 20 26 26 20 28 64 65 66 69 6e 65 64 28 5f 41 ) && (defined(_A
8be0: 49 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 IX) || (defined(
8bf0: 5f 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 65 66 __MACH__) && def
8c00: 69 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f 29 29 ined(__APPLE__))
8c10: 29 0a 2f 2a 20 54 68 65 20 66 69 72 73 74 20 31 )./* The first 1
8c20: 33 20 66 6c 6f 61 74 69 6e 67 2d 70 6f 69 6e 74 3 floating-point
8c30: 20 61 72 67 73 20 68 61 76 65 20 62 65 65 6e 20 args have been
8c40: 73 74 6f 72 65 64 20 65 6c 73 65 77 68 65 72 65 stored elsewhere
8c50: 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f . */.#define va_
8c60: 61 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 29 20 arg_float(LIST)
8c70: 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 61 70 \. ((LIST)->ap
8c80: 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 66 6c 6f tr += sizeof(flo
8c90: 61 74 29 2c 09 09 09 09 09 5c 0a 20 20 20 28 28 at),.....\. ((
8ca0: 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 LIST)->memfargpt
8cb0: 72 20 3c 20 26 28 4c 49 53 54 29 2d 3e 66 61 72 r < &(LIST)->far
8cc0: 67 5b 31 33 5d 09 09 09 09 5c 0a 20 20 20 20 3f g[13]....\. ?
8cd0: 20 28 66 6c 6f 61 74 29 20 2a 28 28 4c 49 53 54 (float) *((LIST
8ce0: 29 2d 3e 6d 65 6d 66 61 72 67 70 74 72 2b 2b 29 )->memfargptr++)
8cf0: 09 09 09 09 09 5c 0a 20 20 20 20 3a 20 2a 28 66 .....\. : *(f
8d00: 6c 6f 61 74 2a 29 28 28 4c 49 53 54 29 2d 3e 61 loat*)((LIST)->a
8d10: 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 66 6c 6f ptr - sizeof(flo
8d20: 61 74 29 29 09 09 09 09 5c 0a 20 20 29 29 0a 23 at))....\. )).#
8d30: 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 64 6f define va_arg_do
8d40: 75 62 6c 65 28 4c 49 53 54 29 20 20 5c 0a 20 20 uble(LIST) \.
8d50: 28 5f 5f 76 61 5f 61 6c 69 67 6e 5f 64 6f 75 62 (__va_align_doub
8d60: 6c 65 28 4c 49 53 54 29 09 09 09 09 09 09 5c 0a le(LIST)......\.
8d70: 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 (LIST)->aptr
8d80: 2b 3d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 += sizeof(double
8d90: 29 2c 09 09 09 09 09 5c 0a 20 20 20 28 28 4c 49 ),.....\. ((LI
8da0: 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 72 20 ST)->memfargptr
8db0: 3c 20 26 28 4c 49 53 54 29 2d 3e 66 61 72 67 5b < &(LIST)->farg[
8dc0: 31 33 5d 09 09 09 09 5c 0a 20 20 20 20 3f 20 2a 13]....\. ? *
8dd0: 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 ((LIST)->memfarg
8de0: 70 74 72 2b 2b 29 09 09 09 09 09 09 5c 0a 20 20 ptr++)......\.
8df0: 20 20 3a 20 2a 28 64 6f 75 62 6c 65 2a 29 28 28 : *(double*)((
8e00: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 69 LIST)->aptr - si
8e10: 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 09 zeof(double))...
8e20: 09 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 0a 23 .\. )).#endif.#
8e30: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 if defined(__pow
8e40: 65 72 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 erpc__) && !defi
8e50: 6e 65 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f ned(__powerpc64_
8e60: 5f 29 20 26 26 20 21 28 64 65 66 69 6e 65 64 28 _) && !(defined(
8e70: 5f 41 49 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 _AIX) || (define
8e80: 64 28 5f 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 d(__MACH__) && d
8e90: 65 66 69 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f efined(__APPLE__
8ea0: 29 29 29 0a 2f 2a 20 54 68 65 20 66 69 72 73 74 )))./* The first
8eb0: 20 38 20 66 6c 6f 61 74 69 6e 67 2d 70 6f 69 6e 8 floating-poin
8ec0: 74 20 61 72 67 73 20 68 61 76 65 20 62 65 65 6e t args have been
8ed0: 20 73 74 6f 72 65 64 20 65 6c 73 65 77 68 65 72 stored elsewher
8ee0: 65 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 e. */.#define va
8ef0: 5f 61 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 29 _arg_float(LIST)
8f00: 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 6d \. ((LIST)->m
8f10: 65 6d 66 61 72 67 70 74 72 20 3c 20 26 28 4c 49 emfargptr < &(LI
8f20: 53 54 29 2d 3e 66 61 72 67 5b 38 5d 09 09 09 09 ST)->farg[8]....
8f30: 5c 0a 20 20 20 3f 20 28 66 6c 6f 61 74 29 20 2a \. ? (float) *
8f40: 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 ((LIST)->memfarg
8f50: 70 74 72 2b 2b 29 09 09 09 09 09 5c 0a 20 20 20 ptr++).....\.
8f60: 3a 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 : ((LIST)->aptr
8f70: 3d 20 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 = ((LIST)->onsta
8f80: 63 6b 20 3d 3d 20 30 20 20 20 20 20 20 20 20 20 ck == 0
8f90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8fa0: 20 20 20 20 20 5c 0a 20 20 20 20 20 20 20 20 20 \.
8fb0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3f 20 ?
8fc0: 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 63 6b ((LIST)->onstack
8fd0: 3d 31 2c 20 28 4c 49 53 54 29 2d 3e 73 61 70 74 =1, (LIST)->sapt
8fe0: 72 29 20 20 20 20 20 20 20 20 20 20 20 20 20 5c r) \
8ff0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
9000: 20 20 20 20 20 20 20 20 3a 20 28 4c 49 53 54 29 : (LIST)
9010: 2d 3e 61 70 74 72 20 20 20 20 20 20 20 20 20 20 ->aptr
9020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9030: 20 20 20 20 20 20 20 20 20 5c 0a 20 20 20 20 20 \.
9040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9050: 20 29 2c 20 20 20 20 20 20 20 20 20 20 20 20 20 ),
9060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9080: 20 20 20 5c 0a 20 20 20 20 20 20 28 4c 49 53 54 \. (LIST
9090: 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f )->aptr += sizeo
90a0: 66 28 66 6c 6f 61 74 29 2c 09 09 09 09 09 5c 0a f(float),.....\.
90b0: 20 20 20 20 20 20 2a 28 66 6c 6f 61 74 2a 29 28 *(float*)(
90c0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 (LIST)->aptr - s
90d0: 69 7a 65 6f 66 28 66 6c 6f 61 74 29 29 09 09 09 izeof(float))...
90e0: 09 5c 0a 20 20 29 29 0a 23 64 65 66 69 6e 65 20 .\. )).#define
90f0: 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c 49 va_arg_double(LI
9100: 53 54 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 ST) \. ((LIST)
9110: 2d 3e 6d 65 6d 66 61 72 67 70 74 72 20 3c 20 26 ->memfargptr < &
9120: 28 4c 49 53 54 29 2d 3e 66 61 72 67 5b 38 5d 09 (LIST)->farg[8].
9130: 09 09 09 5c 0a 20 20 20 20 3f 20 2a 28 28 4c 49 ...\. ? *((LI
9140: 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 72 2b ST)->memfargptr+
9150: 2b 29 09 09 09 09 09 09 5c 0a 20 20 20 20 3a 20 +)......\. :
9160: 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 3d 20 ((LIST)->aptr =
9170: 28 28 4c 49 53 54 29 2d 3e 6f 6e 73 74 61 63 6b ((LIST)->onstack
9180: 20 3d 3d 20 30 20 20 20 20 20 20 20 20 20 20 20 == 0
9190: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
91a0: 20 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.
91b0: 20 20 20 20 20 20 20 20 20 20 20 3f 20 28 28 4c ? ((L
91c0: 49 53 54 29 2d 3e 6f 6e 73 74 61 63 6b 3d 31 2c IST)->onstack=1,
91d0: 20 28 4c 49 53 54 29 2d 3e 73 61 70 74 72 29 20 (LIST)->saptr)
91e0: 20 20 20 20 20 20 20 20 20 20 20 20 5c 0a 20 20 \.
91f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9200: 20 20 20 20 20 3a 20 28 4c 49 53 54 29 2d 3e 61 : (LIST)->a
9210: 70 74 72 20 20 20 20 20 20 20 20 20 20 20 20 20 ptr
9220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9230: 20 20 20 20 20 20 5c 0a 20 20 20 20 20 20 20 20 \.
9240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 29 2c ),
9250: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9270: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9280: 5c 0a 20 20 20 20 20 20 20 5f 5f 76 61 5f 61 6c \. __va_al
9290: 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 ign_double(LIST)
92a0: 09 09 09 09 09 09 5c 0a 20 20 20 20 20 20 20 28 ......\. (
92b0: 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d 20 73 LIST)->aptr += s
92c0: 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 2c 09 09 izeof(double),..
92d0: 09 09 09 5c 0a 20 20 20 20 20 20 20 2a 28 64 6f ...\. *(do
92e0: 75 62 6c 65 2a 29 28 28 4c 49 53 54 29 2d 3e 61 uble*)((LIST)->a
92f0: 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 64 6f 75 ptr - sizeof(dou
9300: 62 6c 65 29 29 09 09 09 5c 0a 20 20 29 29 0a 23 ble))...\. )).#
9310: 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 endif.#if define
9320: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
9330: 0a 2f 2a 20 54 68 65 20 66 69 72 73 74 20 31 33 ./* The first 13
9340: 20 66 6c 6f 61 74 69 6e 67 2d 70 6f 69 6e 74 20 floating-point
9350: 61 72 67 73 20 68 61 76 65 20 62 65 65 6e 20 73 args have been s
9360: 74 6f 72 65 64 20 65 6c 73 65 77 68 65 72 65 2e tored elsewhere.
9370: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 */.#define va_a
9380: 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 29 20 20 rg_float(LIST)
9390: 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 \. ((LIST)->apt
93a0: 72 20 2b 3d 20 73 69 7a 65 6f 66 28 5f 5f 76 61 r += sizeof(__va
93b0: 77 6f 72 64 29 2c 09 09 09 09 09 5c 0a 20 20 20 word),.....\.
93c0: 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 ((LIST)->memfarg
93d0: 70 74 72 20 3c 20 26 28 4c 49 53 54 29 2d 3e 66 ptr < &(LIST)->f
93e0: 61 72 67 5b 31 33 5d 09 09 09 09 5c 0a 20 20 20 arg[13]....\.
93f0: 20 3f 20 28 66 6c 6f 61 74 29 20 2a 28 28 4c 49 ? (float) *((LI
9400: 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 72 2b ST)->memfargptr+
9410: 2b 29 09 09 09 09 09 5c 0a 20 20 20 20 3a 20 2a +).....\. : *
9420: 28 66 6c 6f 61 74 2a 29 28 28 4c 49 53 54 29 2d (float*)((LIST)-
9430: 3e 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 66 >aptr - sizeof(f
9440: 6c 6f 61 74 29 29 09 09 09 09 5c 0a 20 20 29 29 loat))....\. ))
9450: 0a 23 64 65 66 69 6e 65 20 76 61 5f 61 72 67 5f .#define va_arg_
9460: 64 6f 75 62 6c 65 28 4c 49 53 54 29 20 20 5c 0a double(LIST) \.
9470: 20 20 28 5f 5f 76 61 5f 61 6c 69 67 6e 5f 64 6f (__va_align_do
9480: 75 62 6c 65 28 4c 49 53 54 29 09 09 09 09 09 09 uble(LIST)......
9490: 5c 0a 20 20 20 28 4c 49 53 54 29 2d 3e 61 70 74 \. (LIST)->apt
94a0: 72 20 2b 3d 20 73 69 7a 65 6f 66 28 64 6f 75 62 r += sizeof(doub
94b0: 6c 65 29 2c 09 09 09 09 09 5c 0a 20 20 20 28 28 le),.....\. ((
94c0: 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 LIST)->memfargpt
94d0: 72 20 3c 20 26 28 4c 49 53 54 29 2d 3e 66 61 72 r < &(LIST)->far
94e0: 67 5b 31 33 5d 09 09 09 09 5c 0a 20 20 20 20 3f g[13]....\. ?
94f0: 20 2a 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 *((LIST)->memfa
9500: 72 67 70 74 72 2b 2b 29 09 09 09 09 09 09 5c 0a rgptr++)......\.
9510: 20 20 20 20 3a 20 2a 28 64 6f 75 62 6c 65 2a 29 : *(double*)
9520: 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 ((LIST)->aptr -
9530: 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 sizeof(double)).
9540: 09 09 09 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 ...\. )).#endif
9550: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 73 .#if defined(__s
9560: 33 39 30 5f 5f 29 0a 2f 2a 20 54 68 65 20 66 69 390__)./* The fi
9570: 72 73 74 20 32 20 66 6c 6f 61 74 69 6e 67 2d 70 rst 2 floating-p
9580: 6f 69 6e 74 20 61 72 67 73 20 68 61 76 65 20 62 oint args have b
9590: 65 65 6e 20 73 74 6f 72 65 64 20 65 6c 73 65 77 een stored elsew
95a0: 68 65 72 65 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 here. */.#define
95b0: 20 76 61 5f 61 72 67 5f 66 6c 6f 61 74 28 4c 49 va_arg_float(LI
95c0: 53 54 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 ST) \. ((LIST)
95d0: 2d 3e 6d 65 6d 66 61 72 67 70 74 72 20 3c 20 26 ->memfargptr < &
95e0: 28 4c 49 53 54 29 2d 3e 66 61 72 67 5b 32 5d 09 (LIST)->farg[2].
95f0: 09 09 09 5c 0a 20 20 20 3f 20 28 4c 49 53 54 29 ...\. ? (LIST)
9600: 2d 3e 6d 65 6d 64 61 72 67 70 74 72 2b 2b 2c 20 ->memdargptr++,
9610: 28 66 6c 6f 61 74 29 20 2a 28 28 4c 49 53 54 29 (float) *((LIST)
9620: 2d 3e 6d 65 6d 66 61 72 67 70 74 72 2b 2b 29 09 ->memfargptr++).
9630: 09 5c 0a 20 20 20 3a 20 28 28 4c 49 53 54 29 2d .\. : ((LIST)-
9640: 3e 61 70 74 72 20 3d 20 28 28 4c 49 53 54 29 2d >aptr = ((LIST)-
9650: 3e 6f 6e 73 74 61 63 6b 20 3d 3d 20 30 20 20 20 >onstack == 0
9660: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9670: 20 20 20 20 20 20 20 20 20 20 20 5c 0a 20 20 20 \.
9680: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9690: 20 20 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e 6f ? ((LIST)->o
96a0: 6e 73 74 61 63 6b 3d 31 2c 20 28 4c 49 53 54 29 nstack=1, (LIST)
96b0: 2d 3e 73 61 70 74 72 29 20 20 20 20 20 20 20 20 ->saptr)
96c0: 20 20 20 20 20 5c 0a 20 20 20 20 20 20 20 20 20 \.
96d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 :
96e0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 20 20 20 (LIST)->aptr
96f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9700: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5c \
9710: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
9720: 20 20 20 20 20 20 20 29 2c 20 20 20 20 20 20 20 ),
9730: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9740: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9750: 20 20 20 20 20 20 20 20 20 5c 0a 20 20 20 20 20 \.
9760: 20 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b 3d (LIST)->aptr +=
9770: 20 73 69 7a 65 6f 66 28 66 6c 6f 61 74 29 2c 09 sizeof(float),.
9780: 09 09 09 09 5c 0a 20 20 20 20 20 20 2a 28 66 6c ....\. *(fl
9790: 6f 61 74 2a 29 28 28 4c 49 53 54 29 2d 3e 61 70 oat*)((LIST)->ap
97a0: 74 72 20 2d 20 73 69 7a 65 6f 66 28 66 6c 6f 61 tr - sizeof(floa
97b0: 74 29 29 09 09 09 09 5c 0a 20 20 29 29 0a 23 64 t))....\. )).#d
97c0: 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 64 6f 75 efine va_arg_dou
97d0: 62 6c 65 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 ble(LIST) \. (
97e0: 28 4c 49 53 54 29 2d 3e 6d 65 6d 64 61 72 67 70 (LIST)->memdargp
97f0: 74 72 20 3c 20 26 28 4c 49 53 54 29 2d 3e 64 61 tr < &(LIST)->da
9800: 72 67 5b 32 5d 09 09 09 09 5c 0a 20 20 20 20 3f rg[2]....\. ?
9810: 20 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 (LIST)->memfarg
9820: 70 74 72 2b 2b 2c 20 2a 28 28 4c 49 53 54 29 2d ptr++, *((LIST)-
9830: 3e 6d 65 6d 64 61 72 67 70 74 72 2b 2b 29 09 09 >memdargptr++)..
9840: 09 5c 0a 20 20 20 20 3a 20 28 28 4c 49 53 54 29 .\. : ((LIST)
9850: 2d 3e 61 70 74 72 20 3d 20 28 28 4c 49 53 54 29 ->aptr = ((LIST)
9860: 2d 3e 6f 6e 73 74 61 63 6b 20 3d 3d 20 30 20 20 ->onstack == 0
9870: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9880: 20 20 20 20 20 20 20 20 20 20 20 5c 0a 20 20 20 \.
9890: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
98a0: 20 20 20 20 3f 20 28 28 4c 49 53 54 29 2d 3e 6f ? ((LIST)->o
98b0: 6e 73 74 61 63 6b 3d 31 2c 20 28 4c 49 53 54 29 nstack=1, (LIST)
98c0: 2d 3e 73 61 70 74 72 29 20 20 20 20 20 20 20 20 ->saptr)
98d0: 20 20 20 20 20 5c 0a 20 20 20 20 20 20 20 20 20 \.
98e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3a 20 :
98f0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 20 20 20 (LIST)->aptr
9900: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9910: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5c \
9920: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
9930: 20 20 20 20 20 20 20 29 2c 20 20 20 20 20 20 20 ),
9940: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9950: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9960: 20 20 20 20 20 20 20 20 20 5c 0a 20 20 20 20 20 \.
9970: 20 20 5f 5f 76 61 5f 61 6c 69 67 6e 5f 64 6f 75 __va_align_dou
9980: 62 6c 65 28 4c 49 53 54 29 09 09 09 09 09 09 5c ble(LIST)......\
9990: 0a 20 20 20 20 20 20 20 28 4c 49 53 54 29 2d 3e . (LIST)->
99a0: 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 64 aptr += sizeof(d
99b0: 6f 75 62 6c 65 29 2c 09 09 09 09 09 5c 0a 20 20 ouble),.....\.
99c0: 20 20 20 20 20 2a 28 64 6f 75 62 6c 65 2a 29 28 *(double*)(
99d0: 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2d 20 73 (LIST)->aptr - s
99e0: 69 7a 65 6f 66 28 64 6f 75 62 6c 65 29 29 09 09 izeof(double))..
99f0: 09 5c 0a 20 20 29 29 0a 23 65 6e 64 69 66 0a 23 .\. )).#endif.#
9a00: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 69 61 36 if defined(__ia6
9a10: 34 5f 5f 29 0a 2f 2a 20 54 68 65 20 66 69 72 73 4__)./* The firs
9a20: 74 20 38 20 66 6c 6f 61 74 69 6e 67 2d 70 6f 69 t 8 floating-poi
9a30: 6e 74 20 61 72 67 73 20 68 61 76 65 20 62 65 65 nt args have bee
9a40: 6e 20 73 74 6f 72 65 64 20 65 6c 73 65 77 68 65 n stored elsewhe
9a50: 72 65 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 76 re. */.#define v
9a60: 61 5f 61 72 67 5f 66 6c 6f 61 74 28 4c 49 53 54 a_arg_float(LIST
9a70: 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e ) \. ((LIST)->
9a80: 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 5f aptr += sizeof(_
9a90: 5f 76 61 77 6f 72 64 29 2c 09 09 09 09 09 5c 0a _vaword),.....\.
9aa0: 20 20 20 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 ((LIST)->memf
9ab0: 61 72 67 70 74 72 20 3c 20 26 28 4c 49 53 54 29 argptr < &(LIST)
9ac0: 2d 3e 66 61 72 67 5b 38 5d 09 09 09 09 5c 0a 20 ->farg[8]....\.
9ad0: 20 20 20 3f 20 28 66 6c 6f 61 74 29 20 2a 28 28 ? (float) *((
9ae0: 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 LIST)->memfargpt
9af0: 72 2b 2b 29 09 09 09 09 09 5c 0a 20 20 20 20 3a r++).....\. :
9b00: 20 2a 28 66 6c 6f 61 74 2a 29 28 28 4c 49 53 54 *(float*)((LIST
9b10: 29 2d 3e 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 )->aptr - sizeof
9b20: 28 5f 5f 76 61 77 6f 72 64 29 29 09 09 09 5c 0a (__vaword))...\.
9b30: 20 20 29 29 0a 23 64 65 66 69 6e 65 20 76 61 5f )).#define va_
9b40: 61 72 67 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 arg_double(LIST)
9b50: 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 61 6c 69 67 \. (__va_alig
9b60: 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 54 29 09 09 n_double(LIST)..
9b70: 09 09 09 09 5c 0a 20 20 20 28 4c 49 53 54 29 2d ....\. (LIST)-
9b80: 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 >aptr += sizeof(
9b90: 64 6f 75 62 6c 65 29 2c 09 09 09 09 09 5c 0a 20 double),.....\.
9ba0: 20 20 28 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 ((LIST)->memfa
9bb0: 72 67 70 74 72 20 3c 20 26 28 4c 49 53 54 29 2d rgptr < &(LIST)-
9bc0: 3e 66 61 72 67 5b 38 5d 09 09 09 09 5c 0a 20 20 >farg[8]....\.
9bd0: 20 20 3f 20 2a 28 28 4c 49 53 54 29 2d 3e 6d 65 ? *((LIST)->me
9be0: 6d 66 61 72 67 70 74 72 2b 2b 29 09 09 09 09 09 mfargptr++).....
9bf0: 09 5c 0a 20 20 20 20 3a 20 2a 28 64 6f 75 62 6c .\. : *(doubl
9c00: 65 2a 29 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 e*)((LIST)->aptr
9c10: 20 2d 20 73 69 7a 65 6f 66 28 64 6f 75 62 6c 65 - sizeof(double
9c20: 29 29 09 09 09 09 5c 0a 20 20 29 29 0a 23 65 6e ))....\. )).#en
9c30: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
9c40: 5f 5f 78 38 36 5f 36 34 5f 5f 29 0a 2f 2a 20 54 __x86_64__)./* T
9c50: 68 65 20 66 69 72 73 74 20 38 20 66 6c 6f 61 74 he first 8 float
9c60: 69 6e 67 2d 70 6f 69 6e 74 20 61 72 67 73 20 68 ing-point args h
9c70: 61 76 65 20 62 65 65 6e 20 73 74 6f 72 65 64 20 ave been stored
9c80: 65 6c 73 65 77 68 65 72 65 2e 20 2a 2f 0a 23 64 elsewhere. */.#d
9c90: 65 66 69 6e 65 20 76 61 5f 61 72 67 5f 66 6c 6f efine va_arg_flo
9ca0: 61 74 28 4c 49 53 54 29 20 20 5c 0a 20 20 28 28 at(LIST) \. ((
9cb0: 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 LIST)->memfargpt
9cc0: 72 20 3c 20 26 28 4c 49 53 54 29 2d 3e 66 61 72 r < &(LIST)->far
9cd0: 67 5b 38 5d 09 09 09 09 5c 0a 20 20 20 3f 20 28 g[8]....\. ? (
9ce0: 28 4c 49 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 (LIST)->memfargp
9cf0: 74 72 2b 2b 2c 09 09 09 09 09 09 5c 0a 20 20 20 tr++,......\.
9d00: 20 20 20 2a 28 66 6c 6f 61 74 2a 29 28 28 4c 49 *(float*)((LI
9d10: 53 54 29 2d 3e 6d 65 6d 66 61 72 67 70 74 72 20 ST)->memfargptr
9d20: 2d 20 31 29 09 09 09 09 09 5c 0a 20 20 20 20 20 - 1).....\.
9d30: 29 09 09 09 09 09 09 09 09 09 5c 0a 20 20 20 3a ).........\. :
9d40: 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 2b ((LIST)->aptr +
9d50: 3d 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 = sizeof(__vawor
9d60: 64 29 2c 09 09 09 09 09 5c 0a 20 20 20 20 20 20 d),.....\.
9d70: 2a 28 66 6c 6f 61 74 2a 29 28 28 4c 49 53 54 29 *(float*)((LIST)
9d80: 2d 3e 61 70 74 72 20 2d 20 73 69 7a 65 6f 66 28 ->aptr - sizeof(
9d90: 5f 5f 76 61 77 6f 72 64 29 29 09 09 09 5c 0a 20 __vaword))...\.
9da0: 20 29 20 20 29 0a 23 64 65 66 69 6e 65 20 76 61 ) ).#define va
9db0: 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c 49 53 54 _arg_double(LIST
9dc0: 29 20 20 5c 0a 20 20 28 28 4c 49 53 54 29 2d 3e ) \. ((LIST)->
9dd0: 6d 65 6d 66 61 72 67 70 74 72 20 3c 20 26 28 4c memfargptr < &(L
9de0: 49 53 54 29 2d 3e 66 61 72 67 5b 38 5d 09 09 09 IST)->farg[8]...
9df0: 09 5c 0a 20 20 20 3f 20 2a 28 4c 49 53 54 29 2d .\. ? *(LIST)-
9e00: 3e 6d 65 6d 66 61 72 67 70 74 72 2b 2b 09 09 09 >memfargptr++...
9e10: 09 09 09 5c 0a 20 20 20 3a 20 28 28 4c 49 53 54 ...\. : ((LIST
9e20: 29 2d 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f )->aptr += sizeo
9e30: 66 28 5f 5f 76 61 77 6f 72 64 29 2c 09 09 09 09 f(__vaword),....
9e40: 09 5c 0a 20 20 20 20 20 20 2a 28 64 6f 75 62 6c .\. *(doubl
9e50: 65 2a 29 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 e*)((LIST)->aptr
9e60: 20 2d 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f - sizeof(__vawo
9e70: 72 64 29 29 09 09 09 5c 0a 20 20 29 20 20 29 0a rd))...\. ) ).
9e80: 23 65 6e 64 69 66 0a 23 69 66 6e 64 65 66 20 76 #endif.#ifndef v
9e90: 61 5f 61 72 67 5f 66 6c 6f 61 74 0a 23 64 65 66 a_arg_float.#def
9ea0: 69 6e 65 20 76 61 5f 61 72 67 5f 66 6c 6f 61 74 ine va_arg_float
9eb0: 28 4c 49 53 54 29 09 5f 5f 76 61 5f 61 72 67 28 (LIST).__va_arg(
9ec0: 4c 49 53 54 2c 66 6c 6f 61 74 29 0a 23 65 6e 64 LIST,float).#end
9ed0: 69 66 0a 23 69 66 6e 64 65 66 20 76 61 5f 61 72 if.#ifndef va_ar
9ee0: 67 5f 64 6f 75 62 6c 65 0a 23 64 65 66 69 6e 65 g_double.#define
9ef0: 20 76 61 5f 61 72 67 5f 64 6f 75 62 6c 65 28 4c va_arg_double(L
9f00: 49 53 54 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f IST) \. (__va_
9f10: 61 6c 69 67 6e 5f 64 6f 75 62 6c 65 28 4c 49 53 align_double(LIS
9f20: 54 29 20 5f 5f 76 61 5f 61 72 67 28 4c 49 53 54 T) __va_arg(LIST
9f30: 2c 64 6f 75 62 6c 65 29 29 0a 23 65 6e 64 69 66 ,double)).#endif
9f40: 0a 0a 2f 2a 20 50 6f 69 6e 74 65 72 20 61 72 67 ../* Pointer arg
9f50: 75 6d 65 6e 74 73 2e 20 2a 2f 0a 23 64 65 66 69 uments. */.#defi
9f60: 6e 65 20 76 61 5f 61 72 67 5f 70 74 72 28 4c 49 ne va_arg_ptr(LI
9f70: 53 54 2c 54 59 50 45 29 09 5f 5f 76 61 5f 61 72 ST,TYPE).__va_ar
9f80: 67 28 4c 49 53 54 2c 54 59 50 45 29 0a 0a 2f 2a g(LIST,TYPE)../*
9f90: 20 53 74 72 75 63 74 75 72 65 20 61 72 67 75 6d Structure argum
9fa0: 65 6e 74 73 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 ents. */.#define
9fb0: 20 76 61 5f 61 72 67 5f 73 74 72 75 63 74 28 4c va_arg_struct(L
9fc0: 49 53 54 2c 54 59 50 45 29 20 20 5c 0a 20 20 2a IST,TYPE) \. *
9fd0: 28 54 59 50 45 2a 29 5f 5f 76 61 5f 61 72 67 5f (TYPE*)__va_arg_
9fe0: 73 74 72 75 63 74 28 4c 49 53 54 2c 73 69 7a 65 struct(LIST,size
9ff0: 6f 66 28 54 59 50 45 29 2c 5f 5f 56 41 5f 61 6c of(TYPE),__VA_al
a000: 69 67 6e 6f 66 28 54 59 50 45 29 29 0a 2f 2a 20 ignof(TYPE))./*
a010: 5f 76 61 5f 61 72 67 5f 73 74 72 75 63 74 28 29 _va_arg_struct()
a020: 20 69 73 20 6c 69 6b 65 20 76 61 5f 61 72 67 5f is like va_arg_
a030: 73 74 72 75 63 74 28 29 2c 20 65 78 63 65 70 74 struct(), except
a040: 20 74 68 61 74 20 79 6f 75 20 70 61 73 73 20 74 that you pass t
a050: 68 65 20 74 79 70 65 27 73 0a 20 2a 20 73 69 7a he type's. * siz
a060: 65 20 61 6e 64 20 61 6c 69 67 6e 6d 65 6e 74 20 e and alignment
a070: 69 6e 73 74 65 61 64 20 6f 66 20 74 68 65 20 74 instead of the t
a080: 79 70 65 20 61 6e 64 20 67 65 74 20 74 68 65 20 ype and get the
a090: 76 61 6c 75 65 27 73 20 61 64 64 72 65 73 73 20 value's address
a0a0: 69 6e 73 74 65 61 64 0a 20 2a 20 6f 66 20 74 68 instead. * of th
a0b0: 65 20 76 61 6c 75 65 20 69 74 73 65 6c 66 2e 0a e value itself..
a0c0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 76 61 5f */.#define _va_
a0d0: 61 72 67 5f 73 74 72 75 63 74 28 4c 49 53 54 2c arg_struct(LIST,
a0e0: 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 TYPE_SIZE,TYPE_A
a0f0: 4c 49 47 4e 29 20 20 5c 0a 20 20 28 76 6f 69 64 LIGN) \. (void
a100: 2a 29 5f 5f 76 61 5f 61 72 67 5f 73 74 72 75 63 *)__va_arg_struc
a110: 74 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 t(LIST,TYPE_SIZE
a120: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 0a 2f 2a 20 ,TYPE_ALIGN)./*
a130: 53 74 72 75 63 74 75 72 65 20 61 72 67 75 6d 65 Structure argume
a140: 6e 74 20 61 6c 69 67 6e 6d 65 6e 74 2e 20 2a 2f nt alignment. */
a150: 0a 23 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 69 .#if defined(__i
a160: 33 38 36 5f 5f 29 20 26 26 20 64 65 66 69 6e 65 386__) && define
a170: 64 28 5f 4d 53 43 5f 56 45 52 29 0a 2f 2a 20 49 d(_MSC_VER)./* I
a180: 6e 20 4d 53 56 43 2c 20 64 6f 75 62 6c 65 73 20 n MSVC, doubles
a190: 69 6e 73 69 64 65 20 73 74 72 75 63 74 75 72 65 inside structure
a1a0: 73 20 68 61 76 65 20 61 6c 69 67 6e 6d 65 6e 74 s have alignment
a1b0: 20 38 2c 20 69 2e 65 2e 0a 20 2a 20 5f 5f 56 41 8, i.e.. * __VA
a1c0: 5f 61 6c 69 67 6e 6f 66 28 64 6f 75 62 6c 65 29 _alignof(double)
a1d0: 20 3d 20 38 2c 20 62 75 74 20 64 6f 75 62 6c 65 = 8, but double
a1e0: 73 20 28 61 6e 64 20 61 6c 73 6f 20 73 74 72 75 s (and also stru
a1f0: 63 74 75 72 65 73 20 63 6f 6e 74 61 69 6e 69 6e ctures containin
a200: 67 0a 20 2a 20 64 6f 75 62 6c 65 73 29 20 61 72 g. * doubles) ar
a210: 65 20 70 61 73 73 65 64 20 6f 6e 20 74 68 65 20 e passed on the
a220: 73 74 61 63 6b 20 77 69 74 68 20 61 6c 69 67 6e stack with align
a230: 6d 65 6e 74 20 34 2e 20 4c 6f 6f 6b 73 20 72 65 ment 4. Looks re
a240: 61 6c 6c 79 20 77 65 69 72 64 2e 0a 20 2a 2f 0a ally weird.. */.
a250: 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f 73 74 72 #define __va_str
a260: 75 63 74 5f 61 6c 69 67 6e 6d 65 6e 74 28 54 59 uct_alignment(TY
a270: 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 PE_ALIGN) \. (
a280: 28 54 59 50 45 5f 41 4c 49 47 4e 29 20 3c 3d 20 (TYPE_ALIGN) <=
a290: 34 20 3f 20 28 54 59 50 45 5f 41 4c 49 47 4e 29 4 ? (TYPE_ALIGN)
a2a0: 20 3a 20 34 29 0a 23 65 6c 73 65 0a 23 64 65 66 : 4).#else.#def
a2b0: 69 6e 65 20 5f 5f 76 61 5f 73 74 72 75 63 74 5f ine __va_struct_
a2c0: 61 6c 69 67 6e 6d 65 6e 74 28 54 59 50 45 5f 41 alignment(TYPE_A
a2d0: 4c 49 47 4e 29 20 20 5c 0a 20 20 28 54 59 50 45 LIGN) \. (TYPE
a2e0: 5f 41 4c 49 47 4e 29 0a 23 65 6e 64 69 66 0a 23 _ALIGN).#endif.#
a2f0: 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 6c 69 67 define __va_alig
a300: 6e 5f 73 74 72 75 63 74 28 4c 49 53 54 2c 54 59 n_struct(LIST,TY
a310: 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 PE_SIZE,TYPE_ALI
a320: 47 4e 29 20 20 5c 0a 20 20 28 4c 49 53 54 29 2d GN) \. (LIST)-
a330: 3e 61 70 74 72 20 3d 20 28 28 4c 49 53 54 29 2d >aptr = ((LIST)-
a340: 3e 61 70 74 72 20 2b 20 5f 5f 76 61 5f 73 74 72 >aptr + __va_str
a350: 75 63 74 5f 61 6c 69 67 6e 6d 65 6e 74 28 54 59 uct_alignment(TY
a360: 50 45 5f 41 4c 49 47 4e 29 2d 31 29 20 26 20 2d PE_ALIGN)-1) & -
a370: 28 6c 6f 6e 67 29 5f 5f 76 61 5f 73 74 72 75 63 (long)__va_struc
a380: 74 5f 61 6c 69 67 6e 6d 65 6e 74 28 54 59 50 45 t_alignment(TYPE
a390: 5f 41 4c 49 47 4e 29 2c 0a 23 69 66 20 64 65 66 _ALIGN),.#if def
a3a0: 69 6e 65 64 28 5f 5f 69 33 38 36 5f 5f 29 20 7c ined(__i386__) |
a3b0: 7c 20 64 65 66 69 6e 65 64 28 5f 5f 6d 36 38 6b | defined(__m68k
a3c0: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
a3d0: 5f 61 6c 70 68 61 5f 5f 29 20 7c 7c 20 64 65 66 _alpha__) || def
a3e0: 69 6e 65 64 28 5f 5f 61 72 6d 5f 5f 29 20 7c 7c ined(__arm__) ||
a3f0: 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 defined(__power
a400: 70 63 36 34 5f 5f 29 20 7c 7c 20 64 65 66 69 6e pc64__) || defin
a410: 65 64 28 5f 5f 6d 38 38 6b 5f 5f 29 20 7c 7c 20 ed(__m88k__) ||
a420: 64 65 66 69 6e 65 64 28 5f 5f 63 6f 6e 76 65 78 defined(__convex
a430: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
a440: 5f 78 38 36 5f 36 34 5f 5f 29 0a 23 64 65 66 69 _x86_64__).#defi
a450: 6e 65 20 5f 5f 76 61 5f 61 72 67 5f 73 74 72 75 ne __va_arg_stru
a460: 63 74 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a ct(LIST,TYPE_SIZ
a470: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c E,TYPE_ALIGN) \
a480: 0a 20 20 28 5f 5f 76 61 5f 61 6c 69 67 6e 5f 73 . (__va_align_s
a490: 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 45 5f truct(LIST,TYPE_
a4a0: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 SIZE,TYPE_ALIGN)
a4b0: 09 09 09 09 5c 0a 20 20 20 5f 5f 76 61 5f 61 72 ....\. __va_ar
a4c0: 67 5f 61 64 6a 75 73 74 65 64 28 4c 49 53 54 2c g_adjusted(LIST,
a4d0: 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 TYPE_SIZE,TYPE_A
a4e0: 4c 49 47 4e 29 09 09 09 09 5c 0a 20 20 29 0a 23 LIGN)....\. ).#
a4f0: 65 6e 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 endif.#if define
a500: 64 28 5f 5f 6d 69 70 73 5f 5f 29 20 26 26 20 21 d(__mips__) && !
a510: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 6e 33 defined(__mipsn3
a520: 32 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64 2__) && !defined
a530: 28 5f 5f 6d 69 70 73 36 34 5f 5f 29 0a 2f 2a 20 (__mips64__)./*
a540: 73 6d 61 6c 6c 20 73 74 72 75 63 74 75 72 65 73 small structures
a550: 20 3c 20 31 20 77 6f 72 64 20 61 72 65 20 61 64 < 1 word are ad
a560: 6a 75 73 74 65 64 20 64 65 70 65 6e 64 69 6e 67 justed depending
a570: 20 6f 6e 20 63 6f 6d 70 69 6c 65 72 20 2a 2f 0a on compiler */.
a580: 23 64 65 66 69 6e 65 20 5f 5f 76 61 5f 61 72 67 #define __va_arg
a590: 5f 73 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 _struct(LIST,TYP
a5a0: 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 E_SIZE,TYPE_ALIG
a5b0: 4e 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 61 6c N) \. (__va_al
a5c0: 69 67 6e 5f 73 74 72 75 63 74 28 4c 49 53 54 2c ign_struct(LIST,
a5d0: 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 TYPE_SIZE,TYPE_A
a5e0: 4c 49 47 4e 29 09 09 09 09 5c 0a 20 20 20 28 28 LIGN)....\. ((
a5f0: 4c 49 53 54 29 2d 3e 66 6c 61 67 73 20 26 20 5f LIST)->flags & _
a600: 5f 56 41 5f 53 47 49 43 43 5f 53 54 52 55 43 54 _VA_SGICC_STRUCT
a610: 5f 41 52 47 53 09 09 09 09 5c 0a 20 20 20 20 3f _ARGS....\. ?
a620: 20 2f 2a 20 53 47 49 20 4d 49 50 53 20 63 63 20 /* SGI MIPS cc
a630: 70 61 73 73 65 73 20 73 6d 61 6c 6c 20 73 74 72 passes small str
a640: 75 63 74 75 72 65 73 20 6c 65 66 74 2d 61 64 6a uctures left-adj
a650: 75 73 74 65 64 2c 20 61 6c 74 68 6f 75 67 68 20 usted, although
a660: 62 69 67 2d 65 6e 64 69 61 6e 21 20 2a 2f 5c 0a big-endian! */\.
a670: 20 20 20 20 20 20 5f 5f 76 61 5f 61 72 67 5f 6c __va_arg_l
a680: 65 66 74 61 64 6a 75 73 74 65 64 28 4c 49 53 54 eftadjusted(LIST
a690: 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f ,TYPE_SIZE,TYPE_
a6a0: 41 4c 49 47 4e 29 09 09 09 5c 0a 20 20 20 20 3a ALIGN)...\. :
a6b0: 20 2f 2a 20 53 47 49 20 4d 49 50 53 20 67 63 63 /* SGI MIPS gcc
a6c0: 20 70 61 73 73 65 73 20 73 6d 61 6c 6c 20 73 74 passes small st
a6d0: 72 75 63 74 75 72 65 73 20 77 69 74 68 69 6e 20 ructures within
a6e0: 74 68 65 20 66 69 72 73 74 20 66 6f 75 72 20 77 the first four w
a6f0: 6f 72 64 73 20 6c 65 66 74 2d 09 20 20 20 5c 0a ords left-. \.
a700: 20 20 20 20 20 20 20 2a 20 61 64 6a 75 73 74 65 * adjuste
a710: 64 2c 20 66 6f 72 20 63 6f 6d 70 61 74 69 62 69 d, for compatibi
a720: 6c 69 74 79 20 77 69 74 68 20 63 63 2e 20 42 75 lity with cc. Bu
a730: 74 20 73 74 72 75 63 74 75 72 65 73 20 69 6e 20 t structures in
a740: 6d 65 6d 6f 72 79 20 61 72 65 20 70 61 73 73 65 memory are passe
a750: 64 20 20 5c 0a 20 20 20 20 20 20 20 2a 20 72 69 d \. * ri
a760: 67 68 74 2d 61 64 6a 75 73 74 65 64 21 21 20 53 ght-adjusted!! S
a770: 65 65 20 67 63 63 2d 32 2e 36 2e 33 2f 63 6f 6e ee gcc-2.6.3/con
a780: 66 69 67 2f 6d 69 70 73 2f 6d 69 70 73 2e 63 3a fig/mips/mips.c:
a790: 66 75 6e 63 74 69 6f 6e 5f 61 72 67 28 29 2e 09 function_arg()..
a7a0: 20 20 20 5c 0a 20 20 20 20 20 20 20 2a 2f 09 09 \. */..
a7b0: 09 09 09 09 09 09 09 20 20 20 5c 0a 20 20 20 20 ....... \.
a7c0: 20 20 28 28 4c 49 53 54 29 2d 3e 61 70 74 72 20 ((LIST)->aptr
a7d0: 3c 20 28 4c 49 53 54 29 2d 3e 6d 65 6d 61 72 67 < (LIST)->memarg
a7e0: 70 74 72 09 09 09 09 09 5c 0a 20 20 20 20 20 20 ptr.....\.
a7f0: 20 3f 20 5f 5f 76 61 5f 61 72 67 5f 6c 65 66 74 ? __va_arg_left
a800: 61 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 adjusted(LIST,TY
a810: 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 PE_SIZE,TYPE_ALI
a820: 47 4e 29 09 09 5c 0a 20 20 20 20 20 20 20 3a 20 GN)..\. :
a830: 5f 5f 76 61 5f 61 72 67 5f 72 69 67 68 74 61 64 __va_arg_rightad
a840: 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 45 justed(LIST,TYPE
a850: 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e _SIZE,TYPE_ALIGN
a860: 29 09 09 5c 0a 20 20 29 29 20 20 29 0a 23 65 6e )..\. )) ).#en
a870: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
a880: 5f 5f 6d 69 70 73 6e 33 32 5f 5f 29 20 7c 7c 20 __mipsn32__) ||
a890: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 defined(__mips64
a8a0: 5f 5f 29 0a 2f 2a 20 73 6d 61 6c 6c 20 73 74 72 __)./* small str
a8b0: 75 63 74 75 72 65 73 20 3c 20 31 20 77 6f 72 64 uctures < 1 word
a8c0: 20 61 72 65 20 61 64 6a 75 73 74 65 64 20 64 65 are adjusted de
a8d0: 70 65 6e 64 69 6e 67 20 6f 6e 20 63 6f 6d 70 69 pending on compi
a8e0: 6c 65 72 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f ler */.#define _
a8f0: 5f 76 61 5f 61 72 67 5f 73 74 72 75 63 74 28 4c _va_arg_struct(L
a900: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
a910: 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 PE_ALIGN) \. (
a920: 5f 5f 76 61 5f 61 6c 69 67 6e 5f 73 74 72 75 63 __va_align_struc
a930: 74 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 t(LIST,TYPE_SIZE
a940: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 09 ,TYPE_ALIGN)....
a950: 5c 0a 20 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c \. ((LIST)->fl
a960: 61 67 73 20 26 20 5f 5f 56 41 5f 53 47 49 43 43 ags & __VA_SGICC
a970: 5f 53 54 52 55 43 54 5f 41 52 47 53 09 09 09 09 _STRUCT_ARGS....
a980: 5c 0a 20 20 20 20 3f 20 2f 2a 20 53 47 49 20 4d \. ? /* SGI M
a990: 49 50 53 20 63 63 20 70 61 73 73 65 73 20 73 6d IPS cc passes sm
a9a0: 61 6c 6c 20 73 74 72 75 63 74 75 72 65 73 20 6c all structures l
a9b0: 65 66 74 2d 61 64 6a 75 73 74 65 64 2c 20 61 6c eft-adjusted, al
a9c0: 74 68 6f 75 67 68 20 62 69 67 2d 65 6e 64 69 61 though big-endia
a9d0: 6e 21 20 2a 2f 5c 0a 20 20 20 20 20 20 5f 5f 76 n! */\. __v
a9e0: 61 5f 61 72 67 5f 6c 65 66 74 61 64 6a 75 73 74 a_arg_leftadjust
a9f0: 65 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a ed(LIST,TYPE_SIZ
aa00: 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 E,TYPE_ALIGN)...
aa10: 5c 0a 20 20 20 20 3a 20 2f 2a 20 53 47 49 20 4d \. : /* SGI M
aa20: 49 50 53 20 67 63 63 20 70 61 73 73 65 73 20 73 IPS gcc passes s
aa30: 6d 61 6c 6c 20 73 74 72 75 63 74 75 72 65 73 20 mall structures
aa40: 72 69 67 68 74 2d 61 64 6a 75 73 74 65 64 2e 20 right-adjusted.
aa50: 2a 2f 09 5c 0a 20 20 20 20 20 20 5f 5f 76 61 5f */.\. __va_
aa60: 61 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 65 arg_rightadjuste
aa70: 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 d(LIST,TYPE_SIZE
aa80: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 5c ,TYPE_ALIGN)...\
aa90: 0a 20 20 29 29 0a 23 65 6e 64 69 66 0a 23 69 66 . )).#endif.#if
aaa0: 20 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 defined(__power
aab0: 70 63 5f 5f 29 20 26 26 20 21 64 65 66 69 6e 65 pc__) && !define
aac0: 64 28 5f 5f 70 6f 77 65 72 70 63 36 34 5f 5f 29 d(__powerpc64__)
aad0: 20 26 26 20 28 64 65 66 69 6e 65 64 28 5f 41 49 && (defined(_AI
aae0: 58 29 20 7c 7c 20 28 64 65 66 69 6e 65 64 28 5f X) || (defined(_
aaf0: 5f 4d 41 43 48 5f 5f 29 20 26 26 20 64 65 66 69 _MACH__) && defi
ab00: 6e 65 64 28 5f 5f 41 50 50 4c 45 5f 5f 29 29 29 ned(__APPLE__)))
ab10: 0a 2f 2a 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 ./* small struct
ab20: 75 72 65 73 20 3c 20 31 20 77 6f 72 64 20 61 72 ures < 1 word ar
ab30: 65 20 61 64 6a 75 73 74 65 64 20 64 65 70 65 6e e adjusted depen
ab40: 64 69 6e 67 20 6f 6e 20 63 6f 6d 70 69 6c 65 72 ding on compiler
ab50: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
ab60: 5f 61 72 67 5f 73 74 72 75 63 74 28 4c 49 53 54 _arg_struct(LIST
ab70: 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f ,TYPE_SIZE,TYPE_
ab80: 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 5f 5f 76 ALIGN) \. (__v
ab90: 61 5f 61 6c 69 67 6e 5f 73 74 72 75 63 74 28 4c a_align_struct(L
aba0: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
abb0: 50 45 5f 41 4c 49 47 4e 29 09 09 09 09 5c 0a 20 PE_ALIGN)....\.
abc0: 20 20 28 28 4c 49 53 54 29 2d 3e 66 6c 61 67 73 ((LIST)->flags
abd0: 20 26 20 5f 5f 56 41 5f 41 49 58 43 43 5f 53 54 & __VA_AIXCC_ST
abe0: 52 55 43 54 5f 41 52 47 53 09 09 09 09 5c 0a 20 RUCT_ARGS....\.
abf0: 20 20 20 3f 20 2f 2a 20 41 49 58 20 63 63 20 61 ? /* AIX cc a
ac00: 6e 64 20 78 6c 63 20 70 61 73 73 20 73 6d 61 6c nd xlc pass smal
ac10: 6c 20 73 74 72 75 63 74 75 72 65 73 20 6c 65 66 l structures lef
ac20: 74 2d 61 64 6a 75 73 74 65 64 2c 20 61 6c 74 68 t-adjusted, alth
ac30: 6f 75 67 68 20 62 69 67 2d 65 6e 64 69 61 6e 21 ough big-endian!
ac40: 20 2a 2f 5c 0a 20 20 20 20 20 20 5f 5f 76 61 5f */\. __va_
ac50: 61 72 67 5f 6c 65 66 74 61 64 6a 75 73 74 65 64 arg_leftadjusted
ac60: 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c (LIST,TYPE_SIZE,
ac70: 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 5c 0a TYPE_ALIGN)...\.
ac80: 20 20 20 20 3a 20 2f 2a 20 67 63 63 20 70 61 73 : /* gcc pas
ac90: 73 65 73 20 73 6d 61 6c 6c 20 73 74 72 75 63 74 ses small struct
aca0: 75 72 65 73 20 72 69 67 68 74 2d 61 64 6a 75 73 ures right-adjus
acb0: 74 65 64 2e 20 2a 2f 09 09 09 5c 0a 20 20 20 20 ted. */...\.
acc0: 20 20 5f 5f 76 61 5f 61 72 67 5f 72 69 67 68 74 __va_arg_right
acd0: 61 64 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 adjusted(LIST,TY
ace0: 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 PE_SIZE,TYPE_ALI
acf0: 47 4e 29 09 09 09 5c 0a 20 20 29 29 0a 23 65 6e GN)...\. )).#en
ad00: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
ad10: 5f 5f 70 6f 77 65 72 70 63 5f 5f 29 20 26 26 20 __powerpc__) &&
ad20: 21 64 65 66 69 6e 65 64 28 5f 5f 70 6f 77 65 72 !defined(__power
ad30: 70 63 36 34 5f 5f 29 20 26 26 20 21 28 64 65 66 pc64__) && !(def
ad40: 69 6e 65 64 28 5f 41 49 58 29 20 7c 7c 20 28 64 ined(_AIX) || (d
ad50: 65 66 69 6e 65 64 28 5f 5f 4d 41 43 48 5f 5f 29 efined(__MACH__)
ad60: 20 26 26 20 64 65 66 69 6e 65 64 28 5f 5f 41 50 && defined(__AP
ad70: 50 4c 45 5f 5f 29 29 29 0a 2f 2a 20 53 74 72 75 PLE__)))./* Stru
ad80: 63 74 75 72 65 73 20 61 72 65 20 70 61 73 73 65 ctures are passe
ad90: 64 20 61 73 20 70 6f 69 6e 74 65 72 73 20 74 6f d as pointers to
ada0: 20 63 61 6c 6c 65 72 2d 6d 61 64 65 20 6c 6f 63 caller-made loc
adb0: 61 6c 20 63 6f 70 69 65 73 2e 20 2a 2f 0a 23 64 al copies. */.#d
adc0: 65 66 69 6e 65 20 5f 5f 76 61 5f 61 72 67 5f 73 efine __va_arg_s
add0: 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 45 5f truct(LIST,TYPE_
ade0: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 29 SIZE,TYPE_ALIGN)
adf0: 20 20 5c 0a 20 20 76 61 5f 61 72 67 5f 70 74 72 \. va_arg_ptr
ae00: 28 4c 49 53 54 2c 76 6f 69 64 2a 29 0a 23 65 6e (LIST,void*).#en
ae10: 64 69 66 0a 23 69 66 20 64 65 66 69 6e 65 64 28 dif.#if defined(
ae20: 5f 5f 73 70 61 72 63 5f 5f 29 20 26 26 20 21 64 __sparc__) && !d
ae30: 65 66 69 6e 65 64 28 5f 5f 73 70 61 72 63 36 34 efined(__sparc64
ae40: 5f 5f 29 0a 2f 2a 20 53 74 72 75 63 74 75 72 65 __)./* Structure
ae50: 73 20 61 72 65 20 70 61 73 73 65 64 20 61 73 20 s are passed as
ae60: 70 6f 69 6e 74 65 72 73 20 74 6f 20 63 61 6c 6c pointers to call
ae70: 65 72 2d 6d 61 64 65 20 6c 6f 63 61 6c 20 63 6f er-made local co
ae80: 70 69 65 73 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 pies. */.#define
ae90: 20 5f 5f 76 61 5f 61 72 67 5f 73 74 72 75 63 74 __va_arg_struct
aea0: 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c (LIST,TYPE_SIZE,
aeb0: 54 59 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 TYPE_ALIGN) \.
aec0: 20 76 61 5f 61 72 67 5f 70 74 72 28 4c 49 53 54 va_arg_ptr(LIST
aed0: 2c 76 6f 69 64 2a 29 0a 23 65 6e 64 69 66 0a 23 ,void*).#endif.#
aee0: 69 66 20 64 65 66 69 6e 65 64 28 5f 5f 73 70 61 if defined(__spa
aef0: 72 63 36 34 5f 5f 29 0a 2f 2a 20 53 6d 61 6c 6c rc64__)./* Small
af00: 20 73 74 72 75 63 74 75 72 65 73 20 61 72 65 20 structures are
af10: 70 61 73 73 65 64 20 6c 65 66 74 2d 61 64 6a 75 passed left-adju
af20: 73 74 65 64 2c 20 61 6c 74 68 6f 75 67 68 20 62 sted, although b
af30: 69 67 2d 65 6e 64 69 61 6e 21 20 2a 2f 0a 2f 2a ig-endian! */./*
af40: 20 42 69 67 20 73 74 72 75 63 74 75 72 65 73 20 Big structures
af50: 61 72 65 20 70 61 73 73 65 64 20 61 73 20 70 6f are passed as po
af60: 69 6e 74 65 72 73 20 74 6f 20 63 61 6c 6c 65 72 inters to caller
af70: 2d 6d 61 64 65 20 6c 6f 63 61 6c 20 63 6f 70 69 -made local copi
af80: 65 73 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f es. */.#define _
af90: 5f 76 61 5f 61 72 67 5f 73 74 72 75 63 74 28 4c _va_arg_struct(L
afa0: 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 IST,TYPE_SIZE,TY
afb0: 50 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 PE_ALIGN) \. (
afc0: 28 54 59 50 45 5f 53 49 5a 45 29 20 3c 3d 20 31 (TYPE_SIZE) <= 1
afd0: 36 09 09 09 09 09 09 09 5c 0a 20 20 20 3f 20 28 6.......\. ? (
afe0: 5f 5f 76 61 5f 61 6c 69 67 6e 5f 73 74 72 75 63 __va_align_struc
aff0: 74 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 t(LIST,TYPE_SIZE
b000: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 5c ,TYPE_ALIGN)...\
b010: 0a 20 20 20 20 20 20 5f 5f 76 61 5f 61 72 67 5f . __va_arg_
b020: 6c 65 66 74 61 64 6a 75 73 74 65 64 28 4c 49 53 leftadjusted(LIS
b030: 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 T,TYPE_SIZE,TYPE
b040: 5f 41 4c 49 47 4e 29 29 09 09 09 5c 0a 20 20 20 _ALIGN))...\.
b050: 3a 20 76 61 5f 61 72 67 5f 70 74 72 28 4c 49 53 : va_arg_ptr(LIS
b060: 54 2c 76 6f 69 64 2a 29 09 09 09 09 09 09 5c 0a T,void*)......\.
b070: 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 ).#endif.#if d
b080: 65 66 69 6e 65 64 28 5f 5f 73 33 39 30 5f 5f 29 efined(__s390__)
b090: 0a 2f 2a 20 53 74 72 75 63 74 75 72 65 73 20 3c ./* Structures <
b0a0: 3d 20 38 20 62 79 74 65 73 20 61 72 65 20 70 61 = 8 bytes are pa
b0b0: 73 73 65 64 20 61 73 20 65 6d 62 65 64 64 65 64 ssed as embedded
b0c0: 20 63 6f 70 69 65 73 20 6f 6e 20 74 68 65 20 61 copies on the a
b0d0: 72 67 20 73 74 61 63 6b 2e 0a 20 2a 20 42 69 67 rg stack.. * Big
b0e0: 20 73 74 72 75 63 74 75 72 65 73 20 61 72 65 20 structures are
b0f0: 70 61 73 73 65 64 20 61 73 20 70 6f 69 6e 74 65 passed as pointe
b100: 72 73 20 74 6f 20 63 61 6c 6c 65 72 2d 6d 61 64 rs to caller-mad
b110: 65 20 6c 6f 63 61 6c 20 63 6f 70 69 65 73 2e 0a e local copies..
b120: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
b130: 5f 61 72 67 5f 73 74 72 75 63 74 28 4c 49 53 54 _arg_struct(LIST
b140: 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f ,TYPE_SIZE,TYPE_
b150: 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 28 54 59 ALIGN) \. ((TY
b160: 50 45 5f 53 49 5a 45 29 20 21 3d 20 31 20 26 26 PE_SIZE) != 1 &&
b170: 20 28 54 59 50 45 5f 53 49 5a 45 29 20 21 3d 20 (TYPE_SIZE) !=
b180: 32 20 26 26 20 28 54 59 50 45 5f 53 49 5a 45 29 2 && (TYPE_SIZE)
b190: 20 21 3d 20 34 20 26 26 20 28 54 59 50 45 5f 53 != 4 && (TYPE_S
b1a0: 49 5a 45 29 20 21 3d 20 38 20 5c 0a 20 20 20 3f IZE) != 8 \. ?
b1b0: 20 76 61 5f 61 72 67 5f 70 74 72 28 4c 49 53 54 va_arg_ptr(LIST
b1c0: 2c 76 6f 69 64 2a 29 09 09 09 09 09 09 5c 0a 20 ,void*)......\.
b1d0: 20 20 3a 20 28 76 6f 69 64 2a 29 5f 5f 76 61 5f : (void*)__va_
b1e0: 61 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 65 arg_rightadjuste
b1f0: 64 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 d(LIST,TYPE_SIZE
b200: 2c 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 5c 0a ,TYPE_ALIGN)..\.
b210: 20 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 ).#endif.#if d
b220: 65 66 69 6e 65 64 28 5f 5f 68 70 70 61 5f 5f 29 efined(__hppa__)
b230: 0a 2f 2a 20 53 74 72 75 63 74 75 72 65 73 20 3c ./* Structures <
b240: 3d 20 38 20 62 79 74 65 73 20 61 72 65 20 70 61 = 8 bytes are pa
b250: 73 73 65 64 20 61 73 20 65 6d 62 65 64 64 65 64 ssed as embedded
b260: 20 63 6f 70 69 65 73 20 6f 6e 20 74 68 65 20 61 copies on the a
b270: 72 67 20 73 74 61 63 6b 2e 0a 20 2a 20 42 69 67 rg stack.. * Big
b280: 20 73 74 72 75 63 74 75 72 65 73 20 61 72 65 20 structures are
b290: 70 61 73 73 65 64 20 61 73 20 70 6f 69 6e 74 65 passed as pointe
b2a0: 72 73 20 74 6f 20 63 61 6c 6c 65 72 2d 6d 61 64 rs to caller-mad
b2b0: 65 20 6c 6f 63 61 6c 20 63 6f 70 69 65 73 2e 0a e local copies..
b2c0: 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f 76 61 */.#define __va
b2d0: 5f 61 72 67 5f 73 74 72 75 63 74 28 4c 49 53 54 _arg_struct(LIST
b2e0: 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 45 5f ,TYPE_SIZE,TYPE_
b2f0: 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 28 54 59 ALIGN) \. ((TY
b300: 50 45 5f 53 49 5a 45 29 20 3e 20 38 09 09 09 09 PE_SIZE) > 8....
b310: 09 09 09 5c 0a 20 20 20 3f 20 76 61 5f 61 72 67 ...\. ? va_arg
b320: 5f 70 74 72 28 4c 49 53 54 2c 76 6f 69 64 2a 29 _ptr(LIST,void*)
b330: 09 09 09 09 09 09 5c 0a 20 20 20 3a 20 2f 2a 20 ......\. : /*
b340: 46 49 58 4d 45 3a 20 67 63 63 2d 32 2e 36 2e 33 FIXME: gcc-2.6.3
b350: 20 70 61 73 73 65 73 20 73 74 72 75 63 74 75 72 passes structur
b360: 65 73 20 3c 3d 20 34 20 62 79 74 65 73 20 69 6e es <= 4 bytes in
b370: 20 6d 65 6d 6f 72 79 20 6c 65 66 74 2d 61 64 6a memory left-adj
b380: 75 73 74 65 64 21 20 3f 3f 20 2a 2f 5c 0a 20 20 usted! ?? */\.
b390: 20 20 20 28 76 6f 69 64 2a 29 5f 5f 76 61 5f 61 (void*)__va_a
b3a0: 72 67 5f 72 69 67 68 74 61 64 6a 75 73 74 65 64 rg_rightadjusted
b3b0: 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c (LIST,TYPE_SIZE,
b3c0: 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 5c 0a 20 TYPE_ALIGN)..\.
b3d0: 20 29 0a 23 65 6e 64 69 66 0a 23 69 66 20 64 65 ).#endif.#if de
b3e0: 66 69 6e 65 64 28 5f 5f 69 61 36 34 5f 5f 29 0a fined(__ia64__).
b3f0: 2f 2a 20 54 79 70 65 73 20 6c 61 72 67 65 72 20 /* Types larger
b400: 74 68 61 6e 20 61 20 77 6f 72 64 20 68 61 76 65 than a word have
b410: 20 32 2d 77 6f 72 64 20 61 6c 69 67 6e 6d 65 6e 2-word alignmen
b420: 74 2e 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f t. */.#define __
b430: 76 61 5f 61 72 67 5f 73 74 72 75 63 74 28 4c 49 va_arg_struct(LI
b440: 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 ST,TYPE_SIZE,TYP
b450: 45 5f 41 4c 49 47 4e 29 20 20 5c 0a 20 20 28 5f E_ALIGN) \. (_
b460: 5f 76 61 5f 61 6c 69 67 6e 5f 73 74 72 75 63 74 _va_align_struct
b470: 28 4c 49 53 54 2c 54 59 50 45 5f 53 49 5a 45 2c (LIST,TYPE_SIZE,
b480: 54 59 50 45 5f 41 4c 49 47 4e 29 09 09 09 09 5c TYPE_ALIGN)....\
b490: 0a 20 20 20 28 28 54 59 50 45 5f 53 49 5a 45 29 . ((TYPE_SIZE)
b4a0: 20 3e 20 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f > sizeof(__vawo
b4b0: 72 64 29 20 26 26 20 28 28 28 5f 5f 76 61 77 6f rd) && (((__vawo
b4c0: 72 64 2a 29 28 4c 49 53 54 29 2d 3e 61 70 74 72 rd*)(LIST)->aptr
b4d0: 20 2d 20 28 4c 49 53 54 29 2d 3e 73 61 70 74 72 - (LIST)->saptr
b4e0: 29 20 26 20 31 29 20 3f 20 28 4c 49 53 54 29 2d ) & 1) ? (LIST)-
b4f0: 3e 61 70 74 72 20 2b 3d 20 73 69 7a 65 6f 66 28 >aptr += sizeof(
b500: 5f 5f 76 61 77 6f 72 64 29 20 3a 20 30 29 2c 20 __vaword) : 0),
b510: 5c 0a 20 20 20 5f 5f 76 61 5f 61 72 67 5f 61 64 \. __va_arg_ad
b520: 6a 75 73 74 65 64 28 4c 49 53 54 2c 54 59 50 45 justed(LIST,TYPE
b530: 5f 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e _SIZE,TYPE_ALIGN
b540: 29 09 09 09 09 5c 0a 20 20 29 0a 23 65 6e 64 69 )....\. ).#endi
b550: 66 0a 0a 0a 2f 2a 0a 20 2a 20 44 65 66 69 6e 69 f.../*. * Defini
b560: 74 69 6f 6e 20 6f 66 20 74 68 65 20 76 61 5f 72 tion of the va_r
b570: 65 74 75 72 6e 5f 78 78 78 20 6d 61 63 72 6f 73 eturn_xxx macros
b580: 2e 0a 20 2a 2f 0a 23 64 65 66 69 6e 65 20 5f 5f .. */.#define __
b590: 76 61 5f 72 65 74 75 72 6e 28 4c 49 53 54 2c 52 va_return(LIST,R
b5a0: 45 54 54 59 50 45 29 20 20 5c 0a 20 20 28 28 28 ETTYPE) \. (((
b5b0: 4c 49 53 54 29 2d 3e 72 74 79 70 65 20 3d 3d 20 LIST)->rtype ==
b5c0: 28 52 45 54 54 59 50 45 29 29 20 7c 7c 20 5f 5f (RETTYPE)) || __
b5d0: 76 61 5f 65 72 72 6f 72 31 28 28 4c 49 53 54 29 va_error1((LIST)
b5e0: 2d 3e 72 74 79 70 65 2c 52 45 54 54 59 50 45 29 ->rtype,RETTYPE)
b5f0: 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 72 65 74 ).#define va_ret
b600: 75 72 6e 5f 76 6f 69 64 28 4c 49 53 54 29 20 20 urn_void(LIST)
b610: 5c 0a 20 20 5f 5f 76 61 5f 72 65 74 75 72 6e 28 \. __va_return(
b620: 4c 49 53 54 2c 5f 5f 56 41 76 6f 69 64 29 0a 23 LIST,__VAvoid).#
b630: 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e define va_return
b640: 5f 63 68 61 72 28 4c 49 53 54 2c 56 41 4c 29 20 _char(LIST,VAL)
b650: 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 \. (__va_retur
b660: 6e 28 4c 49 53 54 2c 5f 5f 56 41 63 68 61 72 29 n(LIST,__VAchar)
b670: 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 63 , (LIST)->tmp._c
b680: 68 61 72 20 3d 20 28 56 41 4c 29 29 0a 23 64 65 har = (VAL)).#de
b690: 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 73 fine va_return_s
b6a0: 63 68 61 72 28 4c 49 53 54 2c 56 41 4c 29 20 20 char(LIST,VAL)
b6b0: 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e \. (__va_return
b6c0: 28 4c 49 53 54 2c 5f 5f 56 41 73 63 68 61 72 29 (LIST,__VAschar)
b6d0: 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 73 , (LIST)->tmp._s
b6e0: 63 68 61 72 20 3d 20 28 56 41 4c 29 29 0a 23 64 char = (VAL)).#d
b6f0: 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f efine va_return_
b700: 75 63 68 61 72 28 4c 49 53 54 2c 56 41 4c 29 20 uchar(LIST,VAL)
b710: 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 \. (__va_retur
b720: 6e 28 4c 49 53 54 2c 5f 5f 56 41 75 63 68 61 72 n(LIST,__VAuchar
b730: 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f ), (LIST)->tmp._
b740: 75 63 68 61 72 20 3d 20 28 56 41 4c 29 29 0a 23 uchar = (VAL)).#
b750: 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e define va_return
b760: 5f 73 68 6f 72 74 28 4c 49 53 54 2c 56 41 4c 29 _short(LIST,VAL)
b770: 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 \. (__va_retu
b780: 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 73 68 6f 72 rn(LIST,__VAshor
b790: 74 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e t), (LIST)->tmp.
b7a0: 5f 73 68 6f 72 74 20 3d 20 28 56 41 4c 29 29 0a _short = (VAL)).
b7b0: 23 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 #define va_retur
b7c0: 6e 5f 75 73 68 6f 72 74 28 4c 49 53 54 2c 56 41 n_ushort(LIST,VA
b7d0: 4c 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 L) \. (__va_re
b7e0: 74 75 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 75 73 turn(LIST,__VAus
b7f0: 68 6f 72 74 29 2c 20 28 4c 49 53 54 29 2d 3e 74 hort), (LIST)->t
b800: 6d 70 2e 5f 75 73 68 6f 72 74 20 3d 20 28 56 41 mp._ushort = (VA
b810: 4c 29 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 72 L)).#define va_r
b820: 65 74 75 72 6e 5f 69 6e 74 28 4c 49 53 54 2c 56 eturn_int(LIST,V
b830: 41 4c 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 AL) \. (__va_r
b840: 65 74 75 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 69 eturn(LIST,__VAi
b850: 6e 74 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 nt), (LIST)->tmp
b860: 2e 5f 69 6e 74 20 3d 20 28 56 41 4c 29 29 0a 23 ._int = (VAL)).#
b870: 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e define va_return
b880: 5f 75 69 6e 74 28 4c 49 53 54 2c 56 41 4c 29 20 _uint(LIST,VAL)
b890: 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 \. (__va_retur
b8a0: 6e 28 4c 49 53 54 2c 5f 5f 56 41 75 69 6e 74 29 n(LIST,__VAuint)
b8b0: 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 75 , (LIST)->tmp._u
b8c0: 69 6e 74 20 3d 20 28 56 41 4c 29 29 0a 23 64 65 int = (VAL)).#de
b8d0: 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 6c fine va_return_l
b8e0: 6f 6e 67 28 4c 49 53 54 2c 56 41 4c 29 20 20 5c ong(LIST,VAL) \
b8f0: 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e 28 . (__va_return(
b900: 4c 49 53 54 2c 5f 5f 56 41 6c 6f 6e 67 29 2c 20 LIST,__VAlong),
b910: 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 6c 6f 6e (LIST)->tmp._lon
b920: 67 20 3d 20 28 56 41 4c 29 29 0a 23 64 65 66 69 g = (VAL)).#defi
b930: 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 75 6c 6f ne va_return_ulo
b940: 6e 67 28 4c 49 53 54 2c 56 41 4c 29 20 20 5c 0a ng(LIST,VAL) \.
b950: 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e 28 4c (__va_return(L
b960: 49 53 54 2c 5f 5f 56 41 75 6c 6f 6e 67 29 2c 20 IST,__VAulong),
b970: 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 75 6c 6f (LIST)->tmp._ulo
b980: 6e 67 20 3d 20 28 56 41 4c 29 29 0a 23 69 66 20 ng = (VAL)).#if
b990: 64 65 66 69 6e 65 64 28 5f 5f 6d 69 70 73 36 34 defined(__mips64
b9a0: 5f 5f 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f __) || defined(_
b9b0: 5f 73 70 61 72 63 36 34 5f 5f 29 20 7c 7c 20 64 _sparc64__) || d
b9c0: 65 66 69 6e 65 64 28 5f 5f 61 6c 70 68 61 5f 5f efined(__alpha__
b9d0: 29 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 70 ) || defined(__p
b9e0: 6f 77 65 72 70 63 36 34 5f 5f 29 20 7c 7c 20 64 owerpc64__) || d
b9f0: 65 66 69 6e 65 64 28 5f 5f 69 61 36 34 5f 5f 29 efined(__ia64__)
ba00: 20 7c 7c 20 64 65 66 69 6e 65 64 28 5f 5f 78 38 || defined(__x8
ba10: 36 5f 36 34 5f 5f 29 0a 23 64 65 66 69 6e 65 20 6_64__).#define
ba20: 76 61 5f 72 65 74 75 72 6e 5f 6c 6f 6e 67 6c 6f va_return_longlo
ba30: 6e 67 28 4c 49 53 54 2c 56 41 4c 29 20 20 5c 0a ng(LIST,VAL) \.
ba40: 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e 28 4c (__va_return(L
ba50: 49 53 54 2c 5f 5f 56 41 6c 6f 6e 67 6c 6f 6e 67 IST,__VAlonglong
ba60: 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f ), (LIST)->tmp._
ba70: 6c 6f 6e 67 20 3d 20 28 56 41 4c 29 29 0a 23 64 long = (VAL)).#d
ba80: 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f efine va_return_
ba90: 75 6c 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 2c 56 ulonglong(LIST,V
baa0: 41 4c 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 AL) \. (__va_r
bab0: 65 74 75 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 75 eturn(LIST,__VAu
bac0: 6c 6f 6e 67 6c 6f 6e 67 29 2c 20 28 4c 49 53 54 longlong), (LIST
bad0: 29 2d 3e 74 6d 70 2e 5f 75 6c 6f 6e 67 20 3d 20 )->tmp._ulong =
bae0: 28 56 41 4c 29 29 0a 23 65 6c 73 65 0a 23 64 65 (VAL)).#else.#de
baf0: 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 6c fine va_return_l
bb00: 6f 6e 67 6c 6f 6e 67 28 4c 49 53 54 2c 56 41 4c onglong(LIST,VAL
bb10: 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 ) \. (__va_ret
bb20: 75 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 6c 6f 6e urn(LIST,__VAlon
bb30: 67 6c 6f 6e 67 29 2c 20 28 4c 49 53 54 29 2d 3e glong), (LIST)->
bb40: 74 6d 70 2e 5f 6c 6f 6e 67 6c 6f 6e 67 20 3d 20 tmp._longlong =
bb50: 28 56 41 4c 29 29 0a 23 64 65 66 69 6e 65 20 76 (VAL)).#define v
bb60: 61 5f 72 65 74 75 72 6e 5f 75 6c 6f 6e 67 6c 6f a_return_ulonglo
bb70: 6e 67 28 4c 49 53 54 2c 56 41 4c 29 20 20 5c 0a ng(LIST,VAL) \.
bb80: 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e 28 4c (__va_return(L
bb90: 49 53 54 2c 5f 5f 56 41 75 6c 6f 6e 67 6c 6f 6e IST,__VAulonglon
bba0: 67 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e g), (LIST)->tmp.
bbb0: 5f 75 6c 6f 6e 67 6c 6f 6e 67 20 3d 20 28 56 41 _ulonglong = (VA
bbc0: 4c 29 29 0a 23 65 6e 64 69 66 0a 23 64 65 66 69 L)).#endif.#defi
bbd0: 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 66 6c 6f ne va_return_flo
bbe0: 61 74 28 4c 49 53 54 2c 56 41 4c 29 20 20 5c 0a at(LIST,VAL) \.
bbf0: 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e 28 4c (__va_return(L
bc00: 49 53 54 2c 5f 5f 56 41 66 6c 6f 61 74 29 2c 20 IST,__VAfloat),
bc10: 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f 66 6c 6f (LIST)->tmp._flo
bc20: 61 74 20 3d 20 28 56 41 4c 29 29 0a 23 64 65 66 at = (VAL)).#def
bc30: 69 6e 65 20 76 61 5f 72 65 74 75 72 6e 5f 64 6f ine va_return_do
bc40: 75 62 6c 65 28 4c 49 53 54 2c 56 41 4c 29 20 20 uble(LIST,VAL)
bc50: 5c 0a 20 20 28 5f 5f 76 61 5f 72 65 74 75 72 6e \. (__va_return
bc60: 28 4c 49 53 54 2c 5f 5f 56 41 64 6f 75 62 6c 65 (LIST,__VAdouble
bc70: 29 2c 20 28 4c 49 53 54 29 2d 3e 74 6d 70 2e 5f ), (LIST)->tmp._
bc80: 64 6f 75 62 6c 65 20 3d 20 28 56 41 4c 29 29 0a double = (VAL)).
bc90: 23 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 #define va_retur
bca0: 6e 5f 70 74 72 28 4c 49 53 54 2c 54 59 50 45 2c n_ptr(LIST,TYPE,
bcb0: 56 41 4c 29 20 20 5c 0a 20 20 28 5f 5f 76 61 5f VAL) \. (__va_
bcc0: 72 65 74 75 72 6e 28 4c 49 53 54 2c 5f 5f 56 41 return(LIST,__VA
bcd0: 76 6f 69 64 70 29 2c 20 28 4c 49 53 54 29 2d 3e voidp), (LIST)->
bce0: 74 6d 70 2e 5f 70 74 72 20 3d 20 28 76 6f 69 64 tmp._ptr = (void
bcf0: 2a 29 28 54 59 50 45 29 28 56 41 4c 29 29 0a 23 *)(TYPE)(VAL)).#
bd00: 64 65 66 69 6e 65 20 76 61 5f 72 65 74 75 72 6e define va_return
bd10: 5f 73 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 _struct(LIST,TYP
bd20: 45 2c 56 41 4c 29 20 20 5c 0a 20 20 28 5f 5f 76 E,VAL) \. (__v
bd30: 61 5f 72 65 74 75 72 6e 28 4c 49 53 54 2c 5f 5f a_return(LIST,__
bd40: 56 41 73 74 72 75 63 74 29 2c 20 2a 28 54 59 50 VAstruct), *(TYP
bd50: 45 2a 29 28 28 4c 49 53 54 29 2d 3e 72 61 64 64 E*)((LIST)->radd
bd60: 72 29 20 3d 20 28 56 41 4c 29 29 0a 23 64 65 66 r) = (VAL)).#def
bd70: 69 6e 65 20 5f 76 61 5f 72 65 74 75 72 6e 5f 73 ine _va_return_s
bd80: 74 72 75 63 74 28 4c 49 53 54 2c 54 59 50 45 5f truct(LIST,TYPE_
bd90: 53 49 5a 45 2c 54 59 50 45 5f 41 4c 49 47 4e 2c SIZE,TYPE_ALIGN,
bda0: 56 41 4c 5f 41 44 44 52 29 20 20 5c 0a 20 20 28 VAL_ADDR) \. (
bdb0: 5f 5f 76 61 5f 72 65 74 75 72 6e 28 4c 49 53 54 __va_return(LIST
bdc0: 2c 5f 5f 56 41 73 74 72 75 63 74 29 2c 09 09 09 ,__VAstruct),...
bdd0: 09 09 5c 0a 20 20 20 5f 5f 73 74 72 75 63 74 63 ..\. __structc
bde0: 70 79 28 28 76 6f 69 64 2a 29 28 28 4c 49 53 54 py((void*)((LIST
bdf0: 29 2d 3e 72 61 64 64 72 29 2c 56 41 4c 5f 41 44 )->raddr),VAL_AD
be00: 44 52 2c 54 59 50 45 5f 53 49 5a 45 2c 54 59 50 DR,TYPE_SIZE,TYP
be10: 45 5f 41 4c 49 47 4e 29 09 5c 0a 20 20 29 0a 0a E_ALIGN).\. )..
be20: 0a 2f 2a 20 44 65 74 65 72 6d 69 6e 65 20 77 68 ./* Determine wh
be30: 65 74 68 65 72 20 61 20 73 74 72 75 63 74 20 74 ether a struct t
be40: 79 70 65 20 69 73 20 77 6f 72 64 2d 73 70 6c 69 ype is word-spli
be50: 74 74 61 62 6c 65 2c 20 69 2e 65 2e 20 77 68 65 ttable, i.e. whe
be60: 74 68 65 72 20 65 61 63 68 20 6f 66 0a 20 2a 20 ther each of. *
be70: 69 74 73 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 66 its components f
be80: 69 74 20 69 6e 74 6f 20 61 20 72 65 67 69 73 74 it into a regist
be90: 65 72 2e 0a 20 2a 20 54 68 65 20 65 6e 74 69 72 er.. * The entir
bea0: 65 20 63 6f 6d 70 75 74 61 74 69 6f 6e 20 69 73 e computation is
beb0: 20 64 6f 6e 65 20 61 74 20 63 6f 6d 70 69 6c 65 done at compile
bec0: 20 74 69 6d 65 2e 0a 20 2a 2f 0a 23 64 65 66 69 time.. */.#defi
bed0: 6e 65 20 76 61 5f 77 6f 72 64 5f 73 70 6c 69 74 ne va_word_split
bee0: 74 61 62 6c 65 5f 31 28 73 6c 6f 74 31 29 20 20 table_1(slot1)
bef0: 5c 0a 20 20 28 5f 5f 76 61 5f 6f 66 66 73 65 74 \. (__va_offset
bf00: 31 28 73 6c 6f 74 31 29 2f 73 69 7a 65 6f 66 28 1(slot1)/sizeof(
bf10: 5f 5f 76 61 77 6f 72 64 29 20 3d 3d 20 28 5f 5f __vaword) == (__
bf20: 76 61 5f 6f 66 66 73 65 74 31 28 73 6c 6f 74 31 va_offset1(slot1
bf30: 29 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 31 29 2d )+sizeof(slot1)-
bf40: 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 1)/sizeof(__vawo
bf50: 72 64 29 29 0a 23 64 65 66 69 6e 65 20 76 61 5f rd)).#define va_
bf60: 77 6f 72 64 5f 73 70 6c 69 74 74 61 62 6c 65 5f word_splittable_
bf70: 32 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 29 20 20 2(slot1,slot2)
bf80: 5c 0a 20 20 28 28 5f 5f 76 61 5f 6f 66 66 73 65 \. ((__va_offse
bf90: 74 31 28 73 6c 6f 74 31 29 2f 73 69 7a 65 6f 66 t1(slot1)/sizeof
bfa0: 28 5f 5f 76 61 77 6f 72 64 29 20 3d 3d 20 28 5f (__vaword) == (_
bfb0: 5f 76 61 5f 6f 66 66 73 65 74 31 28 73 6c 6f 74 _va_offset1(slot
bfc0: 31 29 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 31 29 1)+sizeof(slot1)
bfd0: 2d 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 -1)/sizeof(__vaw
bfe0: 6f 72 64 29 29 20 5c 0a 20 20 20 26 26 20 28 5f ord)) \. && (_
bff0: 5f 76 61 5f 6f 66 66 73 65 74 32 28 73 6c 6f 74 _va_offset2(slot
c000: 31 2c 73 6c 6f 74 32 29 2f 73 69 7a 65 6f 66 28 1,slot2)/sizeof(
c010: 5f 5f 76 61 77 6f 72 64 29 20 3d 3d 20 28 5f 5f __vaword) == (__
c020: 76 61 5f 6f 66 66 73 65 74 32 28 73 6c 6f 74 31 va_offset2(slot1
c030: 2c 73 6c 6f 74 32 29 2b 73 69 7a 65 6f 66 28 73 ,slot2)+sizeof(s
c040: 6c 6f 74 32 29 2d 31 29 2f 73 69 7a 65 6f 66 28 lot2)-1)/sizeof(
c050: 5f 5f 76 61 77 6f 72 64 29 29 20 5c 0a 20 20 29 __vaword)) \. )
c060: 0a 23 64 65 66 69 6e 65 20 76 61 5f 77 6f 72 64 .#define va_word
c070: 5f 73 70 6c 69 74 74 61 62 6c 65 5f 33 28 73 6c _splittable_3(sl
c080: 6f 74 31 2c 73 6c 6f 74 32 2c 73 6c 6f 74 33 29 ot1,slot2,slot3)
c090: 20 20 5c 0a 20 20 28 28 5f 5f 76 61 5f 6f 66 66 \. ((__va_off
c0a0: 73 65 74 31 28 73 6c 6f 74 31 29 2f 73 69 7a 65 set1(slot1)/size
c0b0: 6f 66 28 5f 5f 76 61 77 6f 72 64 29 20 3d 3d 20 of(__vaword) ==
c0c0: 28 5f 5f 76 61 5f 6f 66 66 73 65 74 31 28 73 6c (__va_offset1(sl
c0d0: 6f 74 31 29 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 ot1)+sizeof(slot
c0e0: 31 29 2d 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 1)-1)/sizeof(__v
c0f0: 61 77 6f 72 64 29 29 20 5c 0a 20 20 20 26 26 20 aword)) \. &&
c100: 28 5f 5f 76 61 5f 6f 66 66 73 65 74 32 28 73 6c (__va_offset2(sl
c110: 6f 74 31 2c 73 6c 6f 74 32 29 2f 73 69 7a 65 6f ot1,slot2)/sizeo
c120: 66 28 5f 5f 76 61 77 6f 72 64 29 20 3d 3d 20 28 f(__vaword) == (
c130: 5f 5f 76 61 5f 6f 66 66 73 65 74 32 28 73 6c 6f __va_offset2(slo
c140: 74 31 2c 73 6c 6f 74 32 29 2b 73 69 7a 65 6f 66 t1,slot2)+sizeof
c150: 28 73 6c 6f 74 32 29 2d 31 29 2f 73 69 7a 65 6f (slot2)-1)/sizeo
c160: 66 28 5f 5f 76 61 77 6f 72 64 29 29 20 5c 0a 20 f(__vaword)) \.
c170: 20 20 26 26 20 28 5f 5f 76 61 5f 6f 66 66 73 65 && (__va_offse
c180: 74 33 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 2c 73 t3(slot1,slot2,s
c190: 6c 6f 74 33 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 lot3)/sizeof(__v
c1a0: 61 77 6f 72 64 29 20 3d 3d 20 28 5f 5f 76 61 5f aword) == (__va_
c1b0: 6f 66 66 73 65 74 33 28 73 6c 6f 74 31 2c 73 6c offset3(slot1,sl
c1c0: 6f 74 32 2c 73 6c 6f 74 33 29 2b 73 69 7a 65 6f ot2,slot3)+sizeo
c1d0: 66 28 73 6c 6f 74 33 29 2d 31 29 2f 73 69 7a 65 f(slot3)-1)/size
c1e0: 6f 66 28 5f 5f 76 61 77 6f 72 64 29 29 20 5c 0a of(__vaword)) \.
c1f0: 20 20 29 0a 23 64 65 66 69 6e 65 20 76 61 5f 77 ).#define va_w
c200: 6f 72 64 5f 73 70 6c 69 74 74 61 62 6c 65 5f 34 ord_splittable_4
c210: 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 2c 73 6c 6f (slot1,slot2,slo
c220: 74 33 2c 73 6c 6f 74 34 29 20 20 5c 0a 20 20 28 t3,slot4) \. (
c230: 28 5f 5f 76 61 5f 6f 66 66 73 65 74 31 28 73 6c (__va_offset1(sl
c240: 6f 74 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 ot1)/sizeof(__va
c250: 77 6f 72 64 29 20 3d 3d 20 28 5f 5f 76 61 5f 6f word) == (__va_o
c260: 66 66 73 65 74 31 28 73 6c 6f 74 31 29 2b 73 69 ffset1(slot1)+si
c270: 7a 65 6f 66 28 73 6c 6f 74 31 29 2d 31 29 2f 73 zeof(slot1)-1)/s
c280: 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 29 izeof(__vaword))
c290: 20 5c 0a 20 20 20 26 26 20 28 5f 5f 76 61 5f 6f \. && (__va_o
c2a0: 66 66 73 65 74 32 28 73 6c 6f 74 31 2c 73 6c 6f ffset2(slot1,slo
c2b0: 74 32 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 t2)/sizeof(__vaw
c2c0: 6f 72 64 29 20 3d 3d 20 28 5f 5f 76 61 5f 6f 66 ord) == (__va_of
c2d0: 66 73 65 74 32 28 73 6c 6f 74 31 2c 73 6c 6f 74 fset2(slot1,slot
c2e0: 32 29 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 32 29 2)+sizeof(slot2)
c2f0: 2d 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 -1)/sizeof(__vaw
c300: 6f 72 64 29 29 20 5c 0a 20 20 20 26 26 20 28 5f ord)) \. && (_
c310: 5f 76 61 5f 6f 66 66 73 65 74 33 28 73 6c 6f 74 _va_offset3(slot
c320: 31 2c 73 6c 6f 74 32 2c 73 6c 6f 74 33 29 2f 73 1,slot2,slot3)/s
c330: 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 64 29 20 izeof(__vaword)
c340: 3d 3d 20 28 5f 5f 76 61 5f 6f 66 66 73 65 74 33 == (__va_offset3
c350: 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 2c 73 6c 6f (slot1,slot2,slo
c360: 74 33 29 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 33 t3)+sizeof(slot3
c370: 29 2d 31 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 )-1)/sizeof(__va
c380: 77 6f 72 64 29 29 20 5c 0a 20 20 20 26 26 20 28 word)) \. && (
c390: 5f 5f 76 61 5f 6f 66 66 73 65 74 34 28 73 6c 6f __va_offset4(slo
c3a0: 74 31 2c 73 6c 6f 74 32 2c 73 6c 6f 74 33 2c 73 t1,slot2,slot3,s
c3b0: 6c 6f 74 34 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 lot4)/sizeof(__v
c3c0: 61 77 6f 72 64 29 20 3d 3d 20 28 5f 5f 76 61 5f aword) == (__va_
c3d0: 6f 66 66 73 65 74 34 28 73 6c 6f 74 31 2c 73 6c offset4(slot1,sl
c3e0: 6f 74 32 2c 73 6c 6f 74 33 2c 73 6c 6f 74 34 29 ot2,slot3,slot4)
c3f0: 2b 73 69 7a 65 6f 66 28 73 6c 6f 74 34 29 2d 31 +sizeof(slot4)-1
c400: 29 2f 73 69 7a 65 6f 66 28 5f 5f 76 61 77 6f 72 )/sizeof(__vawor
c410: 64 29 29 20 5c 0a 20 20 29 0a 23 64 65 66 69 6e d)) \. ).#defin
c420: 65 20 5f 5f 76 61 5f 6f 66 66 73 65 74 31 28 73 e __va_offset1(s
c430: 6c 6f 74 31 29 20 20 5c 0a 20 20 30 0a 23 64 65 lot1) \. 0.#de
c440: 66 69 6e 65 20 5f 5f 76 61 5f 6f 66 66 73 65 74 fine __va_offset
c450: 32 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 29 20 20 2(slot1,slot2)
c460: 5c 0a 20 20 28 28 5f 5f 76 61 5f 6f 66 66 73 65 \. ((__va_offse
c470: 74 31 28 73 6c 6f 74 31 29 2b 73 69 7a 65 6f 66 t1(slot1)+sizeof
c480: 28 73 6c 6f 74 31 29 2b 5f 5f 56 41 5f 61 6c 69 (slot1)+__VA_ali
c490: 67 6e 6f 66 28 73 6c 6f 74 32 29 2d 31 29 20 26 gnof(slot2)-1) &
c4a0: 20 2d 28 6c 6f 6e 67 29 5f 5f 56 41 5f 61 6c 69 -(long)__VA_ali
c4b0: 67 6e 6f 66 28 73 6c 6f 74 32 29 29 0a 23 64 65 gnof(slot2)).#de
c4c0: 66 69 6e 65 20 5f 5f 76 61 5f 6f 66 66 73 65 74 fine __va_offset
c4d0: 33 28 73 6c 6f 74 31 2c 73 6c 6f 74 32 2c 73 6c 3(slot1,slot2,sl
c4e0: 6f 74 33 29 20 20 5c 0a 20 20 28 28 5f 5f 76 61 ot3) \. ((__va
c4f0: 5f 6f 66 66 73 65 74 32 28 73 6c 6f 74 31 2c 73 _offset2(slot1,s
c500: 6c 6f 74 32 29 2b 73 69 7a 65 6f 66 28 73 6c 6f lot2)+sizeof(slo
c510: 74 32 29 2b 5f 5f 56 41 5f 61 6c 69 67 6e 6f 66 t2)+__VA_alignof
c520: 28 73 6c 6f 74 33 29 2d 31 29 20 26 20 2d 28 6c (slot3)-1) & -(l
c530: 6f 6e 67 29 5f 5f 56 41 5f 61 6c 69 67 6e 6f 66 ong)__VA_alignof
c540: 28 73 6c 6f 74 33 29 29 0a 23 64 65 66 69 6e 65 (slot3)).#define
c550: 20 5f 5f 76 61 5f 6f 66 66 73 65 74 34 28 73 6c __va_offset4(sl
c560: 6f 74 31 2c 73 6c 6f 74 32 2c 73 6c 6f 74 33 2c ot1,slot2,slot3,
c570: 73 6c 6f 74 34 29 20 20 5c 0a 20 20 28 28 5f 5f slot4) \. ((__
c580: 76 61 5f 6f 66 66 73 65 74 33 28 73 6c 6f 74 31 va_offset3(slot1
c590: 2c 73 6c 6f 74 32 2c 73 6c 6f 74 33 29 2b 73 69 ,slot2,slot3)+si
c5a0: 7a 65 6f 66 28 73 6c 6f 74 33 29 2b 5f 5f 56 41 zeof(slot3)+__VA
c5b0: 5f 61 6c 69 67 6e 6f 66 28 73 6c 6f 74 34 29 2d _alignof(slot4)-
c5c0: 31 29 20 26 20 2d 28 6c 6f 6e 67 29 5f 5f 56 41 1) & -(long)__VA
c5d0: 5f 61 6c 69 67 6e 6f 66 28 73 6c 6f 74 34 29 29 _alignof(slot4))
c5e0: 0a 0a 0a 2f 2a 0a 20 2a 20 4d 69 73 63 65 6c 6c .../*. * Miscell
c5f0: 61 6e 65 6f 75 73 20 64 65 63 6c 61 72 61 74 69 aneous declarati
c600: 6f 6e 73 2e 0a 20 2a 2f 0a 23 69 66 64 65 66 20 ons.. */.#ifdef
c610: 5f 5f 63 70 6c 75 73 70 6c 75 73 0a 65 78 74 65 __cplusplus.exte
c620: 72 6e 20 22 43 22 20 76 6f 69 64 20 28 2a 76 61 rn "C" void (*va
c630: 63 61 6c 6c 29 20 28 29 3b 20 2f 2a 20 74 68 65 call) (); /* the
c640: 20 72 65 74 75 72 6e 20 74 79 70 65 20 69 73 20 return type is
c650: 76 61 72 69 61 62 6c 65 2c 20 6e 6f 74 20 76 6f variable, not vo
c660: 69 64 21 20 2a 2f 0a 23 65 6c 73 65 0a 65 78 74 id! */.#else.ext
c670: 65 72 6e 20 76 6f 69 64 20 28 2a 76 61 63 61 6c ern void (*vacal
c680: 6c 29 20 28 29 3b 20 2f 2a 20 74 68 65 20 72 65 l) (); /* the re
c690: 74 75 72 6e 20 74 79 70 65 20 69 73 20 76 61 72 turn type is var
c6a0: 69 61 62 6c 65 2c 20 6e 6f 74 20 76 6f 69 64 21 iable, not void!
c6b0: 20 2a 2f 0a 23 65 6e 64 69 66 0a 65 78 74 65 72 */.#endif.exter
c6c0: 6e 20 76 6f 69 64 20 28 2a 20 76 61 63 61 6c 6c n void (* vacall
c6d0: 5f 66 75 6e 63 74 69 6f 6e 29 20 28 76 61 5f 61 _function) (va_a
c6e0: 6c 69 73 74 29 3b 0a 65 78 74 65 72 6e 20 69 6e list);.extern in
c6f0: 74 20 5f 5f 76 61 5f 65 72 72 6f 72 31 20 28 65 t __va_error1 (e
c700: 6e 75 6d 20 5f 5f 56 41 74 79 70 65 2c 20 65 6e num __VAtype, en
c710: 75 6d 20 5f 5f 56 41 74 79 70 65 29 3b 0a 65 78 um __VAtype);.ex
c720: 74 65 72 6e 20 69 6e 74 20 5f 5f 76 61 5f 65 72 tern int __va_er
c730: 72 6f 72 32 20 28 75 6e 73 69 67 6e 65 64 20 69 ror2 (unsigned i
c740: 6e 74 29 3b 0a 65 78 74 65 72 6e 20 76 6f 69 64 nt);.extern void
c750: 20 5f 5f 73 74 72 75 63 74 63 70 79 20 28 76 6f __structcpy (vo
c760: 69 64 2a 20 64 65 73 74 2c 20 63 6f 6e 73 74 20 id* dest, const
c770: 76 6f 69 64 2a 20 73 72 63 2c 20 75 6e 73 69 67 void* src, unsig
c780: 6e 65 64 20 6c 6f 6e 67 20 73 69 7a 65 2c 20 75 ned long size, u
c790: 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 61 6c 69 nsigned long ali
c7a0: 67 6e 6d 65 6e 74 29 3b 0a 74 79 70 65 64 65 66 gnment);.typedef
c7b0: 20 75 6e 69 6f 6e 20 7b 20 5f 5f 76 61 77 6f 72 union { __vawor
c7c0: 64 20 72 6f 6f 6d 5b 5f 5f 56 41 5f 41 4c 49 53 d room[__VA_ALIS
c7d0: 54 5f 57 4f 52 44 53 5d 3b 20 64 6f 75 62 6c 65 T_WORDS]; double
c7e0: 20 61 6c 69 67 6e 3b 20 7d 20 5f 5f 76 61 5f 73 align; } __va_s
c7f0: 74 72 75 63 74 5f 62 75 66 66 65 72 5f 74 3b 0a truct_buffer_t;.
c800: 65 78 74 65 72 6e 20 5f 5f 76 61 5f 73 74 72 75 extern __va_stru
c810: 63 74 5f 62 75 66 66 65 72 5f 74 20 5f 5f 76 61 ct_buffer_t __va
c820: 5f 73 74 72 75 63 74 5f 62 75 66 66 65 72 3b 0a _struct_buffer;.
c830: 0a 0a 23 65 6e 64 69 66 20 2f 2a 20 5f 56 41 43 ..#endif /* _VAC
c840: 41 4c 4c 5f 48 20 2a 2f 0a ALL_H */.