diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-05-07 22:13:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-07 16:13:56 +0200 |
| commit | 9f38e81735b10668d64974033b4bb5097219ee34 (patch) | |
| tree | 57827cc130a3e79a46c58f4e5ce8946c78f4131a /src/wrapped/wrappedlibgl.c | |
| parent | 47ecde75ec19a58f458c1131ec1968d11d58e7e1 (diff) | |
| download | box64-9f38e81735b10668d64974033b4bb5097219ee34.tar.gz box64-9f38e81735b10668d64974033b4bb5097219ee34.zip | |
[WRAPPER] Used RunFunctionFmt for better sign-extend handling (#768)
* [WRAPPER] Used RunFunctionFmt for better sign-extend handling * [WRAPPER] Fixed some typos * [WRAPPER] Use L for unsigned long for better portability * [WRAPPER] More replace from U to L
Diffstat (limited to 'src/wrapped/wrappedlibgl.c')
| -rwxr-xr-x | src/wrapped/wrappedlibgl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wrapped/wrappedlibgl.c b/src/wrapped/wrappedlibgl.c index f210a255..153190de 100755 --- a/src/wrapped/wrappedlibgl.c +++ b/src/wrapped/wrappedlibgl.c @@ -23,7 +23,7 @@ static library_t* my_lib = NULL; // FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h -EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name) +EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name) { khint_t k; const char* rname = (const char*)name; @@ -58,7 +58,7 @@ GO(4) static uintptr_t my_debug_callback_fct_##A = 0; \ static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \ { \ - RunFunction(my_context, my_debug_callback_fct_##A, 7, a, b, c, d, e, f, g); \ + RunFunctionFmt(my_context, my_debug_callback_fct_##A, "iiuiipp", a, b, c, d, e, f, g); \ } SUPER() #undef GO @@ -80,7 +80,7 @@ static void* find_debug_callback_Fct(void* fct) static uintptr_t my_program_callback_fct_##A = 0; \ static void my_program_callback_##A(int32_t a, void* b) \ { \ - RunFunction(my_context, my_program_callback_fct_##A, 2, a, b); \ + RunFunctionFmt(my_context, my_program_callback_fct_##A, "ip", a, b); \ } SUPER() #undef GO @@ -359,7 +359,7 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam } #undef GO #undef SUPER - } else + } else symbol = procaddr(rname); if(!symbol) { printf_dlsym(LOG_DEBUG, "%p\n", NULL); @@ -371,7 +371,7 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret); return (void*)ret; // already bridged } - // get wrapper + // get wrapper k = kh_get(symbolmap, wrappers->glwrappers, rname); if(k==kh_end(wrappers->glwrappers) && strstr(rname, "ARB")==NULL) { // try again, adding ARB at the end if not present @@ -397,4 +397,4 @@ void* getGLProcAddress(x64emu_t* emu, glprocaddress_t procaddr, const char* rnam ret = AddBridge(emu->context->system, kh_value(wrappers->glwrappers, k), symbol, 0, constname); printf_dlsym(LOG_DEBUG, "%p\n", (void*)ret); return (void*)ret; -} \ No newline at end of file +} |