From 09ce2b06620aeecd704ccb2ad2f227aed87d1ac3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 14 Aug 2002 03:55:23 +0000 Subject: [PATCH] make sure a class' super class gets referenced when the class is implemented to ensure the super class' object file gets linked in when it's in a library --- tools/qfcc/source/class.c | 4 +++- tools/qfcc/source/linker.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 60aeb7ad7..5fc84d6cb 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -215,8 +215,10 @@ class_begin (class_t *class) class->def->initialized = class->def->constant = 1; cls = &G_STRUCT (pr_class_t, class->def->ofs); EMIT_DEF (cls->class_pointer, meta_def); - if (class->super_class) + if (class->super_class) { EMIT_STRING (cls->super_class, class->super_class->class_name); + class_def (class->super_class, 1); + } EMIT_STRING (cls->name, class->class_name); cls->info = _PR_CLS_CLASS; cls->protocols = meta->protocols; diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index b85ba7117..b420abe77 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -191,8 +191,7 @@ process_def (qfo_def_t *def) def->flags = d->flags; Hash_Add (defined_defs, def); } else { - if (def->num_relocs) - Hash_Add (extern_defs, def); + Hash_Add (extern_defs, def); } } else { if (def->flags & QFOD_GLOBAL) {