From 640a3dac2b18d037169af15dfd5502c386c7e828 Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 26 May 2023 09:20:58 +0200 Subject: hm --- targ.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'targ.c') diff --git a/targ.c b/targ.c index 7368fa5..e323148 100644 --- a/targ.c +++ b/targ.c @@ -2,23 +2,24 @@ uchar targ_primsizes[TYPTR+1]; uchar targ_primalign[TYPTR+1]; -enum typetag targ_sizetype; +enum typetag targ_sizetype, targ_ptrdifftype; bool targ_charsigned, targ_bigendian; -struct targ { +static const struct targ { const char *name; struct { uchar longsize, vlongsize, ptrsize, valistsize; }; struct { uchar longalign, vlongalign, doublealign, ptralign; }; bool charsigned; - uchar sizetype; + uchar sizetype, ptrdifftype; } targs[] = { - { "amd64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG } + { "amd64-sysv", {8, 8, 8, 24}, {8, 8, 8, 8}, 1, TYULONG, TYLONG }, + { "i686-sysv", {4, 8, 4, 8}, {4, 4, 4, 4}, 1, TYUINT, TYINT } }; void targ_init(const char *starg) { - struct targ *t = &targs[0]; + const struct targ *t = &targs[0]; uchar *sizes = targ_primsizes, *align = targ_primalign; sizes[TYBOOL] = sizes[TYCHAR] = sizes[TYSCHAR] = sizes[TYUCHAR] = 1; @@ -36,6 +37,7 @@ targ_init(const char *starg) align[TYDOUBLE] = t->doublealign; align[TYVALIST] = align[TYPTR] = t->ptralign; targ_sizetype = t->sizetype; + targ_ptrdifftype = t->ptrdifftype; targ_charsigned = t->charsigned; targ_bigendian = 0; } -- cgit v1.2.3