aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-25 21:04:13 +0000
committerJoão Valverde <j@v6e.pt>2016-04-02 22:18:46 +0000
commitae9e3114802d8a758a335df664ddff13f4037e61 (patch)
tree96600338c511b1bc2f29f40dc55a49ff7fb13ecb
parentfd4808fbec986bcc24247b9acfba83db95dba2c6 (diff)
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>
-rw-r--r--ConfigureChecks.cmake2
-rw-r--r--acinclude.m434
-rw-r--r--cmakeconfig.h.in2
-rw-r--r--config.h.win326
-rw-r--r--configure.ac2
-rw-r--r--epan/to_str.c2
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 <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
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 <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 */
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)) {