Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tornax O7
relibc
Commits
700c53cf
Verified
Commit
700c53cf
authored
4 years ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Update toolchain to 2021-06-15
parent
b472cb87
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
rust-toolchain
+1
-1
1 addition, 1 deletion
rust-toolchain
src/header/wchar/utf8.rs
+31
-1
31 additions, 1 deletion
src/header/wchar/utf8.rs
with
33 additions
and
3 deletions
Makefile
+
1
−
1
View file @
700c53cf
...
...
@@ -2,7 +2,7 @@ TARGET?=$(shell rustc -Z unstable-options --print target-spec-json | grep llvm-t
CARGO
?=
cargo
CARGO_TEST
?=
$(
CARGO
)
CARGOFLAGS
?=
CARGOFLAGS
?=
-Z
build-std
=
core,alloc,compiler_builtins
RUSTCFLAGS
?=
export
OBJCOPY
?=
objcopy
...
...
This diff is collapsed.
Click to expand it.
rust-toolchain
+
1
−
1
View file @
700c53cf
nightly-202
0
-0
7-27
nightly-202
1
-0
3-15
This diff is collapsed.
Click to expand it.
src/header/wchar/utf8.rs
+
31
−
1
View file @
700c53cf
...
...
@@ -10,9 +10,39 @@ use crate::{
use
super
::
mbstate_t
;
// Based on
// https://github.com/rust-lang/rust/blob/f24ce9b/library/core/src/str/validations.rs#L232-L257,
// because apparently somebody removed the `pub use` statement from `core::str`.
// https://tools.ietf.org/html/rfc3629
static
UTF8_CHAR_WIDTH
:
[
u8
;
256
]
=
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
// 0x1F
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
// 0x3F
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
// 0x5F
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
// 0x7F
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// 0x9F
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// 0xBF
0
,
0
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
// 0xDF
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
// 0xEF
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// 0xFF
];
// Given a first byte, determines how many bytes are in this UTF-8 character.
#[inline]
fn
utf8_char_width
(
b
:
u8
)
->
usize
{
UTF8_CHAR_WIDTH
[
usize
::
from
(
b
)]
.into
()
}
//It's guaranteed that we don't have any nullpointers here
pub
unsafe
fn
mbrtowc
(
pwc
:
*
mut
wchar_t
,
s
:
*
const
c_char
,
n
:
usize
,
ps
:
*
mut
mbstate_t
)
->
usize
{
let
size
=
str
::
utf8_char_width
(
*
s
as
u8
);
let
size
=
utf8_char_width
(
*
s
as
u8
);
if
size
>
n
{
platform
::
errno
=
errno
::
EILSEQ
;
return
-
2isize
as
usize
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment