diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 8f9d58f7..24c6c77b 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -200,15 +200,6 @@ void report_error(FormatFunc func, int error_code, } } // namespace -FMT_FUNC size_t internal::count_code_points(basic_string_view s) { - const char8_t* data = s.data(); - size_t num_code_points = 0; - for (size_t i = 0, size = s.size(); i != size; ++i) { - if ((data[i] & 0xc0) != 0x80) ++num_code_points; - } - return num_code_points; -} - #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) namespace internal { diff --git a/include/fmt/format.h b/include/fmt/format.h index 72be49bc..7e4cf3be 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -766,7 +766,14 @@ inline size_t count_code_points(basic_string_view s) { } // Counts the number of code points in a UTF-8 string. -FMT_API size_t count_code_points(basic_string_view s); +inline size_t count_code_points(basic_string_view s) { + const char8_t* data = s.data(); + size_t num_code_points = 0; + for (size_t i = 0, size = s.size(); i != size; ++i) { + if ((data[i] & 0xc0) != 0x80) ++num_code_points; + } + return num_code_points; +} inline char8_t to_char8_t(char c) { return static_cast(c); }