1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

varargs fixes

This commit is contained in:
Brian Fiete 2021-01-22 13:20:17 -08:00
parent 0ebd306d93
commit 1f42567339
2 changed files with 21 additions and 3 deletions

View file

@ -21,9 +21,14 @@ namespace System
}
}
[CRepr]
struct VarArgs
{
#if BF_PLATFORM_WINDOWS
void* mVAList;
#else
int[3] mVAList; // Conservative size for va_list
#endif
[Intrinsic("va_start")]
static extern void Start(void* vaList);
@ -51,6 +56,15 @@ namespace System
Arg(&mVAList, &val, (.)typeof(T).TypeId);
val
}
public void* ToVAList() mut
{
#if BF_PLATFORM_WINDOWS
return mVAList;
#else
return &mVAList;
#endif
}
}
[AlwaysInclude]