add configure checks for tm->tm_gmtoff and tm->tm_zone (FSBUILD-160)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13362 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-05-15 18:19:30 +00:00
parent e2760c6fbe
commit 21159328e7
2 changed files with 11 additions and 3 deletions

View File

@ -337,6 +337,14 @@ AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you
AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])]) AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[
#include <sys/types.h>
#include <time.h>])
AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.__tm_zone],,,[
#include <sys/types.h>
#include <time.h>])
AC_CHECK_DECL([RLIMIT_MEMLOCK], AC_CHECK_DECL([RLIMIT_MEMLOCK],
[AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],, [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
[#ifdef HAVE_SYS_RESOURCE_H [#ifdef HAVE_SYS_RESOURCE_H

View File

@ -586,8 +586,8 @@ static void tm2switchtime(struct tm * tm, switch_time_exp_t *xt )
xt->tm_wday = tm->tm_wday; xt->tm_wday = tm->tm_wday;
xt->tm_yday = tm->tm_yday; xt->tm_yday = tm->tm_yday;
xt->tm_isdst = tm->tm_isdst; xt->tm_isdst = tm->tm_isdst;
#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun)
#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
xt->tm_gmtoff = tm->tm_gmtoff; xt->tm_gmtoff = tm->tm_gmtoff;
#endif #endif
@ -1635,7 +1635,7 @@ static void timesub(const time_t * const timep, const long offset, register cons
tmp->tm_mday = (int) (days + 1); tmp->tm_mday = (int) (days + 1);
tmp->tm_isdst = 0; tmp->tm_isdst = 0;
#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun) #if defined(HAVE_STRUCT_TM_TM_GMTOFF)
tmp->tm_gmtoff = offset; tmp->tm_gmtoff = offset;
#endif #endif
} }
@ -1691,7 +1691,7 @@ static void tztime(const time_t * const timep, const char *tzstring, struct tm *
{ {
timesub( &t, ttisp->tt_gmtoff, sp, tmp); timesub( &t, ttisp->tt_gmtoff, sp, tmp);
tmp->tm_isdst = ttisp->tt_isdst; tmp->tm_isdst = ttisp->tt_isdst;
#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun) #if defined(HAVE_STRUCT_TM_TM_ZONE)
tmp->tm_zone = &sp->chars[ttisp->tt_abbrind]; tmp->tm_zone = &sp->chars[ttisp->tt_abbrind];
#endif #endif
} }