Use U'...' character literals instead of L'...' character literals

On Windows `L'...'` is 16 bit, so Rust `char` won't generally fit into it.
This commit is contained in:
Vadim Petrochenkov 2020-10-02 22:13:37 +03:00 committed by Emilio Cobos Álvarez
parent f4b26fef2a
commit 56d0799366
8 changed files with 15 additions and 15 deletions

View File

@ -204,7 +204,7 @@ impl Literal {
syn::Lit::Byte(ref value) => Ok(Literal::Expr(format!("{}", value.value()))),
syn::Lit::Char(ref value) => Ok(Literal::Expr(match value.value() as u32 {
0..=255 => format!("'{}'", value.value().escape_default()),
other_code => format!(r"L'\U{:08X}'", other_code),
other_code => format!(r"U'\U{:08X}'", other_code),
})),
syn::Lit::Int(ref value) => {
if value.base10_parse::<i64>().is_err() {

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'

View File

@ -10,11 +10,11 @@ static const uint32_t DELIMITER = ':';
static const uint32_t DOUBLE_CAST = (uint32_t)(float)1;
static const uint32_t EQUID = L'\U00010083';
static const uint32_t EQUID = U'\U00010083';
static const int32_t FOO = 10;
static const uint32_t HEART = L'\U00002764';
static const uint32_t HEART = U'\U00002764';
static const uint32_t LEFTCURLY = '{';

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'

View File

@ -9,11 +9,11 @@
#define DOUBLE_CAST (uint32_t)(float)1
#define EQUID L'\U00010083'
#define EQUID U'\U00010083'
#define FOO 10
#define HEART L'\U00002764'
#define HEART U'\U00002764'
#define LEFTCURLY '{'