Closed TheLastRar closed 1 year ago
So, the issue here was with the vararg trampoline. Was calling va_arg with 'long'. Turns out on Win32, long is 32 bit.
So, the issue here was with the vararg trampoline. Was calling va_arg with 'long'. Turns out on Win32, long is 32 bit.
Correct. In .NET 6 we introduced CLong
and CULong
to help with this - https://learn.microsoft.com/dotnet/standard/native-interop/best-practices#cc-long.
The inconsistencies with long in C/C++ is why I prefer to use fixed width integer types instead.
At least Java and .Net is consistent in making long
always 64bit.
I will have to remember CLong
and CULong
next time I do Native interop, that's a pretty neat addition
Should be resolved in 8.5.1
IKVM version : image-netcoreapp3.1-win7-x64 https://github.com/ikvmnet/ikvm/commit/29d8b854dd18d6c161e4b630e2e349f041f7530c, Build taken from this Action
Given Java code
And C code
JVM produces the following output
IKVM instead produces this output