From a2791fb8a09dfe6d8acafe2e35724f99f609d093 Mon Sep 17 00:00:00 2001 From: Inori Date: Tue, 17 Dec 2019 02:27:55 -0500 Subject: [PATCH] Always use same typedef for MINIFFI_FUNC --- binding/miniffi-binding.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/binding/miniffi-binding.cpp b/binding/miniffi-binding.cpp index 829e1411..1b258dd8 100644 --- a/binding/miniffi-binding.cpp +++ b/binding/miniffi-binding.cpp @@ -24,14 +24,9 @@ // think there are many functions one would need to use that require // 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 // 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); -#endif +typedef PREFABI void* (*MINIFFI_FUNC)(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long); // MiniFFI class, also named Win32API on Windows // Uses LoadLibrary/GetProcAddress on Windows, dlopen/dlsym everywhere else @@ -257,11 +252,7 @@ RB_METHOD(MiniFFI_call) } 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]); -#endif switch (FIX2INT(own_exports)) {