From 91ad1c44785b0f4b8bd1fa0619ccd0b6ba82a626 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 23 Jul 2026 16:14:04 +0300 Subject: [PATCH] cld2: fix HAVE_CLD2 test It _is_ defined (as 0) when there is no CLD2. --- lib/message/mu-message.cc | 2 +- lib/tests/test-mu-store-query.cc | 2 +- lib/utils/mu-lang-detector.cc | 2 +- mu/tests/test-mu-query.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/message/mu-message.cc b/lib/message/mu-message.cc index d398d599..b2581b07 100644 --- a/lib/message/mu-message.cc +++ b/lib/message/mu-message.cc @@ -591,7 +591,7 @@ process_message(const MimeMessage& mime_msg, const std::string& path, if (info.mailing_list) info.flags |= Flags::MailingList; -#ifdef HAVE_CLD2 +#if HAVE_CLD2 /* language detection requires the cld2 lib */ if (info.body_txt) { /* attempt to get the body-language */ if (const auto lang{detect_language(info.body_txt.value())}; lang) { diff --git a/lib/tests/test-mu-store-query.cc b/lib/tests/test-mu-store-query.cc index 6bff871e..54b0ad73 100644 --- a/lib/tests/test-mu-store-query.cc +++ b/lib/tests/test-mu-store-query.cc @@ -148,7 +148,7 @@ I said: "Aujourd'hui!" "to:sqlite-dev@sqlite.org", "list:sqlite-dev.sqlite.org", "aujourd'hui", -#ifdef HAVE_CLD2 +#if HAVE_CLD2 "lang:en", #endif /*HAVE_CLD2*/ }) { diff --git a/lib/utils/mu-lang-detector.cc b/lib/utils/mu-lang-detector.cc index 75af37eb..9304c9dc 100644 --- a/lib/utils/mu-lang-detector.cc +++ b/lib/utils/mu-lang-detector.cc @@ -21,7 +21,7 @@ using namespace Mu; -#ifndef HAVE_CLD2 +#if HAVE_CLD2 // Dummy implementation Option Mu::detect_language(const std::string& txt) { return Nothing; } #else diff --git a/mu/tests/test-mu-query.cc b/mu/tests/test-mu-query.cc index 9de70f4c..ac336b98 100644 --- a/mu/tests/test-mu-query.cc +++ b/mu/tests/test-mu-query.cc @@ -139,7 +139,7 @@ test_mu_query_01(void) { "", 19 }, {"msgid:abcd$efgh@example.com", 1}, {"i:abcd$efgh@example.com", 1}, -#ifdef HAVE_CLD2 +#if HAVE_CLD2 { "lang:en", 14}, #endif /*HAVE_CLD2*/ };