From: Jacob Lifshay Date: Thu, 29 Jun 2017 07:15:55 +0000 (-0700) Subject: fix multiple definitions in src/util/text.h X-Git-Tag: gsoc-2017~80 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51691f7fa17bdf001c5d8f47bd6d18362a8797b9;p=kazan.git fix multiple definitions in src/util/text.h --- diff --git a/src/util/text.h b/src/util/text.h index 7e9dab5..e68eb49 100644 --- a/src/util/text.h +++ b/src/util/text.h @@ -234,7 +234,7 @@ public: } }; -Encoded_character encode_utf8(char32_t ch, bool use_2_byte_null = false) noexcept +constexpr Encoded_character encode_utf8(char32_t ch, bool use_2_byte_null = false) noexcept { assert(ch < 0x10FFFFUL && ch >= 0); if(use_2_byte_null && ch == 0) @@ -278,7 +278,7 @@ typename std::char_traits::int_type decode_utf16( return unit0; } -Encoded_character encode_utf16(char32_t ch) noexcept +constexpr Encoded_character encode_utf16(char32_t ch) noexcept { assert(ch < 0x10FFFFUL && ch >= 0); if(ch < 0x10000UL) @@ -307,7 +307,7 @@ typename std::char_traits::int_type decode_utf32( return retval; } -Encoded_character encode_utf32(char32_t ch) noexcept +constexpr Encoded_character encode_utf32(char32_t ch) noexcept { return Encoded_character(ch); } @@ -320,7 +320,7 @@ static_assert(std::numeric_limits::digits constexpr bool is_wide_character_utf16 = std::numeric_limits::digits <= 16; -Encoded_character encode_wide(char32_t ch) noexcept +constexpr Encoded_character encode_wide(char32_t ch) noexcept { if(is_wide_character_utf16) {