Skip to content

Commit

Permalink
zig master: exit, get_env fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai committed Mar 23, 2024
1 parent 1cb2962 commit 8cf48dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
if (target.result.os.tag == .windows) {
std.log.err("\x1b[31mPlatform Not Supported\x1b[0m\nCurrently, Facil.io and Zap are not compatible with Windows. Consider using Linux or Windows Subsystem for Linux (WSL) instead.\nFor more information, please see:\n- https://github.com/zigzap/zap#most-faq\n- https://facil.io/#forking-contributing-and-all-that-jazz\n", .{});
std.os.exit(1);
std.process.exit(1);
}
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const optimize = b.standardOptimizeOption(.{});

const use_openssl = b.option(bool, "openssl", "Use system-installed openssl for TLS support in zap") orelse blk: {
// Alternatively, use an os env var to determine whether to build openssl support
if (std.os.getenv("ZAP_USE_OPENSSL")) |val| {
if (std.posix.getenv("ZAP_USE_OPENSSL")) |val| {
if (std.mem.eql(u8, val, "true")) break :blk true;
}
break :blk false;
Expand Down
2 changes: 1 addition & 1 deletion examples/https/https.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn help_and_exit(filename: []const u8, err: anyerror) void {
,
.{ filename, err },
);
std.os.exit(1);
std.process.exit(1);
}
pub fn main() !void {
const CERT_FILE = "mycert.pem";
Expand Down
4 changes: 2 additions & 2 deletions tools/announceybot.zig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn usage() void {
\\ instructions
;
std.debug.print("{s}", .{message});
std.os.exit(1);
std.process.exit(1);
}

var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
Expand Down Expand Up @@ -336,7 +336,7 @@ fn command_announce(allocator: std.mem.Allocator, tag: []const u8) !void {
defer allocator.free(url);
sendToDiscord(allocator, url, announcement) catch |err| {
std.debug.print("HTTP ERROR: {any}\n", .{err});
std.os.exit(1);
std.process.exit(1);
};
}

Expand Down

0 comments on commit 8cf48dd

Please sign in to comment.