]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add configure checks for tm->tm_gmtoff and tm->tm_zone (FSBUILD-160)
authorMichael Jerris <mike@jerris.com>
Fri, 15 May 2009 18:19:30 +0000 (18:19 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 15 May 2009 18:19:30 +0000 (18:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13362 d0543943-73ff-0310-b7d9-9358b9ac24b2

configure.in
src/switch_time.c

index c71bf2905cdb926731b869fce948d87804fff551..7bc8e48591fb7a595579cccf72caeac564a00758 100644 (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_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_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
        [#ifdef HAVE_SYS_RESOURCE_H
index 10f8be054c09fe424773042a6524865e48ce0fab..8779e2e714e5c3604c470476bdffa1a6d10d3b96 100644 (file)
@@ -586,8 +586,8 @@ static void tm2switchtime(struct tm * tm, switch_time_exp_t *xt )
        xt->tm_wday     = tm->tm_wday;
        xt->tm_yday     = tm->tm_yday;
        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;
 #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_isdst = 0;
-#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun)
+#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
        tmp->tm_gmtoff = offset;
 #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);
                        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];
 #endif
                }