The unified diff between revisions [58a3ccba..] and [76aea49e..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/lsc/codegen.c'
# # old_revision [58a3ccba47e51398ea76582c5b4a94bf8af04187] # new_revision [76aea49e8393c839b573eaac31eb8e2fb218d2d6] # # patch "src/lsc/codegen.c" # from [0066fecf055581632eaebac395d4caacee9c44d2] # to [54841dc0395a35f38eeef2e81231366c4fed3015] # ============================================================ --- src/lsc/codegen.c 0066fecf055581632eaebac395d4caacee9c44d2 +++ src/lsc/codegen.c 54841dc0395a35f38eeef2e81231366c4fed3015 @@ -267,9 +267,11 @@ int lookup_function(ast *node, struct fn return 1; } -int lookup_constant(ast *node, int *constant) +#define lookup_constant(node, constant) \ + lookup_constant_string(node->info.string, constant) + +int lookup_constant_string(char *constantname, int *constant) { - char *constantname = node->info.string; struct hashentry *hashptr; if (constant_count < 0) @@ -1185,6 +1187,7 @@ void output_code(void) int morepasses = 1; int passno = 0; int pc; + int abiver; while (morepasses) { ptr = instr_head; @@ -1259,10 +1262,23 @@ void output_code(void) output_byte(VERSION1); output_byte(VERSION2); +#define ABIVERSION(x) do { \ + abiver = 0; \ + if (!lookup_constant_string(x, &abiver)) \ + printf("%s not defined\n", x); \ + output_int(abiver); \ + } while (0) + pc = (pc + 3) & ~3; /* Align table */ - output_int(pc+8); /* Pointer to function table */ + output_int(pc+28); /* Pointer to function table */ + ABIVERSION("__abiversion1"); + ABIVERSION("__abiversion2"); + ABIVERSION("__abiversion3"); + ABIVERSION("__abiversion4"); + ABIVERSION("__abiversion5"); + ptr = instr_head; pc = 0; while (ptr) {