zig/example/shared_library/mathtest.zig
Jimmi Holst Christensen 378d3e4403
Solve the return type ambiguity (#1628)
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00

15 lines
347 B
Zig

// TODO Remove this workaround
comptime {
const builtin = @import("builtin");
if (builtin.os == builtin.Os.macosx) {
@export("__mh_execute_header", _mh_execute_header, builtin.GlobalLinkage.Weak);
}
}
var _mh_execute_header = extern struct.{
x: usize,
}.{ .x = 0 };
export fn add(a: i32, b: i32) i32 {
return a + b;
}