Make sure wchar_t is wide enough to hold all Unicode code-points
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Too bad if it isn't.
This commit is contained in:
parent
6c3b7672a0
commit
4a7e48ed5d
@ -1,6 +1,8 @@
|
|||||||
#include <luna/CString.h>
|
#include <luna/CString.h>
|
||||||
#include <luna/Utf8.h>
|
#include <luna/Utf8.h>
|
||||||
|
|
||||||
|
static_assert(__WCHAR_MAX__ > 0x10ffff);
|
||||||
|
|
||||||
static Result<usize> utf8_char_length(char c)
|
static Result<usize> utf8_char_length(char c)
|
||||||
{
|
{
|
||||||
if ((c & 0b11111000) == 0b11110000) return 4;
|
if ((c & 0b11111000) == 0b11110000) return 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user