From c92abbf6a26eb6d3ed594488aa9d857d74f1c1b1 Mon Sep 17 00:00:00 2001 From: Friwi Date: Thu, 12 Sep 2024 15:51:40 +0200 Subject: [PATCH 1/2] Stop mangling of function name --- include/is_utf8.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/is_utf8.h b/include/is_utf8.h index 66e8a8f..a39ba3c 100644 --- a/include/is_utf8.h +++ b/include/is_utf8.h @@ -6,5 +6,5 @@ // 99.99% of the inputs are valid UTF-8. // Thus the function unconditionally scans the // whole input. -bool is_utf8(const char *src, size_t len); -#endif // IS_UTF8 \ No newline at end of file +extern "C" bool is_utf8(const char *src, size_t len); +#endif // IS_UTF8 From 8e8fc9017c3dffa1e1bf12af9c414125cef7397c Mon Sep 17 00:00:00 2001 From: Friwi Date: Thu, 12 Sep 2024 15:52:23 +0200 Subject: [PATCH 2/2] Stop mangling of function name --- src/is_utf8.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/is_utf8.cpp b/src/is_utf8.cpp index 72ed218..e485ed0 100644 --- a/src/is_utf8.cpp +++ b/src/is_utf8.cpp @@ -6748,6 +6748,8 @@ IS_UTF8_UNTARGET_REGION IS_UTF8_POP_DISABLE_WARNINGS -bool is_utf8(const char *src, size_t len) { - return is_utf8_internals::validate_utf8(src, len); +extern "C" { + bool is_utf8(const char *src, size_t len) { + return is_utf8_internals::validate_utf8(src, len); + } }