mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 08:27:39 +00:00
Need alias defs after all.
This commit is contained in:
parent
a648f043de
commit
f45919df09
2 changed files with 15 additions and 1 deletions
|
@ -43,6 +43,7 @@ typedef struct def_s {
|
||||||
struct defspace_s *space;
|
struct defspace_s *space;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
|
struct def_s *alias;
|
||||||
struct reloc_s *relocs; ///< for relocations
|
struct reloc_s *relocs; ///< for relocations
|
||||||
|
|
||||||
unsigned initialized:1;
|
unsigned initialized:1;
|
||||||
|
@ -71,6 +72,7 @@ typedef enum storage_class_e {
|
||||||
|
|
||||||
def_t *new_def (const char *name, struct type_s *type,
|
def_t *new_def (const char *name, struct type_s *type,
|
||||||
struct defspace_s *space, storage_class_t storage);
|
struct defspace_s *space, storage_class_t storage);
|
||||||
|
def_t *alias_def (def_t *def, struct type_s *type);
|
||||||
void free_def (def_t *def);
|
void free_def (def_t *def);
|
||||||
|
|
||||||
void def_to_ddef (def_t *def, ddef_t *ddef, int aux);
|
void def_to_ddef (def_t *def, ddef_t *ddef, int aux);
|
||||||
|
|
|
@ -124,10 +124,22 @@ new_def (const char *name, type_t *type, defspace_t *space,
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def_t *
|
||||||
|
alias_def (def_t *def, type_t *type)
|
||||||
|
{
|
||||||
|
def_t *alias;
|
||||||
|
|
||||||
|
ALLOC (16384, def_t, defs, alias);
|
||||||
|
alias->offset = def->offset;
|
||||||
|
alias->type = type;
|
||||||
|
alias->alias = def;
|
||||||
|
return alias;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
free_def (def_t *def)
|
free_def (def_t *def)
|
||||||
{
|
{
|
||||||
if (def->space) {
|
if (!def->alias && def->space) {
|
||||||
def_t **d;
|
def_t **d;
|
||||||
|
|
||||||
for (d = &def->space->defs; *d && *d != def; d = &(*d)->next)
|
for (d = &def->space->defs; *d && *d != def; d = &(*d)->next)
|
||||||
|
|
Loading…
Reference in a new issue