make OP_WILDCARD non-conditional
Since we require Xapian 1.4 anyway, there's no need to make OP_WILDCARD conditional.
This commit is contained in:
@ -174,7 +174,7 @@ PKG_CHECK_MODULES(XAPIAN,xapian-core >= 1.4,[
|
|||||||
|
|
||||||
AS_CASE([$xapian_version],
|
AS_CASE([$xapian_version],
|
||||||
[1.[[4-9]].[[0-9]]*],
|
[1.[[4-9]].[[0-9]]*],
|
||||||
[AC_DEFINE([XAPIAN_HAVE_OP_WILDCARD],[1],[Xapian::Query::OP_WILDCARD?])],
|
[AC_MSG_NOTICE([xapian $xapian_version found.])],
|
||||||
[AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])])
|
[AC_MSG_ERROR([*** xapian version >= 1.4 needed, but version $xapian_version found.])])
|
||||||
|
|
||||||
XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)"
|
XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)"
|
||||||
|
|||||||
@ -56,16 +56,12 @@ xapian_query_op (const Mu::Tree& tree)
|
|||||||
static Xapian::Query
|
static Xapian::Query
|
||||||
make_query (const Value* val, const std::string& str, bool maybe_wildcard)
|
make_query (const Value* val, const std::string& str, bool maybe_wildcard)
|
||||||
{
|
{
|
||||||
#ifndef XAPIAN_HAVE_OP_WILDCARD
|
|
||||||
return Xapian::Query(val->prefix + str);
|
|
||||||
#else
|
|
||||||
const auto vlen{str.length()};
|
const auto vlen{str.length()};
|
||||||
if (!maybe_wildcard || vlen <= 1 || str[vlen - 1] != '*')
|
if (!maybe_wildcard || vlen <= 1 || str[vlen - 1] != '*')
|
||||||
return Xapian::Query(val->prefix + str);
|
return Xapian::Query(val->prefix + str);
|
||||||
else
|
else
|
||||||
return Xapian::Query(Xapian::Query::OP_WILDCARD,
|
return Xapian::Query(Xapian::Query::OP_WILDCARD,
|
||||||
val->prefix + str.substr(0, vlen - 1));
|
val->prefix + str.substr(0, vlen - 1));
|
||||||
#endif/*XAPIAN_HAVE_OP_WILDCARD*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Xapian::Query
|
static Xapian::Query
|
||||||
|
|||||||
Reference in New Issue
Block a user