mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[qfcc] Use {>...} for unnamed alias types
The ... is the encoding of the aliased type. Avoids (null) in the encoding. Fixes #10.
This commit is contained in:
parent
d9e7730d91
commit
9d140d1d15
3 changed files with 38 additions and 2 deletions
|
@ -729,8 +729,8 @@ encode_type (dstring_t *encoding, const type_t *type)
|
|||
if (!type)
|
||||
return;
|
||||
switch (type->meta) {
|
||||
case ty_alias: // XXX do I want this, or just the unaliased type?
|
||||
dasprintf (encoding, "{%s>", type->name);
|
||||
case ty_alias:
|
||||
dasprintf (encoding, "{%s>", type->name ? type->name : "");
|
||||
encode_type (encoding, type->t.alias.aux_type);
|
||||
dasprintf (encoding, "}");
|
||||
return;
|
||||
|
|
|
@ -33,6 +33,7 @@ test_progs_dat=\
|
|||
tools/qfcc/test/overload.dat \
|
||||
tools/qfcc/test/paramret.dat \
|
||||
tools/qfcc/test/postop.dat \
|
||||
tools/qfcc/test/ptraliasenc.dat \
|
||||
tools/qfcc/test/quaternion.dat \
|
||||
tools/qfcc/test/return-ivar.dat \
|
||||
tools/qfcc/test/sendv.dat \
|
||||
|
@ -383,6 +384,16 @@ tools/qfcc/test/postop.run: $(qfcc_test_run_deps)
|
|||
include $(postop_dep) # am--include-marker
|
||||
r_depfiles_remade += $(postop_dep)
|
||||
|
||||
tools_qfcc_test_ptraliasenc_dat_SOURCES=tools/qfcc/test/ptraliasenc.r
|
||||
ptraliasenc_obj=$(tools_qfcc_test_ptraliasenc_dat_SOURCES:.r=.o)
|
||||
ptraliasenc_dep=$(call qcautodep,$(tools_qfcc_test_ptraliasenc_dat_SOURCES))
|
||||
tools/qfcc/test/ptraliasenc.dat$(EXEEXT): $(ptraliasenc_obj) $(QFCC_DEP)
|
||||
$(V_QFCCLD)$(QLINK) -o $@ $(ptraliasenc_obj)
|
||||
tools/qfcc/test/ptraliasenc.run: $(qfcc_test_run_deps)
|
||||
@$(top_srcdir)/tools/qfcc/test/build-run $@
|
||||
include $(ptraliasenc_dep) # am--include-marker
|
||||
r_depfiles_remade += $(ptraliasenc_dep)
|
||||
|
||||
tools_qfcc_test_quaternion_dat_SOURCES=tools/qfcc/test/quaternion.r
|
||||
quaternion_obj=$(tools_qfcc_test_quaternion_dat_SOURCES:.r=.o)
|
||||
quaternion_dep=$(call qcautodep,$(tools_qfcc_test_quaternion_dat_SOURCES))
|
||||
|
|
25
tools/qfcc/test/ptraliasenc.r
Normal file
25
tools/qfcc/test/ptraliasenc.r
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <types.h>
|
||||
|
||||
#include "test-harness.h"
|
||||
|
||||
typedef int int32_t;
|
||||
int32_t *int32_ptr;
|
||||
|
||||
typedef struct xdef_s {
|
||||
qfot_type_t *type; ///< pointer to type definition
|
||||
void *ofs; ///< 32-bit version of ddef_t.ofs
|
||||
} xdef_t;
|
||||
|
||||
void *PR_FindGlobal (string name) = #0;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
//FIXME need a simple way to get at a def's meta-data
|
||||
xdef_t *xdefs = PR_FindGlobal (".xdefs");
|
||||
while (xdefs.ofs != &int32_ptr) {
|
||||
xdefs++;
|
||||
}
|
||||
printf ("int32_ptr: %s\n", xdefs.type.encoding);
|
||||
return xdefs.type.encoding != "{>^i}";
|
||||
}
|
Loading…
Reference in a new issue