update for zig-0.12.0

This commit is contained in:
torque 2024-05-12 16:03:39 -07:00
parent 2a4b73c0f5
commit 06e2392816
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk
2 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@ pub fn cmark_lib(
const config_h = b.addConfigHeader(.{
.style = .{ .cmake = .{ .path = cmark_src_prefix ++ "config.h.in" } },
.include_path = "config.h",
}, .{
.HAVE_STDBOOL_H = void{},
.HAVE___ATTRIBUTE__ = void{},
@ -35,6 +36,7 @@ pub fn cmark_lib(
const cmark_version_h = b.addConfigHeader(.{
.style = .{ .cmake = .{ .path = cmark_src_prefix ++ "cmark_version.h.in" } },
.include_path = "cmark_version.h",
}, .{
.PROJECT_VERSION_MAJOR = 0,
.PROJECT_VERSION_MINOR = 30,
@ -44,10 +46,10 @@ pub fn cmark_lib(
lib.addConfigHeader(config_h);
lib.addConfigHeader(cmark_version_h);
lib.addIncludePath(.{ .path = cmark_zig_prefix });
lib.installConfigHeader(cmark_version_h, .{ .dest_rel_path = "cmark_version.h" });
lib.installConfigHeader(cmark_version_h);
inline for (install_headers) |header| {
lib.installHeader(header.base_dir ++ header.name, header.name);
lib.installHeader(b.path(header.base_dir ++ header.name), header.name);
}
b.installArtifact(lib);

View File

@ -102,7 +102,7 @@ const AllocHeader = extern struct {
}
inline fn fromTipPointer(tip: *u8) *AllocHeader {
return @fieldParentPtr(AllocHeader, "tip", tip);
return @alignCast(@fieldParentPtr("tip", tip));
}
inline fn fullAllocFromTip(tip: *anyopaque) align(@alignOf(AllocHeader)) []u8 {