Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 2ea7342

Browse files
author
Ian Macphail
committed
[[ Bug 22379 ]] Ignore foreign handler C calling convention on 64-bit Windows
This patch fixes bug 22379, where foreign handlers declared in LCB would fail to resolve if the foreign handler binding specified a calling convention on 64-bit Windows. As there is only one calling convention in 64-bit Windows, it is safe to ignore such declarations in that case, allowing the same bindings to work for both 32-bit and 64-bit engine variants.
1 parent e51a676 commit 2ea7342

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libscript/src/script-instance.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,10 @@ bool MCScriptForeignHandlerInfoParse(MCStringRef p_binding, MCScriptForeignHandl
12671267
{
12681268
t_info->thread_affinity = t_thread_affinity;
12691269

1270-
/* The ABI for all platforms is always DEFAULT, except on Win32 where
1271-
* it is specified as part of the signature. */
1270+
/* The ABI for all platforms is always DEFAULT, except on 32-bit Win32
1271+
* where it is specified as part of the signature. */
12721272
t_info->c.call_type = (int)FFI_DEFAULT_ABI;
1273-
#ifdef _WIN32
1273+
#if defined(_WIN32) && defined(__32_BIT__)
12741274
t_info->c.call_type = t_cc == 0 ? (int)FFI_DEFAULT_ABI : t_cc;
12751275
#endif
12761276
t_info->c.function = t_function.Take();

0 commit comments

Comments
 (0)