From f96f57930c65bedc00fb484a90b3c3932387982e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 31 Jul 2023 11:14:03 -0700 Subject: [PATCH] Revert "std.c: adding freebsd's CPU_COUNT macro portage." This reverts commit b9841750f91604020268549fc5e2c6b10c1f8477. --- lib/std/c/freebsd.zig | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig index 8381b65787..76e454a1f8 100644 --- a/lib/std/c/freebsd.zig +++ b/lib/std/c/freebsd.zig @@ -9,20 +9,6 @@ pub const CPU_SETSIZE = 256; pub const cpuset_t = extern struct { __bits: [(CPU_SETSIZE + (@bitSizeOf(c_long) - 1)) / @bitSizeOf(c_long)]c_long, }; - -// TODO: can eventually serve for the domainset_t's type too. -fn __BIT_COUNT(bits: []const c_long) c_long { - var count: c_long = 0; - for (bits) |b| { - count += @popCount(b); - } - return count; -} - -pub fn CPU_COUNT(set: cpuset_t) c_int { - return @as(c_int, @intCast(__BIT_COUNT(set.__bits[0..]))); -} - pub const cpulevel_t = c_int; pub const cpuwhich_t = c_int; pub const id_t = i64;