re-enable UTF-8 by default, inline utf8_walkbyte, fix missing ifdef in utf8_walk

This commit is contained in:
Brad Parker 2016-08-24 10:56:00 -04:00
parent 30e99927d2
commit 2e4fd540ac
3 changed files with 6 additions and 4 deletions

View File

@ -530,7 +530,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/drivers/null.o
endif
ifeq ($(UTF8), 1)
ifneq ($(NO_UTF8), 1)
DEFINES += -DHAVE_UTF8
OBJ += intl/msg_hash_ru.o
DEFINES += -finput-charset=UTF-8

View File

@ -209,7 +209,7 @@ size_t utf8len(const char *string)
#endif
}
uint8_t utf8_walkbyte(const char **string)
inline uint8_t utf8_walkbyte(const char **string)
{
return *((*string)++);
}
@ -217,6 +217,7 @@ uint8_t utf8_walkbyte(const char **string)
/* Does not validate the input, returns garbage if it's not UTF-8. */
uint32_t utf8_walk(const char **string)
{
#ifdef HAVE_UTF8
uint8_t first = utf8_walkbyte(string);
uint32_t ret;
@ -235,4 +236,7 @@ uint32_t utf8_walk(const char **string)
if (first >= 0xE0)
return ret | (first&15)<<12;
return ret | (first&7)<<6;
#else
return utf8_walkbyte(string);
#endif
}

View File

@ -40,8 +40,6 @@ size_t utf8cpy(char *d, size_t d_len, const char *s, size_t chars);
const char *utf8skip(const char *str, size_t chars);
uint8_t utf8_walkbyte(const char **string);
uint32_t utf8_walk(const char **string);
#endif