mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
re-enable UTF-8 by default, inline utf8_walkbyte, fix missing ifdef in utf8_walk
This commit is contained in:
parent
30e99927d2
commit
2e4fd540ac
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user