[asterisk-commits] tilghman: branch 1.6.2 r288637 - in /branches/1.6.2: ./ cdr/ include/asterisk...

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


Author: tilghman
Date: Thu Sep 23 22:36:01 2010
New Revision: 288637

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

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

Modified: branches/1.6.2/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/cdr/cdr_pgsql.c?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/cdr/cdr_pgsql.c (original)
+++ branches/1.6.2/cdr/cdr_pgsql.c Thu Sep 23 22:36:01 2010
@@ -113,7 +113,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);
@@ -489,7 +493,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.6.2/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/configure.ac?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/configure.ac (original)
+++ branches/1.6.2/configure.ac Thu Sep 23 22:36:01 2010
@@ -1532,6 +1532,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.6.2/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/include/asterisk/autoconfig.h.in?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/include/asterisk/autoconfig.h.in (original)
+++ branches/1.6.2/include/asterisk/autoconfig.h.in Thu Sep 23 22:36:01 2010
@@ -468,6 +468,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.6.2/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/include/asterisk/channel.h?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/include/asterisk/channel.h (original)
+++ branches/1.6.2/include/asterisk/channel.h Thu Sep 23 22:36:01 2010
@@ -1747,19 +1747,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.6.2/include/asterisk/compat.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/include/asterisk/compat.h?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/include/asterisk/compat.h (original)
+++ branches/1.6.2/include/asterisk/compat.h Thu Sep 23 22:36:01 2010
@@ -113,6 +113,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
+
 #ifndef HAVE_STRLCAT
 size_t strlcat(char *dst, const char *src, size_t siz);
 #endif

Modified: branches/1.6.2/main/strcompat.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/strcompat.c?view=diff&rev=288637&r1=288636&r2=288637
==============================================================================
--- branches/1.6.2/main/strcompat.c (original)
+++ branches/1.6.2/main/strcompat.c Thu Sep 23 22:36:01 2010
@@ -162,6 +162,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