From: Kaj-Michael Lang Date: Tue, 18 Mar 2008 18:57:16 +0000 (+0200) Subject: Move DB_PREP macro X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cebab5b9fb3a05b4bdc6fa12f6ffaba01ccb9243;p=mapper Move DB_PREP macro --- diff --git a/src/db.h b/src/db.h index 99607af..a6e3f2c 100644 --- a/src/db.h +++ b/src/db.h @@ -24,6 +24,13 @@ #ifndef _MAPPER_DB_H #define _MAPPER_DB_H +#define DB_PREP(db_,sql_,stmt_) \ + if (sqlite3_prepare_v2(db_, sql_, -1, &stmt_, NULL)!=SQLITE_OK) { \ + g_printerr("Failed to prepare: [%s] Error: %s", \ + sql_, sqlite3_errmsg(db_)); \ + return FALSE; \ + } + sqlite3 *_db; gchar *_mapper_db; diff --git a/src/osm-db.c b/src/osm-db.c index 5f21868..bd9b7b6 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -210,13 +210,6 @@ if (w!=NULL) { /*****************************************************************************/ -#define DB_PREP(db_,sql_,stmt_) \ - if (sqlite3_prepare_v2(db_, sql_, -1, &stmt_, NULL)!=SQLITE_OK) { \ - g_printerr("Failed to prepare: [%s] Error: %s", \ - sql_, sqlite3_errmsg(db_)); \ - return FALSE; \ - } - gboolean osm_db_prepare(sqlite3 *db) {