Skip to content

[libc] Define MB_LEN_MAX in limits.h #102246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions libc/include/llvm-libc-macros/limits-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
#endif // __CHAR_BIT__
#endif // CHAR_BIT

// TODO: https://github.com/llvm/llvm-project/issues/79358
// Define MB_LEN_MAX if missing.
// clang: MB_LEN_MAX = 1 -
// https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/limits.h#L64
// glibc: MB_LEN_MAX = 16 -
// https://github.com/bminor/glibc/blob/master/include/limits.h#L32
#ifndef MB_LEN_MAX
// Represents a single UTF-32 wide character in the default locale.
#define MB_LEN_MAX 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding comments about the rationale of the value, in case the assumption is changed in the future?

#endif // MB_LEN_MAX

// *_WIDTH macros

Expand Down
Loading