Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3778 from MartinNowak/merge_stable
Browse files Browse the repository at this point in the history
merge stable

Signed-off-by: Iain Buclaw <ibuclaw@users.noreply.github.com>
Merged-on-behalf-of: Iain Buclaw <ibuclaw@users.noreply.github.com>
  • Loading branch information
dlang-bot authored Mar 8, 2022
2 parents 0a72033 + d7649c8 commit 26b5816
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 22 deletions.
3 changes: 0 additions & 3 deletions changelog/openbsd_ioctls.dd

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/safe_opequals.dd

This file was deleted.

61 changes: 45 additions & 16 deletions src/core/sys/windows/stat.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ version (Windows):
extern (C) nothrow @nogc:
@system:

import core.sys.windows.stdc.time;

// Posix version is in core.sys.posix.sys.stat

enum S_IFMT = 0xF000;
Expand All @@ -30,22 +32,49 @@ int S_ISDIR(int m) { return (m & S_IFMT) == S_IFDIR; }
int S_ISCHR(int m) { return (m & S_IFMT) == S_IFCHR; }
}

struct struct_stat
version (CRuntime_DigitalMars)
{
short st_dev;
ushort st_ino;
ushort st_mode;
short st_nlink;
ushort st_uid;
ushort st_gid;
short st_rdev;
short dummy;
int st_size;
int st_atime;
int st_mtime;
int st_ctime;
struct struct_stat
{
short st_dev;
ushort st_ino;
ushort st_mode;
short st_nlink;
ushort st_uid;
ushort st_gid;
short st_rdev;
short dummy;
int st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
}

int stat(const(char)*, struct_stat *);
int fstat(int, struct_stat *) @trusted;
int _wstat(const(wchar)*, struct_stat *);
}
else version (CRuntime_Microsoft)
{
struct struct_stat
{
uint st_dev;
ushort st_ino;
ushort st_mode;
short st_nlink;
short st_uid;
short st_gid;
uint st_rdev;
int st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
}

int stat(const(char)*, struct_stat *);
int fstat(int, struct_stat *) @trusted;
int _wstat(const(wchar)*, struct_stat *);
// These assume time_t is 32 bits (which druntime's definition currently is)
// Add pragma(mangle) to use _stat64 etc. when time_t is made 64-bit
// See also: https://issues.dlang.org/show_bug.cgi?id=21134
int stat(const(char)*, struct_stat *);
int fstat(int, struct_stat *) @trusted;
int _wstat(const(wchar)*, struct_stat *);
}

0 comments on commit 26b5816

Please sign in to comment.