From f44d493a4b9769b105024e2a06e0cc7ba2fe83b6 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 29 Jan 2015 16:02:19 -0500 Subject: [svn-r26076] Removed gettimeofday() time zone struct functionality. Part of HDFFV-9085 Tested on: jam --- config/cmake/H5pubconf.h.in | 6 - configure | 284 -------------------------------------------- configure.ac | 44 ------- src/H5Omtime.c | 10 -- src/H5config.h.in | 24 ---- vms/src/h5pubconf.h | 6 - 6 files changed, 374 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 0455724..44cca9d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -86,9 +86,6 @@ long long values. */ #cmakedefine H5_FP_TO_ULLONG_RIGHT_MAXIMUM @H5_FP_TO_ULLONG_RIGHT_MAXIMUM@ -/* Define if gettimeofday() populates the tz pointer passed in */ -#cmakedefine H5_GETTIMEOFDAY_GIVES_TZ @H5_GETTIMEOFDAY_GIVES_TZ@ - /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ @@ -359,9 +356,6 @@ /* Define if `struct text_info' is defined */ #cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@ -/* Define if `struct timezone' is defined */ -#cmakedefine H5_HAVE_STRUCT_TIMEZONE @H5_HAVE_STRUCT_TIMEZONE@ - /* Define to 1 if `tm_zone' is a member of `struct tm'. */ #cmakedefine H5_HAVE_STRUCT_TM_TM_ZONE @H5_HAVE_STRUCT_TM_TM_ZONE@ diff --git a/configure b/configure index fec11c5..8b46307 100755 --- a/configure +++ b/configure @@ -2673,79 +2673,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -26524,217 +26451,6 @@ rm -f core conftest.err conftest.$ac_objext \ ;; esac -## Check whether `struct timezone' is defined. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include -#include <$ac_cv_struct_tm> - -" -if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TM_TM_ZONE 1 -_ACEOF - - -fi - -if test "$ac_cv_member_struct_tm_tm_zone" = yes; then - -$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h - -else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include -" -if test "x$ac_cv_have_decl_tzname" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME $ac_have_decl -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } -if ${ac_cv_var_tzname+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if !HAVE_DECL_TZNAME -extern char *tzname[]; -#endif - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return tzname[0][0]; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_var_tzname=yes -else - ac_cv_var_tzname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } - if test $ac_cv_var_tzname = yes; then - -$as_echo "#define HAVE_TZNAME 1" >>confdefs.h - - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone" >&5 -$as_echo_n "checking for struct timezone... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - #include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -struct timezone tz; tz.tz_minuteswest=0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h - - have_struct_tz="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -## If gettimeofday() is going to be used, make sure it uses the timezone struct - -if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday() gives timezone" >&5 -$as_echo_n "checking whether gettimeofday() gives timezone... " >&6; } - if ${hdf5_cv_gettimeofday_tz+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - int main(void) - { - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ - tz.tz_dsttime = 7; - gettimeofday(&tv, &tz); - /* Check whether the function returned any value at all */ - if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - hdf5_cv_gettimeofday_tz=yes -else - hdf5_cv_gettimeofday_tz=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - - if test ${hdf5_cv_gettimeofday_tz} = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define GETTIMEOFDAY_GIVES_TZ 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -fi ## ---------------------------------------------------------------------- ## Does the struct stat have the st_blocks field? This field is not Posix. diff --git a/configure.ac b/configure.ac index 10a6bb6..33e4565 100644 --- a/configure.ac +++ b/configure.ac @@ -1819,50 +1819,6 @@ case "`uname`" in ;; esac -## Check whether `struct timezone' is defined. -AC_STRUCT_TIMEZONE -AC_MSG_CHECKING([for struct timezone]) -AC_TRY_COMPILE([ - #include - #include - #include ], [struct timezone tz; tz.tz_minuteswest=0;], - [AC_DEFINE([HAVE_STRUCT_TIMEZONE], [1], - [Define if `struct timezone' is defined]) - have_struct_tz="yes" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -## If gettimeofday() is going to be used, make sure it uses the timezone struct - -if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then - AC_MSG_CHECKING(whether gettimeofday() gives timezone) - AC_CACHE_VAL([hdf5_cv_gettimeofday_tz], - [AC_TRY_RUN([ - #include - #include - int main(void) - { - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ - tz.tz_dsttime = 7; - gettimeofday(&tv, &tz); - /* Check whether the function returned any value at all */ - if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); - }], - [hdf5_cv_gettimeofday_tz=yes], - [hdf5_cv_gettimeofday_tz=no])]) - - if test ${hdf5_cv_gettimeofday_tz} = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([GETTIMEOFDAY_GIVES_TZ], [1], - [Define if gettimeofday() populates the tz pointer passed in]) - else - AC_MSG_RESULT([no]) - fi -fi ## ---------------------------------------------------------------------- ## Does the struct stat have the st_blocks field? This field is not Posix. diff --git a/src/H5Omtime.c b/src/H5Omtime.c index cdaad8a..a983ca4 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -230,16 +230,6 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, #elif defined(H5_HAVE_TIMEZONE) /* Linux libc-5 */ the_time -= timezone - (tm.tm_isdst?3600:0); -#elif defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) && defined(H5_GETTIMEOFDAY_GIVES_TZ) - { - struct timezone tz; - struct timeval tv; /* Used as a placebo; some systems don't like NULL */ - - if(HDgettimeofday(&tv, &tz) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") - - the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); - } #else /* * The catch-all. If we can't convert a character string universal diff --git a/src/H5config.h.in b/src/H5config.h.in index 29656b4..74a3671 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -49,9 +49,6 @@ long long values. */ #undef FP_TO_ULLONG_RIGHT_MAXIMUM -/* Define if gettimeofday() populates the tz pointer passed in */ -#undef GETTIMEOFDAY_GIVES_TZ - /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM @@ -80,10 +77,6 @@ /* Define if Darwin or Mac OS X */ #undef HAVE_DARWIN -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. - */ -#undef HAVE_DECL_TZNAME - /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME @@ -301,12 +294,6 @@ /* Define if `struct text_info' is defined */ #undef HAVE_STRUCT_TEXT_INFO -/* Define if `struct timezone' is defined */ -#undef HAVE_STRUCT_TIMEZONE - -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ -#undef HAVE_STRUCT_TM_TM_ZONE - /* Define if `struct videoconfig' is defined */ #undef HAVE_STRUCT_VIDEOCONFIG @@ -367,14 +354,6 @@ /* Define if `tm_gmtoff' is a member of `struct tm' */ #undef HAVE_TM_GMTOFF -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#undef HAVE_TM_ZONE - -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ -#undef HAVE_TZNAME - /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -612,9 +591,6 @@ /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - /* Define if your system can compile unsigned long long to floating-point casts. */ #undef ULLONG_TO_FP_CAST_WORKS diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 634ee66..9cf0a53 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -61,9 +61,6 @@ long long values. */ #define H5_FP_TO_ULLONG_RIGHT_MAXIMUM 1 -/* Define if gettimeofday() populates the tz pointer passed in */ -/* #undef H5_GETTIMEOFDAY_GIVES_TZ */ - /* Define to 1 if you have the `alarm' function. */ #define H5_HAVE_ALARM 1 @@ -307,9 +304,6 @@ /* Define if `struct text_info' is defined */ /* #undef H5_HAVE_STRUCT_TEXT_INFO */ -/* Define if `struct timezone' is defined */ -/* #undef H5_HAVE_STRUCT_TIMEZONE */ - /* Define to 1 if `tm_zone' is member of `struct tm'. */ #define H5_HAVE_STRUCT_TM_TM_ZONE 1 -- cgit v0.12