From 035d4e507fa4efcc570899845cf78482994bf63f Mon Sep 17 00:00:00 2001 From: Hunter Bridges <775593+hunterbridges@users.noreply.github.com> Date: Fri, 15 Apr 2022 18:21:43 -0700 Subject: [PATCH 1/2] VarArgs multiplatform compatibility tweak - Increased size of VarArgs.mVAList on non-Windows platforms - Add ToVAListPtr() which returns &mVAList on all platforms --- BeefLibs/corlib/src/Internal.bf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Internal.bf b/BeefLibs/corlib/src/Internal.bf index f939eb45..077a3547 100644 --- a/BeefLibs/corlib/src/Internal.bf +++ b/BeefLibs/corlib/src/Internal.bf @@ -27,7 +27,7 @@ namespace System #if BF_PLATFORM_WINDOWS void* mVAList; #else - int[3] mVAList; // Conservative size for va_list + int[5] mVAList; // Conservative size for va_list #endif [Intrinsic("va_start")] @@ -65,6 +65,11 @@ namespace System return &mVAList; #endif } + + public void** ToVAListPtr() mut + { + return &mVAList; + } } [AlwaysInclude] From 0618278b36f3bc00793ef1e273e24e4e4436462f Mon Sep 17 00:00:00 2001 From: Hunter Bridges <775593+hunterbridges@users.noreply.github.com> Date: Fri, 15 Apr 2022 19:46:59 -0700 Subject: [PATCH 2/2] Fix ToVAListPtr return type --- BeefLibs/corlib/src/Internal.bf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Internal.bf b/BeefLibs/corlib/src/Internal.bf index 077a3547..3bfe37cb 100644 --- a/BeefLibs/corlib/src/Internal.bf +++ b/BeefLibs/corlib/src/Internal.bf @@ -66,7 +66,7 @@ namespace System #endif } - public void** ToVAListPtr() mut + public void* ToVAListPtr() mut { return &mVAList; }