Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit400d5ff

Browse files
committed
Simplify PGAC_STRUCT_TIMEZONE Autoconf macro
Since63bd0db we don't use tznameanymore, so we don't need to check for it. Instead, just keep thepart of PGAC_STRUCT_TIMEZONE that we need, which is the check forstruct tm.tm_zone.Discussion:https://www.postgresql.org/message-id/flat/5eb11a37-f3ca-5fb7-308f-4485dec25a2e%402ndquadrant.com
1 parent4d7e5a5 commit400d5ff

File tree

5 files changed

+7
-123
lines changed

5 files changed

+7
-123
lines changed

‎config/c-library.m4

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,14 @@ fi])# PGAC_VAR_INT_TIMEZONE
2626
# PGAC_STRUCT_TIMEZONE
2727
# ------------------
2828
# Figure out how to get the current timezone. If `struct tm' has a
29-
# `tm_zone' member, define `HAVE_TM_ZONE'.Also, if the
30-
#external array `tzname' is found, define `HAVE_TZNAME'.
31-
#This is the same as the standard macro AC_STRUCT_TIMEZONE, except that
32-
#tzname[] is checked for regardless of whether we find tm_zone.
29+
# `tm_zone' member, define `HAVE_STRUCT_TM_TM_ZONE'.Unlike the
30+
#standard macro AC_STRUCT_TIMEZONE, we don't check for `tzname[]' if
31+
#not found, since we don't use it. (We use `int timezone' as a
32+
#fallback.)
3333
AC_DEFUN([PGAC_STRUCT_TIMEZONE],
34-
[AC_REQUIRE([AC_STRUCT_TM])dnl
35-
AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
36-
#include <$ac_cv_struct_tm>
37-
])
38-
if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
39-
AC_DEFINE(HAVE_TM_ZONE,1,
40-
[Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
41-
`HAVE_STRUCT_TM_TM_ZONE' instead.])
42-
fi
43-
AC_CACHE_CHECK(fortzname,ac_cv_var_tzname,
44-
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
45-
[[#include <stdlib.h>
34+
[AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <sys/types.h>
4635
#include <time.h>
47-
#ifndef tzname /* For SGI. */
48-
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
49-
#endif
50-
]],
51-
[atoi(*tzname);])],ac_cv_var_tzname=yes,ac_cv_var_tzname=no)])
52-
if test $ac_cv_var_tzname = yes; then
53-
AC_DEFINE(HAVE_TZNAME,1,
54-
[Define to 1 if you have the external array `tzname'.])
55-
fi
36+
])
5637
])# PGAC_STRUCT_TIMEZONE
5738

5839

‎configure

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -13964,43 +13964,8 @@ if test x"$pgac_cv_computed_goto" = xyes ; then
1396413964
$as_echo "#define HAVE_COMPUTED_GOTO 1" >>confdefs.h
1396513965

1396613966
fi
13967-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
13968-
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
13969-
if ${ac_cv_struct_tm+:} false; then :
13970-
$as_echo_n "(cached) " >&6
13971-
else
13972-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13973-
/* end confdefs.h. */
13974-
#include <sys/types.h>
13975-
#include <time.h>
13976-
13977-
int
13978-
main ()
13979-
{
13980-
struct tm tm;
13981-
int *p = &tm.tm_sec;
13982-
return !p;
13983-
;
13984-
return 0;
13985-
}
13986-
_ACEOF
13987-
if ac_fn_c_try_compile "$LINENO"; then :
13988-
ac_cv_struct_tm=time.h
13989-
else
13990-
ac_cv_struct_tm=sys/time.h
13991-
fi
13992-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13993-
fi
13994-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
13995-
$as_echo "$ac_cv_struct_tm" >&6; }
13996-
if test $ac_cv_struct_tm = sys/time.h; then
13997-
13998-
$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
13999-
14000-
fi
14001-
1400213967
ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
14003-
#include <$ac_cv_struct_tm>
13968+
#include <time.h>
1400413969

1400513970
"
1400613971
if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
@@ -14012,47 +13977,6 @@ _ACEOF
1401213977

1401313978
fi
1401413979

14015-
if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
14016-
14017-
$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
14018-
14019-
fi
14020-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
14021-
$as_echo_n "checking for tzname... " >&6; }
14022-
if ${ac_cv_var_tzname+:} false; then :
14023-
$as_echo_n "(cached) " >&6
14024-
else
14025-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14026-
/* end confdefs.h. */
14027-
#include <stdlib.h>
14028-
#include <time.h>
14029-
#ifndef tzname /* For SGI. */
14030-
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
14031-
#endif
14032-
14033-
int
14034-
main ()
14035-
{
14036-
atoi(*tzname);
14037-
;
14038-
return 0;
14039-
}
14040-
_ACEOF
14041-
if ac_fn_c_try_link "$LINENO"; then :
14042-
ac_cv_var_tzname=yes
14043-
else
14044-
ac_cv_var_tzname=no
14045-
fi
14046-
rm -f core conftest.err conftest.$ac_objext \
14047-
conftest$ac_exeext conftest.$ac_ext
14048-
fi
14049-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
14050-
$as_echo "$ac_cv_var_tzname" >&6; }
14051-
if test $ac_cv_var_tzname = yes; then
14052-
14053-
$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
14054-
14055-
fi
1405613980

1405713981
ac_fn_c_check_type "$LINENO" "union semun" "ac_cv_type_union_semun" "#include <sys/types.h>
1405813982
#ifdef HAVE_SYS_IPC_H

‎src/include/pg_config.h.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,16 +654,9 @@
654654
/* Define to 1 if you have the <termios.h> header file. */
655655
#undef HAVE_TERMIOS_H
656656

657-
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
658-
`HAVE_STRUCT_TM_TM_ZONE' instead. */
659-
#undef HAVE_TM_ZONE
660-
661657
/* Define to 1 if your compiler understands `typeof' or something similar. */
662658
#undef HAVE_TYPEOF
663659

664-
/* Define to 1 if you have the external array `tzname'. */
665-
#undef HAVE_TZNAME
666-
667660
/* Define to 1 if you have the <ucred.h> header file. */
668661
#undef HAVE_UCRED_H
669662

@@ -884,9 +877,6 @@
884877
/* Define to 1 if strerror_r() returns int. */
885878
#undef STRERROR_R_INT
886879

887-
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
888-
#undef TM_IN_SYS_TIME
889-
890880
/* Define to 1 to use ARMv8 CRC Extension. */
891881
#undef USE_ARMV8_CRC32C
892882

‎src/include/pg_config.h.win32

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,9 @@
508508
/* Define to 1 if you have the <termios.h> header file. */
509509
/* #undef HAVE_TERMIOS_H */
510510

511-
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
512-
`HAVE_STRUCT_TM_TM_ZONE' instead. */
513-
/* #undef HAVE_TM_ZONE */
514-
515511
/* Define to 1 if your compiler understands `typeof' or something similar. */
516512
/* #undef HAVE_TYPEOF */
517513

518-
/* Define to 1 if you have the external array `tzname'. */
519-
/* #undef HAVE_TZNAME */
520-
521514
/* Define to 1 if the system has the type `uint64'. */
522515
/* #undef HAVE_UINT64 */
523516

@@ -686,9 +679,6 @@
686679
/* Define to 1 if strerror_r() returns int. */
687680
/* #undef STRERROR_R_INT */
688681

689-
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
690-
/* #undef TM_IN_SYS_TIME */
691-
692682
/* Define to 1 to build with assertion checks. (--enable-cassert) */
693683
/* #undef USE_ASSERT_CHECKING */
694684

‎src/pl/plpython/plpython.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
*/
2929
#undef _POSIX_C_SOURCE
3030
#undef _XOPEN_SOURCE
31-
#undef HAVE_TZNAME
3231

3332
/*
3433
* Sometimes python carefully scribbles on our *printf macros.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp