Use AC_STRUCT_TIMEZONE

Change-Id: I96c12dce662691d37d6eb6c1893c5e9d91a8ea6f
Reviewed-on: https://code.wireshark.org/review/14753
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
João Valverde 2016-03-25 21:04:13 +00:00 committed by João Valverde
parent fd4808fbec
commit ae9e311480
6 changed files with 4 additions and 44 deletions

View File

@ -139,7 +139,7 @@ endif()
include(CheckStructHasMember)
check_struct_has_member("struct sockaddr" sa_len sys/socket.h HAVE_SA_LEN)
check_struct_has_member("struct stat" st_flags sys/stat.h HAVE_ST_FLAGS)
check_struct_has_member("struct tm" tm_zone time.h HAVE_TM_ZONE)
check_struct_has_member("struct tm" tm_zone time.h HAVE_STRUCT_TM_TM_ZONE)
#Symbols but NOT enums or types
check_symbol_exists(tzname "time.h" HAVE_TZNAME)

View File

@ -97,40 +97,6 @@ AC_DEFUN([AC_WIRESHARK_POP_FLAGS],
LDFLAGS="$ac_ws_LDFLAGS_saved"
])
#
# AC_WIRESHARK_TIMEZONE_ABBREV
#
AC_DEFUN([AC_WIRESHARK_TIMEZONE_ABBREV],
[
AC_CACHE_CHECK([for tm_zone in struct tm],
ac_cv_wireshark_have_tm_zone,
[
AC_TRY_COMPILE(
[#include <time.h>],
[struct tm t; t.tm_zone;],
ac_cv_wireshark_have_tm_zone=yes,
ac_cv_wireshark_have_tm_zone=no)
])
if test $ac_cv_wireshark_have_tm_zone = yes; then
AC_DEFINE(HAVE_TM_ZONE, 1, [Define if tm_zone field exists in struct tm])
else
AC_CACHE_CHECK([for tzname],
ac_cv_wireshark_have_tzname,
[
AC_TRY_LINK(
[#include <time.h>
#include <stdio.h>],
[printf("%s", tzname[0]);],
ac_cv_wireshark_have_tzname=yes,
ac_cv_wireshark_have_tzname=no)
])
if test $ac_cv_wireshark_have_tzname = yes; then
AC_DEFINE(HAVE_TZNAME, 1, [Define if tzname array exists])
fi
fi
])
#
# AC_WIRESHARK_STRUCT_ST_FLAGS

View File

@ -352,7 +352,7 @@
#cmakedefine HAVE_SYS_WAIT_H 1
/* Define if tm_zone field exists in struct tm */
#cmakedefine HAVE_TM_ZONE 1
#cmakedefine HAVE_STRUCT_TM_TM_ZONE 1
/* Define if tzname array exists */
#cmakedefine HAVE_TZNAME 1

View File

@ -146,12 +146,6 @@
/* Define if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if tm_zone field exists in struct tm */
/* #undef HAVE_TM_ZONE 1 */
/* Define if tzname array exists */
/* #undef HAVE_TZNAME */
/* Define if you have the <unistd.h> header file. */
/* #define HAVE_UNISTD_H 1 */

View File

@ -2729,7 +2729,7 @@ dnl Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST
# Check how we can get the time zone abbreviation
AC_WIRESHARK_TIMEZONE_ABBREV
AC_STRUCT_TIMEZONE
# We need to know whether "struct stat" has an "st_flags" member
# for file_user_immutable().

View File

@ -546,7 +546,7 @@ static const char mon_names[12][4] = {
static const gchar *
get_zonename(struct tm *tmp)
{
#if defined(HAVE_TM_ZONE)
#if defined(HAVE_STRUCT_TM_TM_ZONE)
return tmp->tm_zone;
#else
if ((tmp->tm_isdst != 0) && (tmp->tm_isdst != 1)) {