[Freeswitch-svn] [commit] r13362 - in freeswitch/trunk: . src

FreeSWITCH SVN mikej at freeswitch.org
Fri May 15 11:19:30 PDT 2009


Author: mikej
Date: Fri May 15 13:19:30 2009
New Revision: 13362

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

Modified:
   freeswitch/trunk/configure.in
   freeswitch/trunk/src/switch_time.c

Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in	(original)
+++ freeswitch/trunk/configure.in	Fri May 15 13:19:30 2009
@@ -337,6 +337,14 @@
 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

Modified: freeswitch/trunk/src/switch_time.c
==============================================================================
--- freeswitch/trunk/src/switch_time.c	(original)
+++ freeswitch/trunk/src/switch_time.c	Fri May 15 13:19:30 2009
@@ -586,8 +586,8 @@
 	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 @@
 
 	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 @@
 		{
 	    		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
 		}



More information about the Freeswitch-svn mailing list