This commit is contained in:
RiskyMH
2025-07-23 02:08:33 +10:00
parent 1df8ad0199
commit c31bd9505a
3 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ pub const Meta = extern struct {
arch: Npm.Architecture = .all,
os: Npm.OperatingSystem = .all,
libc: Npm.Libc = .all,
libc: Npm.Libc = .none,
_padding_after_platform: u8 = 0,
id: PackageID = invalid_package_id,

View File

@@ -313,7 +313,7 @@ pub fn jsonStringify(this: *const Lockfile, w: anytype) !void {
}
}
if (@as(u16, @intFromEnum(pkg.meta.libc)) != Npm.Libc.all_value) {
if (pkg.meta.libc != .none) {
try w.objectField("libc");
try w.beginArray();
defer w.endArray() catch {};

View File

@@ -783,15 +783,15 @@ pub const Libc = enum(u8) {
}
pub fn isMatch(this: Libc) bool {
return (@intFromEnum(this) & @intFromEnum(current)) != 0 or this == .none;
return (@intFromEnum(this) & @intFromEnum(current)) != 0;
}
pub fn isMatchWithTarget(this: Libc, target: Libc) bool {
return (@intFromEnum(this) & @intFromEnum(target)) != 0 or this == .none;
return (@intFromEnum(this) & @intFromEnum(target)) != 0;
}
pub fn negatable(this: Libc) Negatable(Libc) {
return .{ .added = this, .removed = .none };
return .{ .added = .none, .removed = this };
}
pub const current: Libc = switch (Environment.os) {