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