Description: 适配 MariaDB 11 与缺失 libcrypt 头文件，修复 amd64 编译失败
 构建环境 default-libmysqlclient-dev 指向 MariaDB 11，其 mysql.h 自带
 typedef char my_bool，与历史 patch mysql8_my_bool.patch 引入的
 typedef bool my_bool 冲突；将 my_bool 定义限定为 MySQL 8 且排除
 MariaDB（按 MARIADB_VERSION_ID / MYSQL_VERSION_ID 判断）。
 另外 authreg_sqlite.c 无条件包含 <crypt.h>，在无 libcrypt-dev 的环境
 （configure 检测 crypt 失败）下报 fatal error，改为按 HAVE_CRYPT 保护，
 与 authreg_mysql.c / authreg_ldapfull.c 的既有写法保持一致。
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: other
Forwarded: no
Last-Update: 2026-09-02
---

--- jabberd2-2.7.0.orig/storage/authreg_mysql.c
+++ jabberd2-2.7.0/storage/authreg_mysql.c
@@ -23,7 +23,9 @@
 #define _XOPEN_SOURCE 500
 #include "c2s.h"
 #include <mysql.h>
+#if !defined(MARIADB_VERSION_ID) && defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID >= 80000
 typedef bool my_bool;
+#endif
 #include <stdlib.h>
 #include <openssl/rand.h>
 
--- jabberd2-2.7.0.orig/storage/authreg_sqlite.c
+++ jabberd2-2.7.0/storage/authreg_sqlite.c
@@ -32,7 +32,9 @@
 #define _XOPEN_SOURCE 500
 #include "c2s.h"
 #include <sqlite3.h>
+#ifdef HAVE_CRYPT
 #include <crypt.h>
+#endif
 
 /* Windows does not have the crypt() function, let's take DES_crypt from OpenSSL instead */
 #if defined(HAVE_OPENSSL_CRYPTO_H) && defined(_WIN32)
--- jabberd2-2.7.0.orig/storage/storage_mysql.c
+++ jabberd2-2.7.0/storage/storage_mysql.c
@@ -28,7 +28,9 @@
 #include "storage.h"
 #include <inttypes.h>
 #include <mysql.h>
+#if !defined(MARIADB_VERSION_ID) && defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID >= 80000
 typedef bool my_bool;
+#endif
 
 /** internal structure, holds our data */
 typedef struct drvdata_st {

