diff options
Diffstat (limited to 'cpp/src/Freeze/MapDb.cpp')
-rw-r--r-- | cpp/src/Freeze/MapDb.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cpp/src/Freeze/MapDb.cpp b/cpp/src/Freeze/MapDb.cpp index 6ebc66d2174..a63edee9485 100644 --- a/cpp/src/Freeze/MapDb.cpp +++ b/cpp/src/Freeze/MapDb.cpp @@ -31,16 +31,20 @@ const string _catalogIndexListName = "__catalogIndexList"; extern "C" { -static int customCompare(DB* db, const DBT* dbt1, const DBT* dbt2) -{ - MapDb* me = static_cast<MapDb*>(db->app_private); - Ice::Byte* first = static_cast<Ice::Byte*>(dbt1->data); - Key k1(first, first + dbt1->size); - first = static_cast<Ice::Byte*>(dbt2->data); - Key k2(first, first + dbt2->size); - - return me->getKeyCompare()->compare(k1, k2); -} +#if (DB_VERSION_MAJOR <= 5) + static int customCompare(DB* db, const DBT* dbt1, const DBT* dbt2) +#else + static int customCompare(DB* db, const DBT* dbt1, const DBT* dbt2, size_t*) +#endif + { + MapDb* me = static_cast<MapDb*>(db->app_private); + Ice::Byte* first = static_cast<Ice::Byte*>(dbt1->data); + Key k1(first, first + dbt1->size); + first = static_cast<Ice::Byte*>(dbt2->data); + Key k2(first, first + dbt2->size); + + return me->getKeyCompare()->compare(k1, k2); + } } const string& |