Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c4d68778
Commit
c4d68778
authored
Apr 27, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _mkgmtime implementation.
parent
42375518
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
20 deletions
+133
-20
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+3
-3
time.c
dlls/msvcrt/tests/time.c
+68
-13
time.c
dlls/msvcrt/time.c
+58
-0
No files found.
dlls/msvcr80/msvcr80.spec
View file @
c4d68778
...
@@ -800,8 +800,8 @@
...
@@ -800,8 +800,8 @@
@ cdecl _memicmp(str str long) msvcrt._memicmp
@ cdecl _memicmp(str str long) msvcrt._memicmp
@ stub _memicmp_l
@ stub _memicmp_l
@ cdecl _mkdir(str) msvcrt._mkdir
@ cdecl _mkdir(str) msvcrt._mkdir
@
stub
_mkgmtime32
@
cdecl _mkgmtime32(ptr) msvcrt.
_mkgmtime32
@
stub
_mkgmtime64
@
cdecl _mkgmtime64(ptr) msvcrt.
_mkgmtime64
@ cdecl _mktemp(str) msvcrt._mktemp
@ cdecl _mktemp(str) msvcrt._mktemp
@ stub _mktemp_s
@ stub _mktemp_s
@ cdecl _mktime32(ptr) msvcrt._mktime32
@ cdecl _mktime32(ptr) msvcrt._mktime32
...
...
dlls/msvcr90/msvcr90.spec
View file @
c4d68778
...
@@ -788,8 +788,8 @@
...
@@ -788,8 +788,8 @@
@ cdecl _memicmp(str str long) msvcrt._memicmp
@ cdecl _memicmp(str str long) msvcrt._memicmp
@ stub _memicmp_l
@ stub _memicmp_l
@ cdecl _mkdir(str) msvcrt._mkdir
@ cdecl _mkdir(str) msvcrt._mkdir
@
stub
_mkgmtime32
@
cdecl _mkgmtime32(ptr) msvcrt.
_mkgmtime32
@
stub
_mkgmtime64
@
cdecl _mkgmtime64(ptr) msvcrt.
_mkgmtime64
@ cdecl _mktemp(str) msvcrt._mktemp
@ cdecl _mktemp(str) msvcrt._mktemp
@ stub _mktemp_s
@ stub _mktemp_s
@ cdecl _mktime32(ptr) msvcrt._mktime32
@ cdecl _mktime32(ptr) msvcrt._mktime32
...
...
dlls/msvcrt/msvcrt.spec
View file @
c4d68778
...
@@ -745,9 +745,9 @@
...
@@ -745,9 +745,9 @@
@ cdecl _memicmp(str str long) ntdll._memicmp
@ cdecl _memicmp(str str long) ntdll._memicmp
# stub _memicmp_l
# stub _memicmp_l
@ cdecl _mkdir(str) MSVCRT__mkdir
@ cdecl _mkdir(str) MSVCRT__mkdir
# stub
_mkgmtime
@ cdecl _mkgmtime(ptr) MSVCRT_
_mkgmtime
# stub
_mkgmtime32
@ cdecl _mkgmtime32(ptr) MSVCRT_
_mkgmtime32
# stub
_mkgmtime64
@ cdecl _mkgmtime64(ptr) MSVCRT_
_mkgmtime64
@ cdecl _mktemp(str)
@ cdecl _mktemp(str)
# stub _mktemp_s
# stub _mktemp_s
@ cdecl _mktime32(ptr) MSVCRT__mktime32
@ cdecl _mktime32(ptr) MSVCRT__mktime32
...
...
dlls/msvcrt/tests/time.c
View file @
c4d68778
...
@@ -54,20 +54,75 @@ static void test_ctime(void)
...
@@ -54,20 +54,75 @@ static void test_ctime(void)
}
}
static
void
test_gmtime
(
void
)
static
void
test_gmtime
(
void
)
{
{
time_t
gmt
=
0
;
static
__time32_t
(
__cdecl
*
p_mkgmtime32
)(
struct
tm
*
);
struct
tm
*
gmt_tm
=
gmtime
(
&
gmt
);
static
struct
tm
*
(
__cdecl
*
p_gmtime32
)(
__time32_t
*
);
if
(
gmt_tm
==
0
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"msvcrt.dll"
);
ok
(
0
,
"gmtime() error
\n
"
);
__time32_t
valid
,
gmt
;
return
;
struct
tm
*
gmt_tm
;
}
p_gmtime32
=
(
void
*
)
GetProcAddress
(
hmod
,
"_gmtime32"
);
if
(
!
p_gmtime32
)
{
win_skip
(
"Skipping _gmtime32 tests
\n
"
);
return
;
}
gmt
=
valid
=
0
;
gmt_tm
=
p_gmtime32
(
&
gmt
);
if
(
!
gmt_tm
)
{
ok
(
0
,
"_gmtime32() failed
\n
"
);
return
;
}
ok
(((
gmt_tm
->
tm_year
==
70
)
&&
(
gmt_tm
->
tm_mon
==
0
)
&&
(
gmt_tm
->
tm_yday
==
0
)
&&
ok
(((
gmt_tm
->
tm_year
==
70
)
&&
(
gmt_tm
->
tm_mon
==
0
)
&&
(
gmt_tm
->
tm_yday
==
0
)
&&
(
gmt_tm
->
tm_mday
==
1
)
&&
(
gmt_tm
->
tm_wday
==
4
)
&&
(
gmt_tm
->
tm_hour
==
0
)
&&
(
gmt_tm
->
tm_mday
==
1
)
&&
(
gmt_tm
->
tm_wday
==
4
)
&&
(
gmt_tm
->
tm_hour
==
0
)
&&
(
gmt_tm
->
tm_min
==
0
)
&&
(
gmt_tm
->
tm_sec
==
0
)
&&
(
gmt_tm
->
tm_isdst
==
0
)),
(
gmt_tm
->
tm_min
==
0
)
&&
(
gmt_tm
->
tm_sec
==
0
)
&&
(
gmt_tm
->
tm_isdst
==
0
)),
"Wrong date:Year %4d mon %2d yday %3d mday %2d wday %1d hour%2d min %2d sec %2d dst %2d
\n
"
,
"Wrong date:Year %4d mon %2d yday %3d mday %2d wday %1d hour%2d min %2d sec %2d dst %2d
\n
"
,
gmt_tm
->
tm_year
,
gmt_tm
->
tm_mon
,
gmt_tm
->
tm_yday
,
gmt_tm
->
tm_mday
,
gmt_tm
->
tm_wday
,
gmt_tm
->
tm_year
,
gmt_tm
->
tm_mon
,
gmt_tm
->
tm_yday
,
gmt_tm
->
tm_mday
,
gmt_tm
->
tm_wday
,
gmt_tm
->
tm_hour
,
gmt_tm
->
tm_min
,
gmt_tm
->
tm_sec
,
gmt_tm
->
tm_isdst
);
gmt_tm
->
tm_hour
,
gmt_tm
->
tm_min
,
gmt_tm
->
tm_sec
,
gmt_tm
->
tm_isdst
);
p_mkgmtime32
=
(
void
*
)
GetProcAddress
(
hmod
,
"_mkgmtime32"
);
if
(
!
p_mkgmtime32
)
{
win_skip
(
"Skipping _mkgmtime32 tests
\n
"
);
return
;
}
gmt_tm
->
tm_wday
=
gmt_tm
->
tm_yday
=
0
;
gmt
=
p_mkgmtime32
(
gmt_tm
);
ok
(
gmt
==
valid
,
"gmt = %u
\n
"
,
gmt
);
ok
(
gmt_tm
->
tm_wday
==
4
,
"gmt_tm->tm_wday = %d
\n
"
,
gmt_tm
->
tm_wday
);
ok
(
gmt_tm
->
tm_yday
==
0
,
"gmt_tm->tm_yday = %d
\n
"
,
gmt_tm
->
tm_yday
);
gmt_tm
->
tm_wday
=
gmt_tm
->
tm_yday
=
0
;
gmt_tm
->
tm_isdst
=
-
1
;
gmt
=
p_mkgmtime32
(
gmt_tm
);
ok
(
gmt
==
valid
,
"gmt = %u
\n
"
,
gmt
);
ok
(
gmt_tm
->
tm_wday
==
4
,
"gmt_tm->tm_wday = %d
\n
"
,
gmt_tm
->
tm_wday
);
ok
(
gmt_tm
->
tm_yday
==
0
,
"gmt_tm->tm_yday = %d
\n
"
,
gmt_tm
->
tm_yday
);
gmt_tm
->
tm_wday
=
gmt_tm
->
tm_yday
=
0
;
gmt_tm
->
tm_isdst
=
1
;
gmt
=
p_mkgmtime32
(
gmt_tm
);
ok
(
gmt
==
valid
,
"gmt = %u
\n
"
,
gmt
);
ok
(
gmt_tm
->
tm_wday
==
4
,
"gmt_tm->tm_wday = %d
\n
"
,
gmt_tm
->
tm_wday
);
ok
(
gmt_tm
->
tm_yday
==
0
,
"gmt_tm->tm_yday = %d
\n
"
,
gmt_tm
->
tm_yday
);
gmt
=
valid
=
173921
;
gmt_tm
=
p_gmtime32
(
&
gmt
);
if
(
!
gmt_tm
)
{
ok
(
0
,
"_gmtime32() failed
\n
"
);
return
;
}
gmt_tm
->
tm_isdst
=
-
1
;
gmt
=
p_mkgmtime32
(
gmt_tm
);
ok
(
gmt
==
valid
,
"gmt = %u
\n
"
,
gmt
);
ok
(
gmt_tm
->
tm_wday
==
6
,
"gmt_tm->tm_wday = %d
\n
"
,
gmt_tm
->
tm_wday
);
ok
(
gmt_tm
->
tm_yday
==
2
,
"gmt_tm->tm_yday = %d
\n
"
,
gmt_tm
->
tm_yday
);
gmt_tm
->
tm_isdst
=
1
;
gmt
=
p_mkgmtime32
(
gmt_tm
);
ok
(
gmt
==
valid
,
"gmt = %u
\n
"
,
gmt
);
}
}
static
void
test_mktime
(
void
)
static
void
test_mktime
(
void
)
...
...
dlls/msvcrt/time.c
View file @
c4d68778
...
@@ -123,6 +123,64 @@ MSVCRT___time32_t CDECL MSVCRT_mktime(struct MSVCRT_tm *mstm)
...
@@ -123,6 +123,64 @@ MSVCRT___time32_t CDECL MSVCRT_mktime(struct MSVCRT_tm *mstm)
}
}
#endif
#endif
/**********************************************************************
* _mkgmtime64 (MSVCRT.@)
*
* time->tm_isdst value is ignored
*/
MSVCRT___time64_t
CDECL
MSVCRT__mkgmtime64
(
struct
MSVCRT_tm
*
time
)
{
SYSTEMTIME
st
;
FILETIME
ft
;
MSVCRT___time64_t
ret
;
int
i
;
st
.
wMilliseconds
=
0
;
st
.
wSecond
=
time
->
tm_sec
;
st
.
wMinute
=
time
->
tm_min
;
st
.
wHour
=
time
->
tm_hour
;
st
.
wDay
=
time
->
tm_mday
;
st
.
wMonth
=
time
->
tm_mon
+
1
;
st
.
wYear
=
time
->
tm_year
+
1900
;
if
(
!
SystemTimeToFileTime
(
&
st
,
&
ft
))
return
-
1
;
FileTimeToSystemTime
(
&
ft
,
&
st
);
time
->
tm_wday
=
st
.
wDayOfWeek
;
for
(
i
=
time
->
tm_yday
=
0
;
i
<
st
.
wMonth
-
1
;
i
++
)
time
->
tm_yday
+=
MonthLengths
[
IsLeapYear
(
st
.
wYear
)][
i
];
time
->
tm_yday
+=
st
.
wDay
-
1
;
ret
=
((
MSVCRT___time64_t
)
ft
.
dwHighDateTime
<<
32
)
+
ft
.
dwLowDateTime
;
ret
=
(
ret
-
TICKS_1601_TO_1970
)
/
TICKSPERSEC
;
return
ret
;
}
/**********************************************************************
* _mkgmtime32 (MSVCRT.@)
*/
MSVCRT___time32_t
CDECL
MSVCRT__mkgmtime32
(
struct
MSVCRT_tm
*
time
)
{
return
MSVCRT__mkgmtime64
(
time
);
}
/**********************************************************************
* _mkgmtime (MSVCRT.@)
*/
#ifdef _WIN64
MSVCRT___time64_t
CDECL
MSVCRT__mkgmtime
(
struct
MSVCRT_tm
*
time
)
{
return
MSVCRT__mkgmtime64
(
time
);
}
#else
MSVCRT___time32_t
CDECL
MSVCRT__mkgmtime
(
struct
MSVCRT_tm
*
time
)
{
return
MSVCRT__mkgmtime32
(
time
);
}
#endif
/*********************************************************************
/*********************************************************************
* _localtime64 (MSVCRT.@)
* _localtime64 (MSVCRT.@)
*/
*/
...
...
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