This commit is contained in:
sjinzh 2023-01-10 19:44:04 +08:00
parent a667e71b20
commit 749570da0d
2 changed files with 2 additions and 2 deletions

View file

@ -140,7 +140,7 @@ fn factorialRecur(n: i32) i32 {
} }
// Driver Code // Driver Code
pub fn main() void { pub fn main() !void {
// CPU架构和操作系统信息 // CPU架构和操作系统信息
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});

View file

@ -27,7 +27,7 @@ pub fn findOne(nums: []i32) i32 {
} }
// Driver Code // Driver Code
pub fn main() void { pub fn main() !void {
// CPU架构和操作系统信息 // CPU架构和操作系统信息
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{}); var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag}); std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});