diff --git a/check_os.zig b/check_os.zig new file mode 100644 index 0000000..4a9da75 --- /dev/null +++ b/check_os.zig @@ -0,0 +1,16 @@ +const std = @import("std"); +const builtin = @import("builtin"); + +pub fn main() !void { + switch (builtin.os.tag) { + .windows => { + std.debug.print("hello windows OS: {}\n", .{builtin.os.tag}); + }, + .linux => { + std.debug.print("hello linux-based OS: {}\n", .{builtin.os.tag}); + }, + else => { + std.debug.print("hello mystery OS: {}\n", .{builtin.os.tag}); + }, + } +}