Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1836781f
Commit
1836781f
authored
Sep 19, 2003
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve detection of whether tzset is broken.
parent
a425dbc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
15 deletions
+56
-15
configure
configure
+27
-8
configure.in
configure.in
+26
-7
pyconfig.h.in
pyconfig.h.in
+3
-0
No files found.
configure
View file @
1836781f
#! /bin/sh
# From configure.in Revision: 1.43
0
.
# From configure.in Revision: 1.43
1
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.57 for python 2.4.
#
...
...
@@ -18254,20 +18254,39 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <stdlib.h>
#include <time.h>
#include <string.h>
int main()
{
int gmt_hour;
int eastern_hour;
time_t now;
now = time((time_t*)NULL);
/* Note that we need to ensure that not only does tzset(3)
do 'something' with localtime, but it works as documented
in the library reference and as expected by the test suite.
Red Hat 6.2 doesn't understand the southern hemisphere
after New Year's Day; it thinks swaps on that day.
*/
time_t groundhogday = 1044144000; /* GMT-based; well, it's a colony */
time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
putenv("TZ=UTC+0");
tzset();
gmt_hour = localtime(&now)->tm_hour;
if (localtime(&groundhogday)->tm_hour != 0)
exit(1);
putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
tzset();
eastern_hour = localtime(&now)->tm_hour;
if (eastern_hour == gmt_hour)
if (localtime(&groundhogday)->tm_hour != 19)
exit(1);
putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
tzset();
if (localtime(&groundhogday)->tm_hour != 11)
exit(1);
if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
exit(1);
if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
exit(1);
exit(0);
}
...
...
configure.in
View file @
1836781f
...
...
@@ -2810,20 +2810,39 @@ AC_CACHE_VAL(ac_cv_working_tzset, [
AC_TRY_RUN([
#include <stdlib.h>
#include <time.h>
#include <string.h>
int main()
{
int gmt_hour;
int eastern_hour;
time_t now;
now = time((time_t*)NULL);
/* Note that we need to ensure that not only does tzset(3)
do 'something' with localtime, but it works as documented
in the library reference and as expected by the test suite.
Red Hat 6.2 doesn't understand the southern hemisphere
after New Year's Day; it thinks swaps on that day.
*/
time_t groundhogday = 1044144000; /* GMT-based; well, it's a colony */
time_t midyear = groundhogday + (365 * 24 * 3600 / 2);
putenv("TZ=UTC+0");
tzset();
gmt_hour = localtime(&now)->tm_hour;
if (localtime(&groundhogday)->tm_hour != 0)
exit(1);
putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
tzset();
eastern_hour = localtime(&now)->tm_hour;
if (eastern_hour == gmt_hour)
if (localtime(&groundhogday)->tm_hour != 19)
exit(1);
putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
tzset();
if (localtime(&groundhogday)->tm_hour != 11)
exit(1);
if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT"))
exit(1);
if (strcmp(localtime(&midyear)->tm_zone, "AEST"))
exit(1);
exit(0);
}
],
...
...
pyconfig.h.in
View file @
1836781f
...
...
@@ -600,6 +600,9 @@
`tzname'. */
#undef HAVE_TZNAME
/* Define this if you have tcl and TCL_UTF_MAX==6 */
#undef HAVE_UCS4_TCL
/* Define this if you have the type uintptr_t. */
#undef HAVE_UINTPTR_T
...
...
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