Formatting

This commit is contained in:
Maschell 2021-09-23 22:40:10 +02:00
parent c5af736523
commit 47bbd9a3b3
5 changed files with 26 additions and 15 deletions

2
.gitignore vendored
View File

@ -28,3 +28,5 @@ debug/
*.jekyll-metadata *.jekyll-metadata
*.cbp *.cbp
*.a *.a
cmake-build-debug/
CMakeLists.txt

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
typedef enum RelocationTrampolinStatus{ typedef enum RelocationTrampolinStatus{

View File

@ -42,8 +42,8 @@ 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, function); #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_DATA(pointer) WUMS_EXPORT(WUMS_DATA_EXPORT, pointer, &pointer)
#define WUMS_EXPORT(_type, pointer, value) \ #define WUMS_EXPORT(_type, pointer, value) \
extern const wums_loader_entry_t wums_entry_##pointer \ extern const wums_loader_entry_t wums_entry_##pointer \

View File

@ -112,7 +112,7 @@ typedef struct wums_relocs_done_args_t {
void on_fini_wut_malloc(){ \ void on_fini_wut_malloc(){ \
__fini_wut_malloc(); \ __fini_wut_malloc(); \
} \ } \
WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_MALLOC,on_fini_wut_malloc); \ WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_MALLOC,on_fini_wut_malloc)
#define WUMS_USE_WUT_DEVOPTAB() \ #define WUMS_USE_WUT_DEVOPTAB() \
__EXTERN_C_MACRO void __init_wut_devoptab(); \ __EXTERN_C_MACRO void __init_wut_devoptab(); \
@ -124,7 +124,7 @@ typedef struct wums_relocs_done_args_t {
void on_fini_wut_devoptab(){ \ void on_fini_wut_devoptab(){ \
__fini_wut_devoptab(); \ __fini_wut_devoptab(); \
}\ }\
WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_DEVOPTAB,on_fini_wut_devoptab); WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_DEVOPTAB,on_fini_wut_devoptab)
#define WUMS_USE_WUT_NEWLIB() \ #define WUMS_USE_WUT_NEWLIB() \
__EXTERN_C_MACRO void __init_wut_newlib(); \ __EXTERN_C_MACRO void __init_wut_newlib(); \
@ -136,7 +136,7 @@ typedef struct wums_relocs_done_args_t {
void on_fini_wut_newlib(){ \ void on_fini_wut_newlib(){ \
__fini_wut_newlib(); \ __fini_wut_newlib(); \
}\ }\
WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_NEWLIB,on_fini_wut_newlib); WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_NEWLIB,on_fini_wut_newlib)
#define WUMS_USE_WUT_STDCPP() \ #define WUMS_USE_WUT_STDCPP() \
__EXTERN_C_MACRO void __init_wut_stdcpp(); \ __EXTERN_C_MACRO void __init_wut_stdcpp(); \
@ -148,13 +148,13 @@ typedef struct wums_relocs_done_args_t {
void on_fini_wut_stdcpp(){ \ void on_fini_wut_stdcpp(){ \
__fini_wut_stdcpp(); \ __fini_wut_stdcpp(); \
}\ }\
WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_STDCPP,on_fini_wut_stdcpp); WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_STDCPP,on_fini_wut_stdcpp)
#define WUMS_USE_WUT_SOCKETS() \ #define WUMS_USE_WUT_SOCKETS() \
__EXTERN_C_MACRO void __init_wut_socket(); \ __EXTERN_C_MACRO void __init_wut_socket(); \
WUMS_HOOK_EX(WUMS_HOOK_INIT_WUT_SOCKETS,__init_wut_socket); \ WUMS_HOOK_EX(WUMS_HOOK_INIT_WUT_SOCKETS,__init_wut_socket); \
__EXTERN_C_MACRO void __fini_wut_socket(); \ __EXTERN_C_MACRO void __fini_wut_socket(); \
WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_SOCKETS,__fini_wut_socket); WUMS_HOOK_EX(WUMS_HOOK_FINI_WUT_SOCKETS,__fini_wut_socket)
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -32,7 +32,15 @@
extern "C" { extern "C" {
#endif #endif
#define WUMS_MODULE_EXPORT_NAME(x) WUMS_META(export_name, x); WUMS_META(wum, "0.2"); WUMS_USE_WUT_MALLOC() WUMS_USE_WUT_SOCKETS() WUMS_USE_WUT_NEWLIB() WUMS_USE_WUT_STDCPP() WUMS_META(buildtimestamp, __DATE__ " " __TIME__); #define WUMS_MODULE_EXPORT_NAME(x) \
WUMS_META(export_name, x); \
WUMS_META(wum, "0.2"); \
WUMS_USE_WUT_MALLOC(); \
WUMS_USE_WUT_SOCKETS(); \
WUMS_USE_WUT_NEWLIB(); \
WUMS_USE_WUT_STDCPP(); \
WUMS_META(buildtimestamp, __DATE__ " " __TIME__)
#define WUMS_MODULE_AUTHOR(x) WUMS_META(author, x) #define WUMS_MODULE_AUTHOR(x) WUMS_META(author, x)
#define WUMS_MODULE_VERSION(x) WUMS_META(version, x) #define WUMS_MODULE_VERSION(x) WUMS_META(version, x)
#define WUMS_MODULE_LICENSE(x) WUMS_META(license, x) #define WUMS_MODULE_LICENSE(x) WUMS_META(license, x)