-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
FloatOptional GCC build fix and more constexpr #1411
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have no idea how Clang is okay with`unwrapOrDefault()` here.
NickGerleman
changed the title
Fix FloatOptional GCC Build
FloatOptional GCC build fix and more constexpr
Oct 4, 2023
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was exported from Phabricator. Differential Revision: D49896837 |
This pull request was exported from Phabricator. Differential Revision: D49896837 |
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 5, 2023
Summary: X-link: facebook/yoga#1411 Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837 fbshipit-source-id: 7eb01752afc41ef64a561f8a7ada01a644608ceb
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 5, 2023
Summary: X-link: facebook/yoga#1411 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 5, 2023
Summary: X-link: facebook/yoga#1411 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 6, 2023
Summary: X-link: facebook/yoga#1411 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837
facebook-github-bot
pushed a commit
to facebook/litho
that referenced
this pull request
Oct 6, 2023
Summary: X-link: facebook/yoga#1411 X-link: facebook/react-native#39796 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837 fbshipit-source-id: 61e2bbbfedecffd007a12d42d998e43d3cf5119c
facebook-github-bot
pushed a commit
that referenced
this pull request
Oct 6, 2023
Summary: Pull Request resolved: #1411 X-link: facebook/react-native#39796 Pull Request resolved: #1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837 fbshipit-source-id: 61e2bbbfedecffd007a12d42d998e43d3cf5119c
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Oct 6, 2023
Summary: X-link: facebook/yoga#1411 Pull Request resolved: #39796 X-link: facebook/yoga#1414 GCC flags that `isUndefined()` is not declared `constexpr` but that `unwrapOrDefault()` is. `std::isnan` is not constexpr until C++ 23 (because we cannot have nice things), so I made `yoga::isUndefined()` constexpr, using the same code `std::isnan()` boils down to. I then made `FloatOptional` depend on `Comparison.h` (instead of the other way around), so we can use it. Note that the use of the `std::floating_point` concept here requires the libc++ bump in the previous diff in the stack. Reviewed By: yungsters Differential Revision: D49896837 fbshipit-source-id: 61e2bbbfedecffd007a12d42d998e43d3cf5119c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GCC flags that is is not declared
constexpr
but thatunwrapOrDefault()
is.std::isnan
is not constexpr until C++ 23 (because we cannot have nice things), so I madeyoga::isUndefined()
constexpr, using the same codestd::isnan()
boils down to. I then madeFloatOptional
depend onComparison.h
(instead of the other way around), so we can use it.