From 353516802d727ab57811171f09f21f6f9ba6237f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2011 14:12:42 +0200 Subject: Use ODB_DATABASE_XXX macros instead DATABASE_XXX in ODB-compiled headers DATABASE_XXX macros are not defined when building from VC++ project. --- common/query/test.hxx | 4 +--- common/view/test.hxx | 20 +++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'common') diff --git a/common/query/test.hxx b/common/query/test.hxx index d2d28d2..b69be3c 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -14,8 +14,6 @@ #include #include -#include // DATABASE_XXX - typedef std::vector buffer; typedef odb::nullable nullable_buffer; @@ -56,7 +54,7 @@ struct person unsigned short age_; bool married_; -#ifdef DATABASE_PGSQL +#ifdef ODB_DATABASE_PGSQL #pragma db column ("key") type ("BYTEA") null #else #pragma db column ("key") type ("BLOB") null diff --git a/common/view/test.hxx b/common/view/test.hxx index 4492600..5cbd171 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -13,8 +13,6 @@ #include #include -#include // DATABASE_XXX - struct employer; #pragma db object @@ -132,7 +130,7 @@ struct employer // Complete suffix query template. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age FROM t_view_person") #else # pragma db view query("SELECT \"first\", \"last\", \"age\" " \ @@ -147,7 +145,7 @@ struct view1 // Complete query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age " \ "FROM t_view_person " \ "WHERE age < 31 ORDER BY age") @@ -165,7 +163,7 @@ struct view1a // Complete placeholder query template. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age " \ "FROM t_view_person " \ "WHERE age < 31 AND (?) ORDER BY age") @@ -212,7 +210,7 @@ struct view1d // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person) \ query("SELECT count(id) FROM t_view_person") #else @@ -229,7 +227,7 @@ struct view2 #pragma db view object(person) struct view2a { -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE #pragma db column("count(id)") #else #pragma db column("count(\"id\")") @@ -242,7 +240,7 @@ struct view2a #pragma db view object(person) struct view2b { -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE #pragma db column("count(t_view_person.id)") #else #pragma db column("count(\"t_view_person\".\"id\")") @@ -265,7 +263,7 @@ struct view2c // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person = test) \ query("SELECT last, count(last) " \ "FROM t_view_person " \ @@ -302,7 +300,7 @@ struct view3a // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ "FROM t_view_person " \ @@ -394,7 +392,7 @@ struct view6b // The same using tables. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "ee.value = p.id") \ table("t_view_employer" = "e": "ee.object_id = e.name") -- cgit v1.1