mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
fdeb294c58
With the use of the full type for encoding type aliases, ptraliasenc's simple check became invalid (it's purpose is to ensure the encoding doesn't have "null" in it, not the exact encoding itself, but this is good enough).
31 lines
694 B
R
31 lines
694 B
R
#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;
|
|
|
|
typedef struct xdefs_s {
|
|
xdef_t *xdefs;
|
|
unsigned num_xdefs;
|
|
} xdefs_t;
|
|
|
|
void *PR_FindGlobal (string name) = #0;
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
//FIXME need a simple way to get at a def's meta-data
|
|
xdefs_t *xdefs = PR_FindGlobal (".xdefs");
|
|
xdef_t *xdef = xdefs.xdefs;
|
|
while (xdef - xdefs.xdefs < xdefs.num_xdefs && xdef.ofs != &int32_ptr) {
|
|
xdef++;
|
|
}
|
|
printf ("int32_ptr: %s\n", xdef.type.encoding);
|
|
return xdef.type.encoding != "{>^{int32_t>i}}";
|
|
}
|