about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedsdl1.c
diff options
context:
space:
mode:
authorrajdakin <rajdakin@gmail.com>2024-02-10 15:06:08 +0100
committerGitHub <noreply@github.com>2024-02-10 15:06:08 +0100
commitb527ebbf5be0949df3b9dcf0806109acc8119476 (patch)
treed9687f665b8e3a1facc15be822463bf7d274dacd /src/wrapped/wrappedsdl1.c
parentad55cfde7f61395618991543694b35183f9c6ad7 (diff)
downloadbox64-b527ebbf5be0949df3b9dcf0806109acc8119476.tar.gz
box64-b527ebbf5be0949df3b9dcf0806109acc8119476.zip
Wrapped libraries refactor (#1257)
* [MISC] Removed a warning caused by tab/space mismatch

* [WRAPPED] Factored out `getMy` and `freeMy` calls

* [WRAPPED] Small cleanup of the init header

* [WRAPPED] Factored out `SETALT`

* [WRAPPED] Factored out needed libs
Diffstat (limited to 'src/wrapped/wrappedsdl1.c')
-rw-r--r--src/wrapped/wrappedsdl1.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/wrapped/wrappedsdl1.c b/src/wrapped/wrappedsdl1.c
index b8e5bc31..1ffdfac0 100644
--- a/src/wrapped/wrappedsdl1.c
+++ b/src/wrapped/wrappedsdl1.c
@@ -51,6 +51,10 @@ typedef void  (*vFv_t)();
     GO(SDL_Quit, vFv_t)           \
     GO(SDL_AllocRW, sdl1_allocrw) \
     GO(SDL_FreeRW, sdl1_freerw)
+
+#define ADDED_FINI() \
+    my->SDL_Quit();
+
 #include "generated/wrappedsdl1types.h"
 
 #include "wrappercallback.h"
@@ -409,17 +413,12 @@ EXPORT int32_t my_SDL_GetWMInfo(x64emu_t* emu, void* p)
 }
 
 #define CUSTOM_INIT \
-    getMy(lib);                             \
     box64->sdl1allocrw = my->SDL_AllocRW;   \
-    box64->sdl1freerw  = my->SDL_FreeRW;    \
-    setNeededLibs(lib, 3,                   \
-        "libm.so.6",                        \
-        "libdl.so.2",                       \
-        "librt.so.1");
+    box64->sdl1freerw  = my->SDL_FreeRW;
+
+#define NEEDED_LIBS "libm.so.6", "libdl.so.2", "librt.so.1"
 
 #define CUSTOM_FINI \
-    my->SDL_Quit();                         \
-    freeMy();                               \
     my_context->sdl1allocrw = NULL;         \
     my_context->sdl1freerw = NULL;