-
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 #1414
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
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 4, 2023
Summary: Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that is 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. Differential Revision: D49896837 fbshipit-source-id: e06e19977c207dc287bd45e9c03f47a0762efb8d
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 4, 2023
Summary: Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that is 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. Differential Revision: D49896837 fbshipit-source-id: a93fa697c9939ce317f9d36098a04645d0aaa59f
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 4, 2023
Summary: Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that is 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. Differential Revision: D49896837 fbshipit-source-id: 6cdd1adbcb4e1738e3e76270ddff9e83e3ff83b3
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 4, 2023
Summary: Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that is 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: 46f095fbd5da9037333fd46881c0a2a9126b3d19
NickGerleman
added a commit
to NickGerleman/react-native
that referenced
this pull request
Oct 4, 2023
Summary: Pull Request resolved: facebook#39796 X-link: facebook/yoga#1414 GCC flags that is 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: d9b4838860b1f4101c9fe08f3cae06d41b2b7691
Summary: Android NDK 25 uses a version of libc++ that is more than three years old, missing a lot of basic features of C++ 20. This is rectified in NDK 26 (latest LTS NDK), which brings us up to date with latest Clang, and later NDK versions will now also bump libc++ as part of bumping LLVM/Clang. This requires an Alpha AGP version, which is... spooky, and we would need to update that before shipping RN 0.74/Yoga 3.0. It does bring us closer to what we want to ship then however. Differential Revision: https://internalfb.com/D49895949 fbshipit-source-id: d4e55d023cd8a658afcfa70ec0d2d625dd7b65b2
Summary: 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: af1fb715520b836702e2adad96e5ae708292bff5
NickGerleman
force-pushed
the
NickGerleman-fix-gcc-floatoptional
branch
from
October 4, 2023 09:02
91a9905
to
b33cf63
Compare
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
This pull request has been merged in 7fe6e34. |
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.
Summary:
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.Note that the use of the
std::floating_point
concept here requires the libc++ bump in the previous diff in the stack.Differential Revision: D49896837
fbshipit-source-id: cd0403bee97b16d31d351a362664be6c8e66d731