[pim/kldap] src/core: ldapconnection.cpp - fix unused-const-variable
Allen Winter <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 54eebf98dc9f52b4ee8503d343979f733ec2d357 by Allen Winter.
Committed on 19/07/2026 at 14:58.
Pushed by winterz into branch 'master'.
ldapconnection.cpp - fix unused-const-variable
Encountered if LDAP_FOUND is false
Fixes:
```
src/core/ldapconnection.cpp:19:30: error: unused variable 'callbacks'
[-Werror,-Wunused-const-variable]
19 | static const sasl_callback_t callbacks[] = {{SASL_CB_ECHOPROMPT, nullptr, nullptr},
```
M +2 -1 src/core/ldapconnection.cpp
https://invent.kde.org/pim/kldap/-/commit/54eebf98dc9f52b4ee8503d343979f733ec2d357
diff --git a/src/core/ldapconnection.cpp b/src/core/ldapconnection.cpp
index 3aa2eab..e28a598 100644
--- a/src/core/ldapconnection.cpp
+++ b/src/core/ldapconnection.cpp
@@ -16,6 +16,7 @@ using namespace Qt::Literals::StringLiterals;
#include <cstdlib>
#include <sasl/sasl.h>
+#if LDAP_FOUND
static const sasl_callback_t callbacks[] = {{SASL_CB_ECHOPROMPT, nullptr, nullptr},
{SASL_CB_NOECHOPROMPT, nullptr, nullptr},
{SASL_CB_GETREALM, nullptr, nullptr},
@@ -24,7 +25,7 @@ static const sasl_callback_t callbacks[] = {{SASL_CB_ECHOPROMPT, nullptr, nullpt
{SASL_CB_PASS, nullptr, nullptr},
{SASL_CB_CANON_USER, nullptr, nullptr},
{SASL_CB_LIST_END, nullptr, nullptr}};
-
+#endif
static bool ldapoperation_sasl_initialized = false;
#if LDAP_FOUND