mirror of https://github.com/flysand7/ciabatta.git
fix compile issue
This commit is contained in:
parent
bf428a9924
commit
11474a78c6
|
@ -35,8 +35,7 @@ typedef struct lldiv_t {
|
||||||
|
|
||||||
#define RAND_MAX 65536
|
#define RAND_MAX 65536
|
||||||
|
|
||||||
#define MB_LEN_MAX 4
|
#define MB_CUR_MAX 5
|
||||||
#define MB_CUR_MAX 4
|
|
||||||
|
|
||||||
// Microsoft extension, COUNTOF(x) counts array elements
|
// Microsoft extension, COUNTOF(x) counts array elements
|
||||||
#ifndef COUNTOF
|
#ifndef COUNTOF
|
||||||
|
|
|
@ -12,7 +12,7 @@ struct mbstate_t {
|
||||||
union {
|
union {
|
||||||
char16_t leftover;
|
char16_t leftover;
|
||||||
char16_t high_surrogate;
|
char16_t high_surrogate;
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
size_t mbrtoc16(
|
size_t mbrtoc16(
|
||||||
|
|
|
@ -82,10 +82,11 @@ size_t c16rtomb(
|
||||||
}
|
}
|
||||||
else goto invalid_char;
|
else goto invalid_char;
|
||||||
// Write the codepoint that we decided to write to multibyte string
|
// Write the codepoint that we decided to write to multibyte string
|
||||||
int written_len = utf8_chenc(s, 4, codepoint_to_write);
|
int written_len = utf8_chenc((char8_t *)s, 4, codepoint_to_write);
|
||||||
if(written_len < 0) {
|
if(written_len < 0) {
|
||||||
goto invalid_char;
|
goto invalid_char;
|
||||||
}
|
}
|
||||||
|
s[written_len] = 0;
|
||||||
return (size_t)written_len;
|
return (size_t)written_len;
|
||||||
invalid_char:
|
invalid_char:
|
||||||
errno = EILSEQ;
|
errno = EILSEQ;
|
||||||
|
|
Loading…
Reference in New Issue