Skip to content
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

Fix builds with C++20 #38501

Closed
wants to merge 1 commit into from
Closed

Conversation

smeenai
Copy link
Contributor

@smeenai smeenai commented Jul 18, 2023

Summary:
char8_t is a distinct type in C++20, which would need to be propagated
everywhere else (e.g. using std::u8string instead of std::string).
The code was already assuming that char is UTF-8, so we can just cast
accordingly (which works on all compilers: https://godbolt.org/z/9cv4c48o4).

Reviewed By: javache

Differential Revision: D47537998

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jul 18, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47537998

@analysis-bot
Copy link

analysis-bot commented Jul 18, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,841,719 +0
android hermes armeabi-v7a 8,151,120 -2
android hermes x86 9,347,419 +0
android hermes x86_64 9,190,241 +0
android jsc arm64-v8a 9,454,771 +8
android jsc armeabi-v7a 8,636,083 -6
android jsc x86 9,537,756 +6
android jsc x86_64 9,781,111 -5

Base commit: c0b04d6
Branch: main

smeenai added a commit to smeenai/react-native that referenced this pull request Jul 18, 2023
Summary:
Pull Request resolved: facebook#38501

char8_t is a distinct type in C++20, which would need to be propagated
everywhere else (e.g. using `std::u8string` instead of `std::string`).
The code was already assuming that char is UTF-8, so we can just cast
accordingly (which works on all compilers: https://godbolt.org/z/9cv4c48o4).

Reviewed By: javache

Differential Revision: D47537998

fbshipit-source-id: d652188d8373e529d0be891036cce626138605c0
@smeenai smeenai force-pushed the export-D47537998 branch from 4c5a633 to caace7e Compare July 18, 2023 22:55
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47537998

Summary:
Pull Request resolved: facebook#38501

char8_t is a distinct type in C++20, which would need to be propagated
everywhere else (e.g. using `std::u8string` instead of `std::string`).
The code was already assuming that char is UTF-8, so we can just cast
accordingly (which works on all compilers: https://godbolt.org/z/9cv4c48o4).

Reviewed By: javache

Differential Revision: D47537998

fbshipit-source-id: c56b13e1b45fcb20aaeea8c523d29c85cf43fbe0
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47537998

@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 19, 2023
@smeenai smeenai force-pushed the export-D47537998 branch from caace7e to 86521ab Compare July 19, 2023 21:40
@github-actions
Copy link

This pull request was successfully merged by @smeenai in 2d3348e.

When will my fix make it into a release? | Upcoming Releases

@github-actions github-actions bot added the Merged This PR has been merged. label Jul 20, 2023
@cortinico cortinico removed the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 20, 2023
juniorklawa pushed a commit to juniorklawa/react-native that referenced this pull request Jul 20, 2023
Summary:
Pull Request resolved: facebook#38501

char8_t is a distinct type in C++20, which would need to be propagated
everywhere else (e.g. using `std::u8string` instead of `std::string`).
The code was already assuming that char is UTF-8, so we can just cast
accordingly (which works on all compilers: https://godbolt.org/z/9cv4c48o4).

Reviewed By: javache

Differential Revision: D47537998

fbshipit-source-id: ba045483361463f1754e02791114b78f51932a56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants