[sr-dev] git:sr_3.0: db_postgres: compile fixes for gcc 2.95

Andrei Pelinescu-Onciul andrei at iptel.org
Mon Oct 12 18:32:50 CEST 2009


Module: sip-router
Branch: sr_3.0
Commit: 204503d4aa5b839b596946c4edae428babfa9d41
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=204503d4aa5b839b596946c4edae428babfa9d41

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Mon Oct 12 16:43:33 2009 +0200

db_postgres: compile fixes for gcc 2.95

- variables must be declared at the beginning of a block
- #ifdefs not allowed in macro arguments

---

 modules/db_postgres/km_pg_con.c |    3 ++-
 modules/db_postgres/pg_con.c    |    9 ++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/db_postgres/km_pg_con.c b/modules/db_postgres/km_pg_con.c
index aa1d510..98dbb43 100644
--- a/modules/db_postgres/km_pg_con.c
+++ b/modules/db_postgres/km_pg_con.c
@@ -108,9 +108,10 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
 void db_postgres_free_connection(struct pool_con* con)
 {
 
+	struct pg_con * _c;
+	
 	if (!con) return;
 
-	struct pg_con * _c;
 	_c = (struct pg_con*)con;
 
 	if (_c->res) {
diff --git a/modules/db_postgres/pg_con.c b/modules/db_postgres/pg_con.c
index b846b18..32b9be7 100644
--- a/modules/db_postgres/pg_con.c
+++ b/modules/db_postgres/pg_con.c
@@ -277,14 +277,13 @@ int pg_con_connect(db_con_t* con)
 	/* Override default notice processor */
 	PQsetNoticeProcessor(pcon->con, notice_processor, 0);
 	
-	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
-	    PQprotocolVersion(pcon->con),
 #ifdef HAVE_PGSERVERVERSION
-	    PQserverVersion(pcon->con)
+	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
+	    PQprotocolVersion(pcon->con), PQserverVersion(pcon->con));
 #else
-	    0
+	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
+	    PQprotocolVersion(pcon->con), 0 );
 #endif
-	    );
 
 	ret = timestamp_format(pcon->con);
 	if (ret == 1 || ret == -1) {




More information about the sr-dev mailing list