lib/ini: sync with upstream at 19e1210

exact command:

    git subtree --prefix=lib/ini --squash pull \
      https://github.com/ziglibs/ini \
      19e1210063882ab7db73a8aaa60e733d4aaafe9f
master^2
alex 5 months ago
commit e07b1557c7
Signed by: x1ddos
GPG Key ID: FDEFB4A63CBD8460

@ -2,9 +2,10 @@ const std = @import("std");
pub fn build(b: *std.Build) void { pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{}); const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
_ = b.addModule("ini", .{ _ = b.addModule("ini", .{
.source_file = .{ .root_source_file = .{
.path = "src/ini.zig", .path = "src/ini.zig",
}, },
}); });
@ -12,9 +13,10 @@ pub fn build(b: *std.Build) void {
const lib = b.addStaticLibrary(.{ const lib = b.addStaticLibrary(.{
.name = "ini", .name = "ini",
.root_source_file = .{ .path = "src/lib.zig" }, .root_source_file = .{ .path = "src/lib.zig" },
.target = b.standardTargetOptions(.{}), .target = target,
.optimize = optimize, .optimize = optimize,
}); });
lib.bundle_compiler_rt = true; lib.bundle_compiler_rt = true;
lib.addIncludePath(.{ .path = "src" }); lib.addIncludePath(.{ .path = "src" });
lib.linkLibC(); lib.linkLibC();
@ -24,6 +26,7 @@ pub fn build(b: *std.Build) void {
const example_c = b.addExecutable(.{ const example_c = b.addExecutable(.{
.name = "example-c", .name = "example-c",
.optimize = optimize, .optimize = optimize,
.target = target,
}); });
example_c.addCSourceFile(.{ example_c.addCSourceFile(.{
.file = .{ .file = .{
@ -45,8 +48,9 @@ pub fn build(b: *std.Build) void {
.name = "example-zig", .name = "example-zig",
.root_source_file = .{ .path = "example/example.zig" }, .root_source_file = .{ .path = "example/example.zig" },
.optimize = optimize, .optimize = optimize,
.target = target,
}); });
example_zig.addModule("ini", b.modules.get("ini").?); example_zig.root_module.addImport("ini", b.modules.get("ini").?);
b.installArtifact(example_zig); b.installArtifact(example_zig);

@ -78,7 +78,7 @@ test "buffer parser" {
} }
test "file parser" { test "file parser" {
var file = c.fopen("example/example.ini", "rb") orelse unreachable; const file = c.fopen("example/example.ini", "rb") orelse unreachable;
defer _ = c.fclose(file); defer _ = c.fclose(file);
var parser: c.ini_Parser = undefined; var parser: c.ini_Parser = undefined;