about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.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/wrappedlibc.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/wrappedlibc.c')
-rw-r--r--src/wrapped/wrappedlibc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 428946b9..1c7c5a25 100644
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -3454,7 +3454,7 @@ EXPORT char my___libc_single_threaded = 0;
     else
 
 #ifdef ANDROID
-#define NEEDED_LIBS   1,    \
+#define NEEDED_LIBS_DEF   1,\
     "libbsd.so"
 #define NEEDED_LIBS_234 4,  \
     "libpthread.so.0",      \
@@ -3462,7 +3462,7 @@ EXPORT char my___libc_single_threaded = 0;
     "libm.so",              \
     "libbsd.so"
 #else
-#define NEEDED_LIBS   6,    \
+#define NEEDED_LIBS_DEF   6,\
     "ld-linux-x86-64.so.2", \
     "libpthread.so.0",      \
     "libdl.so.2",           \
@@ -3479,6 +3479,8 @@ EXPORT char my___libc_single_threaded = 0;
     "libbsd.so.0"
 #endif
 
+#undef HAS_MY
+
 #define CUSTOM_INIT         \
     box64->libclib = lib;   \
     /*InitCpuModel();*/         \
@@ -3492,7 +3494,7 @@ EXPORT char my___libc_single_threaded = 0;
     if(box64_isglibc234)                                                        \
         setNeededLibs(lib, NEEDED_LIBS_234);                                    \
     else                                                                        \
-        setNeededLibs(lib, NEEDED_LIBS);
+        setNeededLibs(lib, NEEDED_LIBS_DEF);
 
 #define CUSTOM_FINI \
     freeMy();       \