From ae9e3114802d8a758a335df664ddff13f4037e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Fri, 25 Mar 2016 21:04:13 +0000 Subject: [PATCH] Use AC_STRUCT_TIMEZONE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I96c12dce662691d37d6eb6c1893c5e9d91a8ea6f Reviewed-on: https://code.wireshark.org/review/14753 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- ConfigureChecks.cmake | 2 +- acinclude.m4 | 34 ---------------------------------- cmakeconfig.h.in | 2 +- config.h.win32 | 6 ------ configure.ac | 2 +- epan/to_str.c | 2 +- 6 files changed, 4 insertions(+), 44 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0cf1ae0131..600a04c36f 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -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) diff --git a/acinclude.m4 b/acinclude.m4 index 1ed5f5619a..f62610e3bb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 ], - [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 -#include ], - [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 diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 52e34567d2..7e28e0bb69 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -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 diff --git a/config.h.win32 b/config.h.win32 index 9301ad308d..c308625402 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -146,12 +146,6 @@ /* Define if you have the 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 header file. */ /* #define HAVE_UNISTD_H 1 */ diff --git a/configure.ac b/configure.ac index 476af83673..2a37fad148 100644 --- a/configure.ac +++ b/configure.ac @@ -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(). diff --git a/epan/to_str.c b/epan/to_str.c index 5380c17d6a..e7d3eecc41 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -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)) {