From 6ce7f7e0dabe615dbf08679deb2448bdcabf755a Mon Sep 17 00:00:00 2001 From: zjyhjqs Date: Sat, 30 Mar 2024 14:19:45 +0800 Subject: [PATCH] Fix improper check for `mbrlen`/`mblen` The usage place (`IconvLCPTranscoder::calcRequiredSize`) will check the existence of `::mbrlen` first. If not then use the `::mblen` as alternative. NDK doesn't provide the implementation of `::mblen` below API level 26. Only checks `HAVE_MBLEN` would consequence to configuration failure. --- CMakeLists.txt | 2 +- cmake/XercesTranscoderSelection.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bee6cd581..6685635ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,13 +110,13 @@ include(XercesICU) include(XercesMutexMgrSelection) include(XercesNetAccessorSelection) include(XercesMsgLoaderSelection) +include(XercesWChar) include(XercesTranscoderSelection) include(XercesFileMgrSelection) include(XercesXMLCh) include(XercesMFC) include(XercesSSE2) include(XercesPathMax) -include(XercesWChar) include(XercesIconvConst) include(XercesLFS) diff --git a/cmake/XercesTranscoderSelection.cmake b/cmake/XercesTranscoderSelection.cmake index 5dd7c6257..62e7472ae 100644 --- a/cmake/XercesTranscoderSelection.cmake +++ b/cmake/XercesTranscoderSelection.cmake @@ -79,7 +79,7 @@ check_function_exists(wcstombs HAVE_WCSTOMBS) check_function_exists(mbstowcs HAVE_MBSTOWCS) set(iconv_available 0) -if(HAVE_WCHAR_H AND HAVE_MBLEN AND HAVE_WCSTOMBS AND HAVE_MBSTOWCS) +if(HAVE_WCHAR_H AND (HAVE_MBRLEN OR HAVE_MBLEN) AND HAVE_WCSTOMBS AND HAVE_MBSTOWCS) set(iconv_available 1) list(APPEND transcoders iconv) endif()