[asterisk-commits] file: branch 1.4 r164343 - in /branches/1.4: ./ include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 15 11:43:59 CST 2008
Author: file
Date: Mon Dec 15 11:43:59 2008
New Revision: 164343
URL: http://svn.digium.com/view/asterisk?view=rev&rev=164343
Log:
Use autoconf logic to determine whether the system has timersub or not. Do not blindly assume Solaris does not.
(closes issue #13838)
Reported by: ano
Modified:
branches/1.4/configure
branches/1.4/configure.ac
branches/1.4/include/asterisk/autoconfig.h.in
branches/1.4/include/asterisk/channel.h
Modified: branches/1.4/configure.ac
URL: http://svn.digium.com/view/asterisk/branches/1.4/configure.ac?view=diff&rev=164343&r1=164342&r2=164343
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Mon Dec 15 11:43:59 2008
@@ -266,6 +266,15 @@
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm])
+
+AC_MSG_CHECKING(for timersub in time.h)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <sys/time.h>],
+ [struct timeval *zombies; timersub(zombies, zombies, zombies);]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system has timersub in time.h]),
+ AC_MSG_RESULT(no)
+)
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=164343&r1=164342&r2=164343
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Mon Dec 15 11:43:59 2008
@@ -497,6 +497,9 @@
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
+
+/* Define to 1 if your system has timersub in time.h */
+#undef HAVE_TIMERSUB
/* Define to indicate the ${TINFO_DESCRIP} library */
#undef HAVE_TINFO
Modified: branches/1.4/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/channel.h?view=diff&rev=164343&r1=164342&r2=164343
==============================================================================
--- branches/1.4/include/asterisk/channel.h (original)
+++ branches/1.4/include/asterisk/channel.h Mon Dec 15 11:43:59 2008
@@ -1315,7 +1315,7 @@
return 0;
}
-#ifdef SOLARIS
+#ifndef HAVE_TIMERSUB
static inline void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
{
tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
More information about the asterisk-commits
mailing list