Browse code

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 authored on 12/10/2009 14:43:33
Showing 2 changed files
... ...
@@ -108,9 +108,10 @@ struct pg_con* db_postgres_new_connection(struct db_id* id)
108 108
 void db_postgres_free_connection(struct pool_con* con)
109 109
 {
110 110
 
111
+	struct pg_con * _c;
112
+	
111 113
 	if (!con) return;
112 114
 
113
-	struct pg_con * _c;
114 115
 	_c = (struct pg_con*)con;
115 116
 
116 117
 	if (_c->res) {
... ...
@@ -277,14 +277,13 @@ int pg_con_connect(db_con_t* con)
277 277
 	/* Override default notice processor */
278 278
 	PQsetNoticeProcessor(pcon->con, notice_processor, 0);
279 279
 	
280
-	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
281
-	    PQprotocolVersion(pcon->con),
282 280
 #ifdef HAVE_PGSERVERVERSION
283
-	    PQserverVersion(pcon->con)
281
+	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
282
+	    PQprotocolVersion(pcon->con), PQserverVersion(pcon->con));
284 283
 #else
285
-	    0
284
+	DBG("postgres: Connected. Protocol version=%d, Server version=%d\n", 
285
+	    PQprotocolVersion(pcon->con), 0 );
286 286
 #endif
287
-	    );
288 287
 
289 288
 	ret = timestamp_format(pcon->con);
290 289
 	if (ret == 1 || ret == -1) {