From 151e92a20374d9259d8a0686916293749740ed88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:43:20 +0200 Subject: Rewrite size() function to not rely in DATABSE_* macros in header Those are not defined for some tests (e.g., database-specific tests built with VC++ project). --- libcommon/common/common.hxx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'libcommon/common/common.hxx') diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 2cf2357..da3737a 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -12,7 +12,6 @@ #include // odb::database #include -#include #include // Make sure assert() is not disabled. @@ -32,18 +31,8 @@ create_database (int& argc, // template std::size_t -size (odb::result& r) -{ - std::size_t n (0); -#if defined(DATABASE_SQLITE) || \ - defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) - for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) - n++; -#else - n = r.size (); -#endif - return n; -} +size (odb::result&); + +#include #endif // LIBCOMMON_COMMON_COMMON_HXX -- cgit v1.1