From 1e5402a30a72930896a43401e1e5e1149b4249c3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 13 Sep 2002 15:42:07 +0000 Subject: [PATCH] Closes: #50 idstuff.c: don't write the defs at offset 0 to progdefs.h qfcc.c: generate progdefs.h and the crc for v6 code when linking object files to the progs.dat --- tools/qfcc/source/idstuff.c | 4 +++- tools/qfcc/source/qfcc.c | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/idstuff.c b/tools/qfcc/source/idstuff.c index 9495a1bf5..1d91c1e72 100644 --- a/tools/qfcc/source/idstuff.c +++ b/tools/qfcc/source/idstuff.c @@ -214,6 +214,8 @@ WriteProgdefs (char *filename) for (d = pr.scope->head; d; d = d->def_next) { if (!strcmp (d->name, "end_sys_globals")) break; + if (!d->ofs) + continue; switch (d->type->type) { case ev_float: @@ -245,7 +247,7 @@ WriteProgdefs (char *filename) if (!strcmp (d->name, "end_sys_fields")) break; - if (d->type->type != ev_field) + if (!d->ofs || d->type->type != ev_field) continue; switch (d->type->aux_type->type) { diff --git a/tools/qfcc/source/qfcc.c b/tools/qfcc/source/qfcc.c index 11ab1305e..16d81c87e 100644 --- a/tools/qfcc/source/qfcc.c +++ b/tools/qfcc/source/qfcc.c @@ -576,10 +576,17 @@ separate_compile (void) if (options.partial_link) { qfo_write (qfo, options.output_file); } else { + int crc = 0; + qfo_to_progs (qfo, &pr); setup_sym_file (options.output_file); finish_compilation (); - WriteData (0); + + // write progdefs.h + if (options.code.progsversion == PROG_ID_VERSION) + crc = WriteProgdefs ("progdefs.h"); + + WriteData (crc); } } else { err = 1;