std.c: remove unnecessary use of usingnamespace

Thanks to Zig's lazy analysis, it's fine for these symbols to be
declared on platform they won't exist on. This is already done in
several places in this file; e.g. `pthread` functions are declared
unconditionally.

Eliminates one more usage of `usingnamespace` from the standard library.
4 remain.
This commit is contained in:
mlugg 2024-03-07 19:10:24 +00:00
parent 508a8739e2
commit f4bf061d8a
No known key found for this signature in database
GPG key ID: 58978E823BDE3EF9

View file

@ -1494,9 +1494,6 @@ pub const speed_t = switch (native_os) {
pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int; pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int;
// Unix-like systems // Unix-like systems
pub usingnamespace switch (native_os) {
.netbsd, .windows => struct {},
else => struct {
pub const DIR = opaque {}; pub const DIR = opaque {};
pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR; pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR;
pub extern "c" fn fdopendir(fd: c_int) ?*DIR; pub extern "c" fn fdopendir(fd: c_int) ?*DIR;
@ -1524,8 +1521,6 @@ pub usingnamespace switch (native_os) {
pub extern "c" fn alarm(seconds: c_uint) c_uint; pub extern "c" fn alarm(seconds: c_uint) c_uint;
pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int; pub extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int;
},
};
pub const fstat = switch (native_os) { pub const fstat = switch (native_os) {
.macos => switch (native_arch) { .macos => switch (native_arch) {