diff --git a/include/wums/exports.h b/include/wums/exports.h index 191d443..0e8f180 100644 --- a/include/wums/exports.h +++ b/include/wums/exports.h @@ -43,18 +43,19 @@ typedef struct wums_entry_t { const void *address; /* pointer to the export */ } wums_loader_entry_t; -#define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, function); -#define WUMS_EXPORT_DATA(pointer) WUMS_EXPORT(WUMS_DATA_EXPORT, pointer); +#define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, function, function); +#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 \ WUMS_SECTION("exports"); \ const wums_loader_entry_t wums_entry_##pointer = { \ .type = _type, \ .name = # pointer, \ - .address = (const void*) pointer \ + .address = (const void*) value \ } + #ifdef __cplusplus } #endif