[asterisk-commits] tilghman: trunk r288639 - in /trunk: ./ cdr/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 23 22:41:06 CDT 2010


Author: tilghman
Date: Thu Sep 23 22:41:02 2010
New Revision: 288639

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=288639
Log:
Merged revisions 288638 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288638 | tilghman | 2010-09-23 22:39:29 -0500 (Thu, 23 Sep 2010) | 16 lines
  
  Merged revisions 288637 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288637 | tilghman | 2010-09-23 22:36:01 -0500 (Thu, 23 Sep 2010) | 9 lines
    
    Merged revisions 288636 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288636 | tilghman | 2010-09-23 22:20:24 -0500 (Thu, 23 Sep 2010) | 2 lines
      
      Solaris compatibility fixes
    ........
  ................
................

Modified:
    trunk/   (props changed)
    trunk/cdr/cdr_pgsql.c
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/include/asterisk/channel.h
    trunk/include/asterisk/compat.h
    trunk/main/strcompat.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cdr/cdr_pgsql.c?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/cdr/cdr_pgsql.c (original)
+++ trunk/cdr/cdr_pgsql.c Thu Sep 23 22:41:02 2010
@@ -111,7 +111,11 @@
 		if (PQstatus(conn) != CONNECTION_BAD) {
 			connected = 1;
 			if (PQsetClientEncoding(conn, encoding)) {
+#ifdef HAVE_PGSQL_pg_encoding_to_char
 				ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default '%s'\n", encoding, pg_encoding_to_char(PQclientEncoding(conn)));
+#else
+				ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default.\n", encoding);
+#endif
 			}
 		} else {
 			pgerror = PQerrorMessage(conn);
@@ -486,7 +490,11 @@
 		ast_debug(1, "Successfully connected to PostgreSQL database.\n");
 		connected = 1;
 		if (PQsetClientEncoding(conn, encoding)) {
+#ifdef HAVE_PGSQL_pg_encoding_to_char
 			ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default '%s'\n", encoding, pg_encoding_to_char(PQclientEncoding(conn)));
+#else
+			ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default.\n", encoding);
+#endif
 		}
 		version = PQserverVersion(conn);
 

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Sep 23 22:41:02 2010
@@ -1697,6 +1697,19 @@
       AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
       [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
 
+      AC_MSG_CHECKING(for pg_encoding_to_char within Postgres headers)
+      old_CFLAGS=${CFLAGS}
+      CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror"
+      old_LDFLAGS=${LDFLAGS}
+      LDFLAGS="${LDFLAGS} -L${PGSQL_libdir} -lpq -lz"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>],
+          [const char *foo = pg_encoding_to_char(1)])],
+        [AC_MSG_RESULT(yes)
+         AC_DEFINE_UNQUOTED([HAVE_PGSQL_pg_encoding_to_char], 1, [Define to indicate presence of the pg_encoding_to_char API.])],
+        [AC_MSG_RESULT(no)])
+      CFLAGS=${old_CFLAGS}
+      LDFLAGS=${old_LDFLAGS}
+
       if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
          PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
          PGSQL_INCLUDE="-I${PGSQL_includedir}"

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Thu Sep 23 22:41:02 2010
@@ -523,6 +523,9 @@
 
 /* Define to indicate the PostgreSQL library */
 #undef HAVE_PGSQL
+
+/* Define to indicate presence of the pg_encoding_to_char API. */
+#undef HAVE_PGSQL_pg_encoding_to_char
 
 /* Define to 1 if your system defines IP_PKTINFO. */
 #undef HAVE_PKTINFO

Modified: trunk/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/channel.h?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/include/asterisk/channel.h (original)
+++ trunk/include/asterisk/channel.h Thu Sep 23 22:41:02 2010
@@ -2242,19 +2242,6 @@
 	return 0;
 }
 
-#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;
-	tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
-	if (tvdiff->tv_usec < 0) {
-		tvdiff->tv_sec --;
-		tvdiff->tv_usec += 1000000;
-	}
-
-}
-#endif
-
 /*! \brief Retrieves the current T38 state of a channel */
 static inline enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *chan)
 {

Modified: trunk/include/asterisk/compat.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/compat.h?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/include/asterisk/compat.h (original)
+++ trunk/include/asterisk/compat.h Thu Sep 23 22:41:02 2010
@@ -133,6 +133,10 @@
 int __attribute__((format(printf, 2, 0))) vasprintf(char **strp, const char *fmt, va_list ap);
 #endif
 
+#ifndef HAVE_TIMERSUB
+void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff);
+#endif
+
 #define	strlcat	__use__ast_str__functions_not__strlcat__
 #define	strlcpy	__use__ast_copy_string__not__strlcpy__
 

Modified: trunk/main/strcompat.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/strcompat.c?view=diff&rev=288639&r1=288638&r2=288639
==============================================================================
--- trunk/main/strcompat.c (original)
+++ trunk/main/strcompat.c Thu Sep 23 22:41:02 2010
@@ -168,6 +168,19 @@
 	return size;
 }
 #endif /* !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC) */
+
+#ifndef HAVE_TIMERSUB
+void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
+{
+	tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
+	tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
+	if (tvdiff->tv_usec < 0) {
+		tvdiff->tv_sec --;
+		tvdiff->tv_usec += 1000000;
+	}
+
+}
+#endif
 
 /*
  * Based on Code from bsd-asprintf from OpenSSH




More information about the asterisk-commits mailing list