From 05246ced03a7ad7302780f8052d8a01f33d46ec1 Mon Sep 17 00:00:00 2001 From: SATOH Fumiyasu Date: Mon, 23 Jun 2008 00:57:58 +0900 Subject: [PATCH] Portability: Check for struct tm.tm_gmtoff by AC_CHECK_MEMBERS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcela Mašláňová --- configure.ac | 4 +--- src/funcs.h | 2 +- src/macros.h | 2 +- src/misc.c | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index efb83e3..5db7d35 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,7 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_TM - +AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) dnl Checking for programs @@ -204,8 +204,6 @@ AC_DEFINE(SYSLOG,1,[Using syslog for log messages.]) AC_DEFINE(CAPITALIZE_FOR_PS, 1, [if you have a tm_gmtoff member in struct tm]) -AC_DEFINE(HAVE_TM_GMTOFF, 1, [if your OS supports a BSD-style login.conf fil]) - ##AC_DEFINE(LOGIN_CAP, 1, [if your OS supports BSD authentication]) ##AC_DEFINE(CRON_GROUP,"crontab",[crontab]) diff --git a/src/funcs.h b/src/funcs.h index 8ed2ba4..85a6dc0 100644 --- a/src/funcs.h +++ b/src/funcs.h @@ -80,7 +80,7 @@ FILE *cron_popen(char *, const char *, struct passwd *); struct passwd *pw_dup(const struct passwd *); -#ifndef HAVE_TM_GMTOFF +#ifndef HAVE_STRUCT_TM_TM_GMTOFF long get_gmtoff(time_t *, struct tm *); #endif diff --git a/src/macros.h b/src/macros.h index 0c5eb7f..fd4d9fa 100644 --- a/src/macros.h +++ b/src/macros.h @@ -91,7 +91,7 @@ LineNumber = ln; \ } -#ifdef HAVE_TM_GMTOFF +#ifdef HAVE_STRUCT_TM_TM_GMTOFF #define get_gmtoff(c, t) ((t)->tm_gmtoff) #endif diff --git a/src/misc.c b/src/misc.c index 0706cb2..2099c58 100644 --- a/src/misc.c +++ b/src/misc.c @@ -757,7 +757,7 @@ strlens(const char *last, ...) { * clobbers the static storage space used by localtime() and gmtime(). * If the local pointer is non-NULL it *must* point to a local copy. */ -#ifndef HAVE_TM_GMTOFF +#ifndef HAVE_STRUCT_TM_TM_GMTOFF long get_gmtoff(time_t *clock, struct tm *local) { struct tm gmt; @@ -783,4 +783,4 @@ long get_gmtoff(time_t *clock, struct tm *local) return (offset); } -#endif /* HAVE_TM_GMTOFF */ +#endif /* HAVE_STRUCT_TM_TM_GMTOFF */ -- 2.40.0