Skip to content

Commit a954ab6

Browse files
committed
* configure.in: Use AC_CHECK_MEMBER for struct tm.tm_gmtoff test.
1 parent ae8455c commit a954ab6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

configure.in

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,10 @@ case ${host}X${ac_cv_func_gettid}X${ap_cv_gettid} in
567567
esac
568568

569569
dnl ## Check for the tm_gmtoff field in struct tm to get the timezone diffs
570-
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
571-
[AC_TRY_COMPILE([#include <sys/types.h>
572-
#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
573-
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
574-
if test "$ac_cv_struct_tm_gmtoff" = "yes"; then
575-
AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field])
576-
fi
570+
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
571+
[AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field])], [],
572+
[#include <sys/types.h>
573+
#include <time.h>])
577574

578575
AC_CHECK_DECL(CMSG_DATA,,, [#include <sys/types.h>
579576
#include <sys/socket.h>])

0 commit comments

Comments
 (0)