Fix reent usage for modules

This commit is contained in:
Maschell
2023-06-21 11:13:02 +02:00
parent a137f10ee9
commit 313f281ee8
8 changed files with 231 additions and 44 deletions

View File

@@ -39,22 +39,28 @@
extern "C" {
#endif
#define WUMS_MODULE_EXPORT_NAME(x) \
WUMS_META(export_name, x); \
WUMS_META(wums, "0.3.2"); \
WUMS_USE_WUT_MALLOC(); \
WUMS_USE_WUT_SOCKETS(); \
WUMS_USE_WUT_NEWLIB(); \
WUMS_USE_WUT_STDCPP(); \
WUMS___INIT_WRAPPER(); \
WUMS___FINI_WRAPPER(); \
__EXTERN_C_MACRO void abort(); \
void abort() { \
OSFatal(x ": abort() called. Uncaught exception?"); \
while (1) \
; \
} \
WUMS_META(buildtimestamp, __DATE__ " " __TIME__)
#define WUMS_VERSION "0.3.2"
#define WUMS_MODULE_EXPORT_NAME(__module_name) \
WUMS_META(export_name, __module_name); \
WUMS_META(wums, WUMS_VERSION); \
WUMS_USE_WUT_MALLOC(); \
WUMS_USE_WUT_SOCKETS(); \
WUMS_USE_WUT_NEWLIB(); \
WUMS_USE_WUT_STDCPP(); \
WUMS___INIT_WRAPPER(); \
WUMS___FINI_WRAPPER(); \
__EXTERN_C_MACRO void abort(); \
void abort() { \
OSFatal(__module_name ": abort() called. Uncaught exception?"); \
while (1) \
; \
} \
WUMS_META(buildtimestamp, __DATE__ " " __TIME__); \
extern const char wums_meta_info_dump[] WUMS_SECTION("meta"); \
const char wums_meta_info_dump[] = "(module: " __module_name ";" \
"wums " WUMS_VERSION ";" \
"buildtime: " __DATE__ " " __TIME__ ")"
#define WUMS_MODULE_AUTHOR(x) WUMS_META(author, x)
#define WUMS_MODULE_VERSION(x) WUMS_META(version, x)