浏览代码

db_postgres: compile fixes for gcc 2.95

- variables must be declared at the beginning of a block
- #ifdefs not allowed in macro arguments
Andrei Pelinescu-Onciul 16 年之前
父节点
当前提交
204503d4aa
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 2 1
      modules/db_postgres/km_pg_con.c
  2. 4 5
      modules/db_postgres/pg_con.c

+ 2 - 1
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) {

+ 4 - 5
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) {