about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorrajdakin <rajdakin@gmail.com>2024-11-06 21:52:34 +0100
committerGitHub <noreply@github.com>2024-11-06 21:52:34 +0100
commit6af8d70cc1620bf8e7927ade2e42e4cea41384be (patch)
treee2c63ee7ea18826ac3ddff5e3bbba67d72344062 /src
parent2dea11a9e3fed043e368d2e99067d69151c2e694 (diff)
downloadbox64-6af8d70cc1620bf8e7927ade2e42e4cea41384be.tar.gz
box64-6af8d70cc1620bf8e7927ade2e42e4cea41384be.zip
[WRAPPED32] Added an errno-aware calling convention (#2006)
Diffstat (limited to 'src')
-rw-r--r--src/wrapped32/generated/functions_list.txt1
-rw-r--r--src/wrapped32/generated/wrapper32.c3
-rw-r--r--src/wrapped32/generated/wrapper32.h1
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h2
4 files changed, 6 insertions, 1 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 3eeb0871..b7ca41e5 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -27,6 +27,7 @@
 #() iFl -> iFl
 #() iFL -> iFL
 #() iFp -> iFp
+#() iEp -> iEp
 #() iFh -> iFh
 #() iFS -> iFS
 #() iFX -> iFX
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index 2c15e1a5..7ff0b3db 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -1,6 +1,7 @@
 /*********************************************************************
  * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) *
  *********************************************************************/
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -117,6 +118,7 @@ typedef int32_t (*iFd_t)(double);
 typedef int32_t (*iFl_t)(intptr_t);
 typedef int32_t (*iFL_t)(uintptr_t);
 typedef int32_t (*iFp_t)(void*);
+typedef int32_t (*iEp_t)(void*);
 typedef int32_t (*iFh_t)(uintptr_t);
 typedef int32_t (*iFS_t)(void*);
 typedef int32_t (*iFX_t)(void*);
@@ -1629,6 +1631,7 @@ void iFd_32(x64emu_t *emu, uintptr_t fcn) { iFd_t fn = (iFd_t)fcn; R_EAX = fn(fr
 void iFl_32(x64emu_t *emu, uintptr_t fcn) { iFl_t fn = (iFl_t)fcn; R_EAX = fn(from_long(from_ptri(long_t, R_ESP + 4))); }
 void iFL_32(x64emu_t *emu, uintptr_t fcn) { iFL_t fn = (iFL_t)fcn; R_EAX = fn(from_ulong(from_ptri(ulong_t, R_ESP + 4))); }
 void iFp_32(x64emu_t *emu, uintptr_t fcn) { iFp_t fn = (iFp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4)); }
+void iEp_32(x64emu_t *emu, uintptr_t fcn) { iEp_t fn = (iEp_t)fcn; errno = emu->libc_err; R_EAX = fn(from_ptriv(R_ESP + 4)); emu->libc_err = errno; }
 void iFh_32(x64emu_t *emu, uintptr_t fcn) { iFh_t fn = (iFh_t)fcn; R_EAX = fn(from_hash(from_ptri(ptr_t, R_ESP + 4))); }
 void iFS_32(x64emu_t *emu, uintptr_t fcn) { iFS_t fn = (iFS_t)fcn; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4))); }
 void iFX_32(x64emu_t *emu, uintptr_t fcn) { iFX_t fn = (iFX_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4))); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index a135ac8c..b58438c4 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -68,6 +68,7 @@ void iFd_32(x64emu_t *emu, uintptr_t fnc);
 void iFl_32(x64emu_t *emu, uintptr_t fnc);
 void iFL_32(x64emu_t *emu, uintptr_t fnc);
 void iFp_32(x64emu_t *emu, uintptr_t fnc);
+void iEp_32(x64emu_t *emu, uintptr_t fnc);
 void iFh_32(x64emu_t *emu, uintptr_t fnc);
 void iFS_32(x64emu_t *emu, uintptr_t fnc);
 void iFX_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index 593bc6cd..b9e9f273 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -1918,7 +1918,7 @@ GOM(vsyslog, vFEipp)
 //GOM(vwprintf, iFEpp) //%%
 //GO2(__vwprintf_chk, iFEvpp, my_vwprintf)
 //GO(vwscanf, iFpp)
-GOW(wait, iFp)
+GOW(wait, iEp)
 //GOW(__wait, iFp)
 //GOW(wait3, iFpip)
 //GOW(wait4, iFipip)