2021-06-29 23:48:26 +00:00
|
|
|
#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;
|
|
|
|
|
2022-01-18 12:42:53 +00:00
|
|
|
typedef struct xdefs_s {
|
|
|
|
xdef_t *xdefs;
|
|
|
|
unsigned num_xdefs;
|
|
|
|
} xdefs_t;
|
|
|
|
|
2021-06-29 23:48:26 +00:00
|
|
|
void *PR_FindGlobal (string name) = #0;
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
//FIXME need a simple way to get at a def's meta-data
|
2022-01-18 12:42:53 +00:00
|
|
|
xdefs_t *xdefs = PR_FindGlobal (".xdefs");
|
|
|
|
xdef_t *xdef = xdefs.xdefs;
|
|
|
|
while (xdef - xdefs.xdefs < xdefs.num_xdefs && xdef.ofs != &int32_ptr) {
|
|
|
|
xdef++;
|
2021-06-29 23:48:26 +00:00
|
|
|
}
|
2022-01-18 12:42:53 +00:00
|
|
|
printf ("int32_ptr: %s\n", xdef.type.encoding);
|
|
|
|
return xdef.type.encoding != "{>^i}";
|
2021-06-29 23:48:26 +00:00
|
|
|
}
|