mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-06 15:05:53 +02:00
Always use same typedef for MINIFFI_FUNC
This commit is contained in:
parent
5a495c6d95
commit
a2791fb8a0
1 changed files with 1 additions and 10 deletions
|
@ -24,14 +24,9 @@
|
||||||
// think there are many functions one would need to use that require
|
// think there are many functions one would need to use that require
|
||||||
// that many arguments anyway
|
// that many arguments anyway
|
||||||
|
|
||||||
// stdcall is easy, everything in a struct gets pushed to the stack
|
|
||||||
#ifdef __WIN32__
|
|
||||||
typedef void* (__stdcall *MINIFFI_FUNC)(...);
|
|
||||||
#else
|
|
||||||
// L O N G, but variables won't get set up correctly otherwise
|
// L O N G, but variables won't get set up correctly otherwise
|
||||||
// should allow for __fastcalls (macOS likes these) and whatever else
|
// should allow for __fastcalls (macOS likes these) and whatever else
|
||||||
typedef void* (*MINIFFI_FUNC)(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long);
|
typedef PREFABI void* (*MINIFFI_FUNC)(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long);
|
||||||
#endif
|
|
||||||
|
|
||||||
// MiniFFI class, also named Win32API on Windows
|
// MiniFFI class, also named Win32API on Windows
|
||||||
// Uses LoadLibrary/GetProcAddress on Windows, dlopen/dlsym everywhere else
|
// Uses LoadLibrary/GetProcAddress on Windows, dlopen/dlsym everywhere else
|
||||||
|
@ -257,11 +252,7 @@ RB_METHOD(MiniFFI_call)
|
||||||
}
|
}
|
||||||
params[i] = lParam;
|
params[i] = lParam;
|
||||||
}
|
}
|
||||||
#ifdef __WIN32__
|
|
||||||
unsigned long ret = (unsigned long)ApiFunction(param);
|
|
||||||
#else
|
|
||||||
unsigned long ret = (unsigned long)ApiFunction(params[0],params[1],params[2],params[3],params[4],params[5],params[6],params[7]);
|
unsigned long ret = (unsigned long)ApiFunction(params[0],params[1],params[2],params[3],params[4],params[5],params[6],params[7]);
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (FIX2INT(own_exports))
|
switch (FIX2INT(own_exports))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue