breaking changes
0.12.0
target 回り
root_module.resolved_target
!
- const target = step.target;
- if (target.isWindows()) {
+ const target = step.root_module.resolved_target.?;
+ if (target.result.os.tag == .windows) {
addPackage => addModule => addImport
👇
std.build.LibExeObjStep => std.Build.Step.Compile;
extra capture in for loop
zig init-exe は zig init に
なった。
exe.addModule の変更
0.11.0
json.TokenStream
0.10.0
std.ChildProcess.init
const proc = try std.ChildProcess.init(argv, gpa);
// 👇
var proc = std.ChildProcess.init(argv, gpa);
Pkg.path
FileSource に型変更。
pub const glfw = Pkg{
.name = "glfw",
.path = FileSource{
.path = ".gyro\\mach-glfw-hexops-github.com-dae779de\\pkg\\src\\main.zig",
},
};
0.9.1 (20220214)
0.9.0
use of undeclared identifier
例
const std = @import("std");
usingnamespace std.os.windows.user32;
pub fn main() anyerror!void {
const wndclass = WNDCLASSEXA // <- use of undeclared identifier
👇 symbol import に頼らない
const std = @import("std");
const user32 = std.os.windows.user32;
pub fn main() anyerror!void {
const wndclass = user32.WNDCLASSEXA
Unused-Locals
const a = 0;
// とりあえず
_ = a;
0.8.0
builtin
container 'std.builtin' has no member called 'os'
OS判定ができない
std.Target.current.os.tag == .macos
const builtin = @import("builtin");
const separator = if (builtin.os.tag == builtin.Os.windows) '\\' else '/';
0.7.0
comptime var to anytype
https://github.com/ziglang/zig/issues/4820
expected type expression, found 'var'
comptime name: var
型推論の文法?
https://ziglang.org/documentation/master/#Function-Parameter-Type-Inference
comptime name: anytype
0.6.0
Trouble
libc headers not available; compilation does not link against libc
biuld.zig
exe.linkLibC();
error: AccessDenied
exe.linkSystemLibrary("c");
exe.linkSystemLibrary("c++");