Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d3ecfe05
Commit
d3ecfe05
authored
Dec 10, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fixed _localtime64 implementation.
parent
11216fab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
37 deletions
+31
-37
dir.c
dlls/msvcrt/dir.c
+0
-1
file.c
dlls/msvcrt/file.c
+0
-1
time.c
dlls/msvcrt/time.c
+31
-35
No files found.
dlls/msvcrt/dir.c
View file @
d3ecfe05
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include "wine/port.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdarg.h>
#include <time.h>
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
...
...
dlls/msvcrt/file.c
View file @
d3ecfe05
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "wine/port.h"
#include <time.h>
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
...
...
dlls/msvcrt/time.c
View file @
d3ecfe05
...
@@ -25,12 +25,6 @@
...
@@ -25,12 +25,6 @@
#include "config.h"
#include "config.h"
#include <stdlib.h>
#include <stdlib.h>
#define _POSIX_PTHREAD_SEMANTICS
/* switch to a 2 arg style asctime_r on Solaris */
#include <time.h>
#ifdef HAVE_SYS_TIMES_H
# include <sys/times.h>
#endif
#include <limits.h>
#include "msvcrt.h"
#include "msvcrt.h"
#include "mtdll.h"
#include "mtdll.h"
...
@@ -52,20 +46,6 @@ static inline int IsLeapYear(int Year)
...
@@ -52,20 +46,6 @@ static inline int IsLeapYear(int Year)
return
Year
%
4
==
0
&&
(
Year
%
100
!=
0
||
Year
%
400
==
0
);
return
Year
%
4
==
0
&&
(
Year
%
100
!=
0
||
Year
%
400
==
0
);
}
}
static
inline
void
unix_tm_to_msvcrt
(
struct
MSVCRT_tm
*
dest
,
const
struct
tm
*
src
)
{
memset
(
dest
,
0
,
sizeof
(
*
dest
)
);
dest
->
tm_sec
=
src
->
tm_sec
;
dest
->
tm_min
=
src
->
tm_min
;
dest
->
tm_hour
=
src
->
tm_hour
;
dest
->
tm_mday
=
src
->
tm_mday
;
dest
->
tm_mon
=
src
->
tm_mon
;
dest
->
tm_year
=
src
->
tm_year
;
dest
->
tm_wday
=
src
->
tm_wday
;
dest
->
tm_yday
=
src
->
tm_yday
;
dest
->
tm_isdst
=
src
->
tm_isdst
;
}
static
inline
void
write_invalid_msvcrt_tm
(
struct
MSVCRT_tm
*
tm
)
static
inline
void
write_invalid_msvcrt_tm
(
struct
MSVCRT_tm
*
tm
)
{
{
tm
->
tm_sec
=
-
1
;
tm
->
tm_sec
=
-
1
;
...
@@ -378,32 +358,48 @@ MSVCRT___time32_t CDECL MSVCRT__mkgmtime(struct MSVCRT_tm *time)
...
@@ -378,32 +358,48 @@ MSVCRT___time32_t CDECL MSVCRT__mkgmtime(struct MSVCRT_tm *time)
/*********************************************************************
/*********************************************************************
* _localtime64_s (MSVCRT.@)
* _localtime64_s (MSVCRT.@)
*/
*/
int
CDECL
_localtime64_s
(
struct
MSVCRT_tm
*
time
,
const
MSVCRT___time64_t
*
secs
)
int
CDECL
_localtime64_s
(
struct
MSVCRT_tm
*
res
,
const
MSVCRT___time64_t
*
secs
)
{
{
struct
tm
*
tm
;
int
i
;
time_t
seconds
;
FILETIME
ft
;
SYSTEMTIME
st
;
ULONGLONG
time
;
if
(
!
time
||
!
secs
||
*
secs
<
0
||
*
secs
>
_MAX__TIME64_T
)
if
(
!
res
||
!
secs
||
*
secs
<
0
||
*
secs
>
_MAX__TIME64_T
)
{
{
if
(
time
)
if
(
res
)
write_invalid_msvcrt_tm
(
time
);
write_invalid_msvcrt_tm
(
res
);
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
}
seconds
=
*
secs
;
_tzset_init
();
time
=
(
*
secs
-
MSVCRT___timezone
)
*
(
ULONGLONG
)
TICKSPERSEC
+
TICKS_1601_TO_1970
;
_mlock
(
_TIME_LOCK
);
ft
.
dwHighDateTime
=
(
UINT
)(
time
>>
32
);
if
(
!
(
tm
=
localtime
(
&
seconds
)))
ft
.
dwLowDateTime
=
(
UINT
)
time
;
{
FileTimeToSystemTime
(
&
ft
,
&
st
);
_munlock
(
_TIME_LOCK
);
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
res
->
tm_isdst
=
is_dst
(
&
st
)
?
1
:
0
;
return
MSVCRT_EINVAL
;
if
(
res
->
tm_isdst
)
{
time
-=
MSVCRT__dstbias
*
(
ULONGLONG
)
TICKSPERSEC
;
ft
.
dwHighDateTime
=
(
UINT
)(
time
>>
32
);
ft
.
dwLowDateTime
=
(
UINT
)
time
;
FileTimeToSystemTime
(
&
ft
,
&
st
);
}
}
unix_tm_to_msvcrt
(
time
,
tm
);
res
->
tm_sec
=
st
.
wSecond
;
_munlock
(
_TIME_LOCK
);
res
->
tm_min
=
st
.
wMinute
;
res
->
tm_hour
=
st
.
wHour
;
res
->
tm_mday
=
st
.
wDay
;
res
->
tm_year
=
st
.
wYear
-
1900
;
res
->
tm_mon
=
st
.
wMonth
-
1
;
res
->
tm_wday
=
st
.
wDayOfWeek
;
for
(
i
=
res
->
tm_yday
=
0
;
i
<
st
.
wMonth
-
1
;
i
++
)
res
->
tm_yday
+=
MonthLengths
[
IsLeapYear
(
st
.
wYear
)][
i
];
res
->
tm_yday
+=
st
.
wDay
-
1
;
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment