mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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:
parent
508a8739e2
commit
f4bf061d8a
1 changed files with 20 additions and 25 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue