diff options
Diffstat (limited to 'src/zilch/root.zig')
| -rw-r--r-- | src/zilch/root.zig | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/zilch/root.zig b/src/zilch/root.zig index 2a31691..1ececbb 100644 --- a/src/zilch/root.zig +++ b/src/zilch/root.zig @@ -2,9 +2,9 @@ const builtin = @import("builtin"); const std = @import("std"); pub const Env = @import("Env/root.zig"); -pub const Call = Call.Env; -pub const AnyFuture = AnyFuture.Env; -pub const Future = Future.Env; +pub const Call = Env.Call; +pub const AnyFuture = Env.AnyFuture; +pub const Future = Env.Future; pub const Value = Env.Value; pub const log = @import("log/root.zig"); pub const html = @import("html/root.zig"); @@ -23,3 +23,14 @@ fn defaultPanic(msg: []const u8, _: ?usize) noreturn { } pub const panic = std.debug.FullPanic(defaultPanic); + +const Ptr = struct { o: *anyopaque }; +comptime { + const export_sizes = .{ Call, Value, Ptr }; + + for (export_sizes) |T| { + const size: u16 = @sizeOf(T); + const name = @typeName(T)[if (std.mem.findScalarLast(u8, @typeName(T), '.')) |i| i + 1 else 0..]; + @export(&size, .{ .name = std.fmt.comptimePrint("type::size::{s}", .{name}) }); + } +} |