about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-03 12:24:34 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-03 12:24:34 +0200
commit2685037c822569f6d8a0e509050025a3baeafc01 (patch)
treef3a88f0329eaf92e097601322f18a3ee4f20fe33 /src
parent61c46994cd66408f4a187ca1e3e65ab10c71d0e5 (diff)
downloadbox64-2685037c822569f6d8a0e509050025a3baeafc01.tar.gz
box64-2685037c822569f6d8a0e509050025a3baeafc01.zip
[WRAPPER] Improved libudev1 wrapped logf function
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedudev1.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/wrapped/wrappedudev1.c b/src/wrapped/wrappedudev1.c
index b16b3a59..fc20efe2 100644
--- a/src/wrapped/wrappedudev1.c
+++ b/src/wrapped/wrappedudev1.c
@@ -35,23 +35,14 @@ GO(3)   \
 GO(4)
 
 // log_fn ...
-#ifdef CONVERT_VALIST
 #define GO(A)   \
 static uintptr_t my_log_fn_fct_##A = 0;                                                                 \
-static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args)   \
+static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, va_list args)         \
 {                                                                                                       \
-    CONVERT_VALIST(args)                                                                                \
-    RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS);                                 \
+    char buff[1024] = {0};                                                                              \
+    vsnprintf(buff, 1023, fmt, args);                                                                   \
+    RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, "%s", buff);                                   \
 }
-#else
-#define GO(A)   \
-static uintptr_t my_log_fn_fct_##A = 0;                                                                 \
-static void my_log_fn_##A(void* udev, int p, void *f, int l, void* fn, void* fmt, x64_va_list_t args)   \
-{                                                                                                       \
-    CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch);                                         \
-    RunFunction(my_log_fn_fct_##A, 7, udev, p, f, l, fn, fmt, VARARGS);                                 \
-}
-#endif
 SUPER()
 #undef GO
 static void* find_log_fn_Fct(void* fct)