about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-05-17 10:15:19 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-05-17 10:15:19 +0200
commita5780632cafbf34f37ac2784e48107b38a3f10f5 (patch)
treea975f638281e2c67eb81eb0a964445b9c6c9325a /src
parentbd5d29a825af62ceb849569d6fa4e8a646c18322 (diff)
downloadbox64-a5780632cafbf34f37ac2784e48107b38a3f10f5.tar.gz
box64-a5780632cafbf34f37ac2784e48107b38a3f10f5.zip
Added fwprintf wrapped function
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c15
-rwxr-xr-xsrc/wrapped/wrappedlibc_private.h2
2 files changed, 6 insertions, 11 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 6816272e..27f0ed47 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -603,18 +603,13 @@ EXPORT int my___wprintf_chk(x64emu_t *emu, int flag, void* fmt, void* b, va_list
     return vwprintf((const wchar_t*)fmt, V);
     #endif
 }
-EXPORT int my_fwprintf(x64emu_t *emu, void* F, void* fmt, void* b, va_list V)  {
-    #ifndef NOALIGN
-    // need to align on arm
-    myStackAlignW((const char*)fmt, b, emu->scratch);
+#endif
+EXPORT int my_fwprintf(x64emu_t *emu, void* F, void* fmt, void* b)  {
+    myStackAlignW(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
     PREPARE_VALIST;
-    void* f = vfwprintf;
-    return ((iFppp_t)f)(F, fmt, VARARGS);
-    #else
-    // other platform don't need that
-    return vfwprintf((FILE*)F, (const wchar_t*)fmt, V);
-    #endif
+    return vfwprintf(F, fmt, VARARGS);
 }
+#if 0
 EXPORT int my___fwprintf_chk(x64emu_t *emu, void* F, void* fmt, void* b, va_list V) __attribute__((alias("my_fwprintf")));
 
 EXPORT int my_vfwprintf(x64emu_t *emu, void* F, void* fmt, void* b) {
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index cd7d548b..b0143d10 100755
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -456,7 +456,7 @@ GOW(funlockfile, vFp)
 //GOW(futimes, 
 //GO(futimesat, 
 //GO(fwide, 
-//GOW(fwprintf, 
+GOM(fwprintf, iFEppV)   //Weak
 //GO(__fwprintf_chk, 
 //GO(__fwritable, 
 GOW(fwrite, LFpLLp)