diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..40e9d89d1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Running test suite will update test expectations to use LF line endings, +# so they need to be checked out using LF as well. +* text=auto eol=lf diff --git a/contributing.md b/contributing.md index b946fdb2c..a4a835780 100644 --- a/contributing.md +++ b/contributing.md @@ -4,7 +4,7 @@ Thanks for wanting to contribute! If you want help or mentorship, please file a Github issue and I'll be sure to provide guidance to the best of my ability. -Otherwise be sure to check out `ARCHITECTURE.md` for an overview on the internals. +Otherwise be sure to check out `internals.md` for an overview on the internals. ## Filing a pull request diff --git a/src/bindgen/ir/constant.rs b/src/bindgen/ir/constant.rs index 121e218b6..e199c39c4 100644 --- a/src/bindgen/ir/constant.rs +++ b/src/bindgen/ir/constant.rs @@ -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::().is_err() { diff --git a/tests/expectations/both/constant.c b/tests/expectations/both/constant.c index bff720a84..fdc7a8142 100644 --- a/tests/expectations/both/constant.c +++ b/tests/expectations/both/constant.c @@ -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 '{' diff --git a/tests/expectations/both/constant.compat.c b/tests/expectations/both/constant.compat.c index 8a37efc34..c2074c110 100644 --- a/tests/expectations/both/constant.compat.c +++ b/tests/expectations/both/constant.compat.c @@ -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 '{' diff --git a/tests/expectations/constant.c b/tests/expectations/constant.c index e6d52c136..8d68c8781 100644 --- a/tests/expectations/constant.c +++ b/tests/expectations/constant.c @@ -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 '{' diff --git a/tests/expectations/constant.compat.c b/tests/expectations/constant.compat.c index 212b9b24b..618ef4c33 100644 --- a/tests/expectations/constant.compat.c +++ b/tests/expectations/constant.compat.c @@ -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 '{' diff --git a/tests/expectations/constant.cpp b/tests/expectations/constant.cpp index ce2e29420..c6f669112 100644 --- a/tests/expectations/constant.cpp +++ b/tests/expectations/constant.cpp @@ -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 = '{'; diff --git a/tests/expectations/tag/constant.c b/tests/expectations/tag/constant.c index 82c1e5ce7..4239b6811 100644 --- a/tests/expectations/tag/constant.c +++ b/tests/expectations/tag/constant.c @@ -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 '{' diff --git a/tests/expectations/tag/constant.compat.c b/tests/expectations/tag/constant.compat.c index 1e4d63e7f..71b811b4e 100644 --- a/tests/expectations/tag/constant.compat.c +++ b/tests/expectations/tag/constant.compat.c @@ -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 '{'