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
6618b035
Commit
6618b035
authored
May 24, 2005
by
Phil Krylov
Committed by
Alexandre Julliard
May 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added detection of platforms which don't have external timezone and
daylight variables, and emulation of these variables.
parent
31f718b8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
0 deletions
+163
-0
configure
configure
+123
-0
configure.ac
configure.ac
+16
-0
time.c
dlls/msvcrt/time.c
+18
-0
config.h.in
include/config.h.in
+6
-0
No files found.
configure
View file @
6618b035
...
...
@@ -19760,6 +19760,129 @@ _ACEOF
fi
echo
"
$as_me
:
$LINENO
: checking for timezone variable"
>
&5
echo
$ECHO_N
"checking for timezone variable...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_have_timezone
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
#include <time.h>
int
main ()
{
timezone;
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_have_timezone
=
"yes"
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
ac_cv_have_timezone
=
"no"
fi
rm
-f
conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_have_timezone
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_have_timezone
"
>
&6
if
test
"
$ac_cv_have_timezone
"
=
"yes"
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define HAVE_TIMEZONE 1
_ACEOF
fi
echo
"
$as_me
:
$LINENO
: checking for daylight variable"
>
&5
echo
$ECHO_N
"checking for daylight variable...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_have_daylight
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
#include <time.h>
int
main ()
{
daylight;
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_have_daylight
=
"yes"
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
ac_cv_have_daylight
=
"no"
fi
rm
-f
conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_have_daylight
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_have_daylight
"
>
&6
if
test
"
$ac_cv_have_daylight
"
=
"yes"
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define HAVE_DAYLIGHT 1
_ACEOF
fi
case
$host_cpu
in
*
i[3456789]86
*
)
echo
"
$as_me
:
$LINENO
: checking whether we need to define __i386__"
>
&5
...
...
configure.ac
View file @
6618b035
...
...
@@ -1474,6 +1474,22 @@ AC_CHECK_MEMBERS([struct option.name],,,
dnl Check for stat.st_blocks
AC_CHECK_MEMBERS([struct stat.st_blocks])
dnl Check for the external timezone variables timezone and daylight
AC_CACHE_CHECK([for timezone variable], ac_cv_have_timezone,
AC_TRY_LINK([#include <time.h>],[timezone;],
ac_cv_have_timezone="yes", ac_cv_have_timezone="no"))
if test "$ac_cv_have_timezone" = "yes"
then
AC_DEFINE(HAVE_TIMEZONE, 1, [Define if you have the timezone variable])
fi
AC_CACHE_CHECK([for daylight variable], ac_cv_have_daylight,
AC_TRY_LINK([#include <time.h>],[daylight;],
ac_cv_have_daylight="yes", ac_cv_have_daylight="no"))
if test "$ac_cv_have_daylight" = "yes"
then
AC_DEFINE(HAVE_DAYLIGHT, 1, [Define if you have the daylight variable])
fi
dnl *** check for the need to define platform-specific symbols
case $host_cpu in
...
...
dlls/msvcrt/time.c
View file @
6618b035
...
...
@@ -348,8 +348,26 @@ char **__p__tzname(void)
void
MSVCRT__tzset
(
void
)
{
tzset
();
#if defined(HAVE_TIMEZONE) && defined(HAVE_DAYLIGHT)
MSVCRT___daylight
=
daylight
;
MSVCRT___timezone
=
timezone
;
#else
{
static
const
time_t
seconds_in_year
=
(
365
*
24
+
6
)
*
3600
;
time_t
t
;
struct
tm
*
tmp
;
long
zone_january
,
zone_july
;
t
=
(
time
((
time_t
*
)
0
)
/
seconds_in_year
)
*
seconds_in_year
;
tmp
=
localtime
(
&
t
);
zone_january
=
-
tmp
->
tm_gmtoff
;
t
+=
seconds_in_year
/
2
;
tmp
=
localtime
(
&
t
);
zone_july
=
-
tmp
->
tm_gmtoff
;
MSVCRT___daylight
=
(
zone_january
!=
zone_july
);
MSVCRT___timezone
=
max
(
zone_january
,
zone_july
);
}
#endif
lstrcpynA
(
tzname_std
,
tzname
[
0
],
sizeof
(
tzname_std
));
tzname_std
[
sizeof
(
tzname_std
)
-
1
]
=
'\0'
;
lstrcpynA
(
tzname_dst
,
tzname
[
1
],
sizeof
(
tzname_dst
));
...
...
include/config.h.in
View file @
6618b035
...
...
@@ -71,6 +71,9 @@
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define if you have the daylight variable */
#undef HAVE_DAYLIGHT
/* Define to 1 if you have the <direct.h> header file. */
#undef HAVE_DIRECT_H
...
...
@@ -740,6 +743,9 @@
/* Define to 1 if you have the `timegm' function. */
#undef HAVE_TIMEGM
/* Define if you have the timezone variable */
#undef HAVE_TIMEZONE
/* Define to 1 if you have the <ucontext.h> header file. */
#undef HAVE_UCONTEXT_H
...
...
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