diff options
Diffstat (limited to 'pr/src/md/windows/ntio.c')
-rw-r--r-- | pr/src/md/windows/ntio.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/pr/src/md/windows/ntio.c b/pr/src/md/windows/ntio.c index 299033cc..e206f787 100644 --- a/pr/src/md/windows/ntio.c +++ b/pr/src/md/windows/ntio.c @@ -99,7 +99,11 @@ static DWORD dirAccessTable[] = { * We store the value in a PRTime variable for convenience. * This constant is used by _PR_FileTimeToPRTime(). */ +#ifdef __GNUC__ +static const PRTime _pr_filetime_offset = 116444736000000000LL; +#else static const PRTime _pr_filetime_offset = 116444736000000000i64; +#endif #define _NEED_351_FILE_LOCKING_HACK #ifdef _NEED_351_FILE_LOCKING_HACK @@ -2322,7 +2326,7 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len) } PRInt32 -_PR_MD_WRITE(PRFileDesc *fd, void *buf, PRInt32 len) +_PR_MD_WRITE(PRFileDesc *fd, const void *buf, PRInt32 len) { PRInt32 f = fd->secret->md.osfd; PRInt32 bytes; @@ -2488,7 +2492,7 @@ _PR_MD_PIPEAVAILABLE(PRFileDesc *fd) } PROffset32 -_PR_MD_LSEEK(PRFileDesc *fd, PROffset32 offset, int whence) +_PR_MD_LSEEK(PRFileDesc *fd, PROffset32 offset, PRSeekWhence whence) { DWORD moveMethod; PROffset32 rv; @@ -2521,7 +2525,7 @@ _PR_MD_LSEEK(PRFileDesc *fd, PROffset32 offset, int whence) } PROffset64 -_PR_MD_LSEEK64(PRFileDesc *fd, PROffset64 offset, int whence) +_PR_MD_LSEEK64(PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence) { DWORD moveMethod; LARGE_INTEGER li; @@ -2815,12 +2819,16 @@ _PR_MD_DELETE(const char *name) } } -static void +void _PR_FileTimeToPRTime(const FILETIME *filetime, PRTime *prtm) { PR_ASSERT(sizeof(FILETIME) == sizeof(PRTime)); CopyMemory(prtm, filetime, sizeof(PRTime)); +#ifdef __GNUC__ + *prtm = (*prtm - _pr_filetime_offset) / 10LL; +#else *prtm = (*prtm - _pr_filetime_offset) / 10i64; +#endif #ifdef DEBUG /* Doublecheck our calculation. */ @@ -3168,7 +3176,7 @@ _PR_MD_RENAME(const char *from, const char *to) } PRInt32 -_PR_MD_ACCESS(const char *name, PRIntn how) +_PR_MD_ACCESS(const char *name, PRAccessHow how) { PRInt32 rv; |