diff options
Diffstat (limited to 'targ.c')
| -rw-r--r-- | targ.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; } |