1export fn foo() void {}
2const bar: u32 = 123;
3const other: u32 = 456;
4comptime {
5 @export(&bar, .{ .name = "bar" });
6 @export(&other, .{ .name = "foo" });
7}
8pub fn main() !void {
9 const S = struct {
10 extern fn foo() void;
11 extern const bar: u32;
12 extern const other: u32;
13 };
14 S.foo();
15 var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
16 try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other });
17}
18const std = @import("std");
19const io = std.Io.Threaded.global_single_threaded.io();