From 06e2392816cf935658547c18b89d8bf18054a2e1 Mon Sep 17 00:00:00 2001 From: torque Date: Sun, 12 May 2024 16:03:39 -0700 Subject: [PATCH] update for zig-0.12.0 --- cmark.build.zig | 6 ++++-- src/cmark.zig | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmark.build.zig b/cmark.build.zig index 3b610b1..4173ff7 100644 --- a/cmark.build.zig +++ b/cmark.build.zig @@ -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); diff --git a/src/cmark.zig b/src/cmark.zig index 7eac3e1..5bbb651 100644 --- a/src/cmark.zig +++ b/src/cmark.zig @@ -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 {