From 66ffc2ae07941e00406493020579a0b695b535ee Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 15 Oct 2025 10:44:06 +0200 Subject: implement long double (as double synonym). wchar_t placeholder --- targ.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'targ.c') diff --git a/targ.c b/targ.c index 7772537..306fcd8 100644 --- a/targ.c +++ b/targ.c @@ -6,16 +6,16 @@ static const struct targ { struct { uchar longsize, vlongsize, ptrsize, valistsize; }; struct { uchar longalign, vlongalign, doublealign, ptralign; }; bool charsigned; - uchar sizetype, ptrdifftype; + uchar sizetype, ptrdifftype, wchartype; const struct mctarg *mctarg; } targs[] = { - { "amd64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG, TYLONG, &t_amd64_sysv }, - { "i686-sysv", {4, 8, 4, 8}, {4, 4, 4, 4}, 1, TYUINT, TYINT } + { "amd64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG, TYLONG, TYUINT, &t_amd64_sysv }, + { "i686-sysv", {4, 8, 4, 8}, {4, 4, 4, 4}, 1, TYUINT, TYINT, TYUINT } }; uchar targ_primsizes[TYPTR+1]; uchar targ_primalign[TYPTR+1]; -enum typetag targ_sizetype, targ_ptrdifftype; +enum typetag targ_sizetype, targ_ptrdifftype, targ_wchartype; bool targ_charsigned, targ_bigendian, targ_64bit; const struct mctarg *mctarg; @@ -30,6 +30,7 @@ targ_init(const char *starg) sizes[TYUINT] = sizes[TYINT] = 4; sizes[TYFLOAT] = 4; sizes[TYDOUBLE] = 8; + sizes[TYLDOUBLE] = 8; memcpy(align, sizes, sizeof targ_primalign); sizes[TYULONG] = sizes[TYLONG] = t->longsize; sizes[TYUVLONG] = sizes[TYVLONG] = t->vlongsize; @@ -38,9 +39,11 @@ targ_init(const char *starg) align[TYULONG] = align[TYLONG] = t->longalign; align[TYUVLONG] = align[TYVLONG] = t->vlongalign; align[TYDOUBLE] = t->doublealign; + align[TYLDOUBLE] = t->doublealign; align[TYVALIST] = align[TYPTR] = t->ptralign; targ_sizetype = t->sizetype; targ_ptrdifftype = t->ptrdifftype; + targ_wchartype = t->wchartype; targ_charsigned = t->charsigned; targ_bigendian = 0; targ_64bit = t->ptrsize == 8; -- cgit v1.2.3