[asterisk-commits] tilghman: branch 1.2 r43409 - in /branches/1.2/cdr: Makefile cdr_tds.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 21 09:18:19 MST 2006


Author: tilghman
Date: Thu Sep 21 11:18:19 2006
New Revision: 43409

URL: http://svn.digium.com/view/asterisk?rev=43409&view=rev
Log:
TDS 0.64 updates

Modified:
    branches/1.2/cdr/Makefile
    branches/1.2/cdr/cdr_tds.c

Modified: branches/1.2/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.2/cdr/Makefile?rev=43409&r1=43408&r2=43409&view=diff
==============================================================================
--- branches/1.2/cdr/Makefile (original)
+++ branches/1.2/cdr/Makefile Thu Sep 21 11:18:19 2006
@@ -46,13 +46,17 @@
 # FreeTDS stuff...
 #
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),)
-  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
+  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.64),1)
+    CFLAGS += -DFREETDS_0_64
+  else
+    ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
     CFLAGS += -DFREETDS_0_63
-  else
-	ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
-      CFLAGS += -DFREETDS_0_62
     else
-      CFLAGS += -DFREETDS_PRE_0_62
+	  ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
+        CFLAGS += -DFREETDS_0_62
+      else
+        CFLAGS += -DFREETDS_PRE_0_62
+      endif
     endif
   endif
   MODS+=cdr_tds.so

Modified: branches/1.2/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/cdr/cdr_tds.c?rev=43409&r1=43408&r2=43409&view=diff
==============================================================================
--- branches/1.2/cdr/cdr_tds.c (original)
+++ branches/1.2/cdr/cdr_tds.c Thu Sep 21 11:18:19 2006
@@ -320,7 +320,7 @@
 
 static int mssql_connect(void)
 {
-#ifdef FREETDS_0_63
+#if (defined(FREETDS_0_63) || defined(FREETDS_0_64))
 	TDSCONNECTION *connection = NULL;
 #else
 	TDSCONNECTINFO *connection = NULL;
@@ -346,7 +346,11 @@
 	tds_set_packet(login, 512);
 	tds_set_version(login, 7, 0);
 
+#ifdef FREETDS_0_64
+	if (!(context = tds_alloc_context(NULL)))
+#else
 	if (!(context = tds_alloc_context()))
+#endif
 	{
 		ast_log(LOG_ERROR, "tds_alloc_context() failed.\n");
 		goto connect_fail;
@@ -369,7 +373,7 @@
 	{
 		ast_log(LOG_ERROR, "Failed to connect to MSSQL server.\n");
 		tds = NULL;	/* freed by tds_connect() on error */
-#ifdef FREETDS_0_63
+#if (defined(FREETDS_0_63) || defined(FREETDS_0_64))
 		tds_free_connection(connection);
 #else
 		tds_free_connect(connection);
@@ -377,7 +381,7 @@
 		connection = NULL;
 		goto connect_fail;
 	}
-#ifdef FREETDS_0_63
+#if (defined(FREETDS_0_63) || defined(FREETDS_0_64))
 	tds_free_connection(connection);
 #else
 	tds_free_connect(connection);



More information about the asterisk-commits mailing list