#Do we need explicit callconv keyword to ensure calling conventions are respected?
1 messages · Page 1 of 1 (latest)
callconv(.c) (it's lowercase as of 0.14) will use the C calling convention for your platform which is both architecture and OS dependent
so e.g. windows x86_64 has a different convention
if you want to always use the system-v calling convention (rdi, rsi, etc.) you can use callconv(.{ .x86_64_sysv = .{} }) (you can use this even on windows)
also any export or extern function is implicitly callconv(.c) unless you specify something else
Did you mean to use callconv(.SysV), because the initialization syntax doesn't work, nor is there such an enum variant? I suppose it was for previous Zig versions, mine is 0.13.0 I believe
SysV is right for 0.13
for 0.14 you can use SysV but it's deprecated, what i wrote is the new way