1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-25 02:58:02 +02:00

Fixed varargs and tuple building

This commit is contained in:
Brian Fiete 2020-02-11 08:37:52 -08:00
parent 7741344fd2
commit 8171c842f0
5 changed files with 42 additions and 25 deletions

View file

@ -0,0 +1,24 @@
using System;
namespace Tests
{
class VarArgs
{
#if BF_PLATFORM_WINDOWS
[CLink, Import("msvcrt.dll")]
#else
[CLink]
#endif
public static extern int32 sprintf(char8* dest, char8* fmt, ...);
[Test]
public static void TestBasics()
{
char8[256] cStr;
sprintf(&cStr, "Test %d %0.1f %0.1f", 123, 1.2f, 2.3f);
String str = scope .(&cStr);
Test.Assert(str == "Test 123 1.2 2.3");
}
}
}