mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Use the *_stat type as self
This commit is contained in:
parent
3a58b2330c
commit
5125eb77bd
@ -509,15 +509,15 @@ pub const libc_stat = extern struct {
|
||||
ctim: timespec,
|
||||
__unused: [2]isize,
|
||||
|
||||
pub fn atime(self: Stat) timespec {
|
||||
pub fn atime(self: libc_stat) timespec {
|
||||
return self.atim;
|
||||
}
|
||||
|
||||
pub fn mtime(self: Stat) timespec {
|
||||
pub fn mtime(self: libc_stat) timespec {
|
||||
return self.mtim;
|
||||
}
|
||||
|
||||
pub fn ctime(self: Stat) timespec {
|
||||
pub fn ctime(self: libc_stat) timespec {
|
||||
return self.ctim;
|
||||
}
|
||||
};
|
||||
@ -545,15 +545,15 @@ pub const kernel_stat = extern struct {
|
||||
// Hack to make the stdlib not complain about atime
|
||||
// and friends not being a method.
|
||||
// TODO what should tv_nsec be filled with?
|
||||
pub fn atime(self: Stat) timespec {
|
||||
pub fn atime(self: kernel_stat) timespec {
|
||||
return timespec{.tv_sec=self.atim, .tv_nsec=0};
|
||||
}
|
||||
|
||||
pub fn mtime(self: Stat) timespec {
|
||||
pub fn mtime(self: kernel_stat) timespec {
|
||||
return timespec{.tv_sec=self.mtim, .tv_nsec=0};
|
||||
}
|
||||
|
||||
pub fn ctime(self: Stat) timespec {
|
||||
pub fn ctime(self: kernel_stat) timespec {
|
||||
return timespec{.tv_sec=self.ctim, .tv_nsec=0};
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user