Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Cleanup some string operating functions #96099
Cleanup some string operating functions #96099
Changes from 7 commits
b733ba6
fd76ebe
e8d844a
2794371
23947ba
fa3ff62
90d51cc
c756156
7d91247
0e11ecb
128920f
765b4e3
51da9cd
1dd038d
e9137da
466e3d0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be LPSTR (UTF8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement is unchanged (with whitespace off).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length
->destLen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dn-u16.h uses
WCHAR
while minipal/utf-8 usesCHAR16_T
. They are not treated as compatible although both typedef-d from wchar_t. Is any reason that compiler supported char16_t can't be used?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some platforms do not support
char16_t
, which is why we went with the least supported type to handle coreclr and mono simultaneously.runtime/src/native/minipal/utf8.h
Lines 21 to 25 in 17594ec
During this refactoring, it's better to directly allocate the target type;
CHAR16_T
for UTF16 orchar
for UTF8 to avoid further confusion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was asking for the exact platforms and GCC/Clang versions we need to target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS doesn't support
char16_t
so you can cross the whole IsApplePlatform series off the list. Our least supported versions support C11 and hencechar16_t
on Linux, so only OS headers are relevant here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked a friend to confirm that
char16_t
is supported with latest build tool on macOS. The mentions of macOS doesn't supportchar16_t
are quite old. On cppreference,char16_t
is marked as supported by Apple clang. There's also documentation about CChar16 in Swift doc.Can you confirm again about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in C mode, we had some problems. I don't remember the details offhand. This is the quick way to find out what doesn't work in the CI:
(note that we'd still need
CHAR16_T
for Windows, so perhaps it's better to keep this investigation separate from this PR)This file was deleted.