From 9d00f69be58e7b807e26ba8a38050dd486d487f4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 19 Jul 2024 17:38:15 -0700 Subject: move std.zig.fatal to std.process.fatal --- lib/std/process.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/std/process.zig') diff --git a/lib/std/process.zig b/lib/std/process.zig index 86654e4b5a..eca3a26c29 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -2032,3 +2032,9 @@ pub fn createWindowsEnvBlock(allocator: mem.Allocator, env_map: *const EnvMap) ! i += 1; return try allocator.realloc(result, i); } + +/// Logs an error and then terminates the process with exit code 1. +pub fn fatal(comptime format: []const u8, format_arguments: anytype) noreturn { + std.log.err(format, format_arguments); + exit(1); +} -- cgit v1.2.3