From 2d307f0ba7804d1c2cdf26766674831c318fbcb6 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 28 Oct 2024 14:43:11 +0100 Subject: [PATCH] [deps] Update is_utf8 to version 1.4.1 --- deps/is_utf8/CMakeLists.txt | 4 ++-- deps/is_utf8/include/is_utf8.h | 4 ++-- deps/is_utf8/src/is_utf8.cpp | 30 ++++++++++++++++-------------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/deps/is_utf8/CMakeLists.txt b/deps/is_utf8/CMakeLists.txt index ab9e040..2c98033 100644 --- a/deps/is_utf8/CMakeLists.txt +++ b/deps/is_utf8/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15) project(is_utf8 DESCRIPTION "Fast UTF-8 Validation" LANGUAGES CXX - VERSION 1.3.2 + VERSION 1.4.1 ) include(GNUInstallDirs) @@ -29,7 +29,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_MACOSX_RPATH OFF) -set(IS_UTF8_LIB_VERSION "1.3.2" CACHE STRING "is_utf8 library version") +set(IS_UTF8_LIB_VERSION "1.4.1" CACHE STRING "is_utf8 library version") set(IS_UTF8_LIB_SOVERSION "1" CACHE STRING "is_utf8 library soversion") set(IS_UTF8_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) diff --git a/deps/is_utf8/include/is_utf8.h b/deps/is_utf8/include/is_utf8.h index 66e8a8f..a39ba3c 100644 --- a/deps/is_utf8/include/is_utf8.h +++ b/deps/is_utf8/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 diff --git a/deps/is_utf8/src/is_utf8.cpp b/deps/is_utf8/src/is_utf8.cpp index 72ed218..62d8759 100644 --- a/deps/is_utf8/src/is_utf8.cpp +++ b/deps/is_utf8/src/is_utf8.cpp @@ -2568,11 +2568,11 @@ template <> struct simd8 : base8 { return _mm256_set1_epi8(uint8_t(-(!!_value))); } - is_utf8_really_inline simd8() : base8() {} - is_utf8_really_inline simd8(const __m256i _value) + is_utf8_really_inline simd8() : base8() {} + is_utf8_really_inline simd8(const __m256i _value) : base8(_value) {} // Splat constructor - is_utf8_really_inline simd8(bool _value) : base8(splat(_value)) {} + is_utf8_really_inline simd8(bool _value) : base8(splat(_value)) {} is_utf8_really_inline uint32_t to_bitmask() const { return uint32_t(_mm256_movemask_epi8(*this)); @@ -2998,11 +2998,11 @@ template <> struct simd16 : base16 { return _mm256_set1_epi16(uint16_t(-(!!_value))); } - is_utf8_really_inline simd16() : base16() {} - is_utf8_really_inline simd16(const __m256i _value) + is_utf8_really_inline simd16() : base16() {} + is_utf8_really_inline simd16(const __m256i _value) : base16(_value) {} // Splat constructor - is_utf8_really_inline simd16(bool _value) + is_utf8_really_inline simd16(bool _value) : base16(splat(_value)) {} is_utf8_really_inline bitmask_type to_bitmask() const { @@ -3549,11 +3549,11 @@ template <> struct simd8 : base8 { return _mm_set1_epi8(uint8_t(-(!!_value))); } - is_utf8_really_inline simd8() : base8() {} - is_utf8_really_inline simd8(const __m128i _value) + is_utf8_really_inline simd8() : base8() {} + is_utf8_really_inline simd8(const __m128i _value) : base8(_value) {} // Splat constructor - is_utf8_really_inline simd8(bool _value) : base8(splat(_value)) {} + is_utf8_really_inline simd8(bool _value) : base8(splat(_value)) {} is_utf8_really_inline int to_bitmask() const { return _mm_movemask_epi8(*this); @@ -4065,11 +4065,11 @@ template <> struct simd16 : base16 { return _mm_set1_epi16(uint16_t(-(!!_value))); } - is_utf8_really_inline simd16() : base16() {} - is_utf8_really_inline simd16(const __m128i _value) + is_utf8_really_inline simd16() : base16() {} + is_utf8_really_inline simd16(const __m128i _value) : base16(_value) {} // Splat constructor - is_utf8_really_inline simd16(bool _value) + is_utf8_really_inline simd16(bool _value) : base16(splat(_value)) {} is_utf8_really_inline int to_bitmask() const { @@ -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); + } }