Fix data exports

This commit is contained in:
Maschell 2020-05-30 21:47:14 +02:00
parent 67582c8e1d
commit c161712aef

View File

@ -43,18 +43,19 @@ typedef struct wums_entry_t {
const void *address; /* pointer to the export */ const void *address; /* pointer to the export */
} wums_loader_entry_t; } wums_loader_entry_t;
#define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, function); #define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, function, function);
#define WUMS_EXPORT_DATA(pointer) WUMS_EXPORT(WUMS_DATA_EXPORT, pointer); #define WUMS_EXPORT_DATA(pointer) WUMS_EXPORT(WUMS_DATA_EXPORT, pointer, &pointer);
#define WUMS_EXPORT(_type, pointer) \ #define WUMS_EXPORT(_type, pointer, value) \
extern const wums_loader_entry_t wums_entry_##pointer \ extern const wums_loader_entry_t wums_entry_##pointer \
WUMS_SECTION("exports"); \ WUMS_SECTION("exports"); \
const wums_loader_entry_t wums_entry_##pointer = { \ const wums_loader_entry_t wums_entry_##pointer = { \
.type = _type, \ .type = _type, \
.name = # pointer, \ .name = # pointer, \
.address = (const void*) pointer \ .address = (const void*) value \
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif