mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
deep_search: fix compilation with old Xapian versions
This commit is contained in:
parent
0b58740174
commit
62810d32e1
@ -26,6 +26,14 @@
|
|||||||
#include "util/rsthreads.h"
|
#include "util/rsthreads.h"
|
||||||
#include "util/rsdebuglevel0.h"
|
#include "util/rsdebuglevel0.h"
|
||||||
|
|
||||||
|
#ifndef XAPIAN_AT_LEAST
|
||||||
|
/// Added in Xapian 1.4.2.
|
||||||
|
#define XAPIAN_AT_LEAST(A,B,C) \
|
||||||
|
(XAPIAN_MAJOR_VERSION > (A) || \
|
||||||
|
(XAPIAN_MAJOR_VERSION == (A) && \
|
||||||
|
(XAPIAN_MINOR_VERSION > (B) || \
|
||||||
|
(XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DeepSearch
|
namespace DeepSearch
|
||||||
{
|
{
|
||||||
@ -34,8 +42,17 @@ std::unique_ptr<Xapian::Database> openReadOnlyDatabase(
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#if XAPIAN_AT_LEAST(1,3,2)
|
||||||
std::unique_ptr<Xapian::Database> dbPtr(
|
std::unique_ptr<Xapian::Database> dbPtr(
|
||||||
new Xapian::Database(path, flags) );
|
new Xapian::Database(path, flags) );
|
||||||
|
#else
|
||||||
|
std::unique_ptr<Xapian::Database> dbPtr(new Xapian::Database(path));
|
||||||
|
if(flags)
|
||||||
|
{
|
||||||
|
RS_WARN( "Xapian DB flags: ", flags, " ignored due to old Xapian "
|
||||||
|
"library version: ", XAPIAN_VERSION, " < 1.3.2" );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return dbPtr;
|
return dbPtr;
|
||||||
}
|
}
|
||||||
catch(Xapian::DatabaseOpeningError& e)
|
catch(Xapian::DatabaseOpeningError& e)
|
||||||
|
Loading…
Reference in New Issue
Block a user