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

FloatOptional GCC build fix and more constexpr #1414

Closed
wants to merge 2 commits into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
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: cd0403bee97b16d31d351a362664be6c8e66d731

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
NickGerleman and others added 2 commits October 4, 2023 02:00
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 NickGerleman force-pushed the NickGerleman-fix-gcc-floatoptional branch from 91a9905 to b33cf63 Compare October 4, 2023 09:02
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
Copy link
Contributor

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
@NickGerleman NickGerleman deleted the NickGerleman-fix-gcc-floatoptional branch November 1, 2023 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants