diff options
| author | 2023-05-26 09:20:58 +0200 | |
|---|---|---|
| committer | 2023-05-26 09:20:58 +0200 | |
| commit | 640a3dac2b18d037169af15dfd5502c386c7e828 (patch) | |
| tree | 79e7ee3fa81e73855ce1bc78d7c4bf1ad3ac8f0d /targ.c | |
| parent | 9100ed2b5dd01df8e6b766c7bc2a12c0dd44f1ff (diff) | |
hm
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; } |