[asterisk-commits] tilghman: branch 1.8 r288638 - in /branches/1.8: ./ cdr/ include/asterisk/ main/

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


Author: tilghman
Date: Thu Sep 23 22:39:29 2010
New Revision: 288638

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=288638
Log:
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:
    branches/1.8/   (props changed)
    branches/1.8/cdr/cdr_pgsql.c
    branches/1.8/configure
    branches/1.8/configure.ac
    branches/1.8/include/asterisk/autoconfig.h.in
    branches/1.8/include/asterisk/channel.h
    branches/1.8/include/asterisk/compat.h
    branches/1.8/main/strcompat.c

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

Modified: branches/1.8/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cdr/cdr_pgsql.c?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/cdr/cdr_pgsql.c (original)
+++ branches/1.8/cdr/cdr_pgsql.c Thu Sep 23 22:39:29 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: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Thu Sep 23 22:39:29 2010
@@ -1694,6 +1694,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: branches/1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/autoconfig.h.in?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/include/asterisk/autoconfig.h.in (original)
+++ branches/1.8/include/asterisk/autoconfig.h.in Thu Sep 23 22:39:29 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: branches/1.8/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/channel.h?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/include/asterisk/channel.h (original)
+++ branches/1.8/include/asterisk/channel.h Thu Sep 23 22:39:29 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: branches/1.8/include/asterisk/compat.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/compat.h?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/include/asterisk/compat.h (original)
+++ branches/1.8/include/asterisk/compat.h Thu Sep 23 22:39:29 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: branches/1.8/main/strcompat.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/strcompat.c?view=diff&rev=288638&r1=288637&r2=288638
==============================================================================
--- branches/1.8/main/strcompat.c (original)
+++ branches/1.8/main/strcompat.c Thu Sep 23 22:39:29 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