diff options
author | Bernard Normier <bernard@zeroc.com> | 2015-02-27 16:56:42 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2015-02-27 16:56:42 +0000 |
commit | 97e50ee5ae43e6e067eba7943453d7e61963ebe9 (patch) | |
tree | 324242c4fa8ac52510a4324b93fdf73b0fce16ce /cpp/src/Freeze/MapDb.cpp | |
parent | ICE-5967 add cancelation to Ice.Trace.Retry tracing (diff) | |
download | ice-97e50ee5ae43e6e067eba7943453d7e61963ebe9.tar.bz2 ice-97e50ee5ae43e6e067eba7943453d7e61963ebe9.tar.xz ice-97e50ee5ae43e6e067eba7943453d7e61963ebe9.zip |
ICE-6337: small fix to C++ source code to allow building with DB 6.x
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& |