Repository navigation
Fix C++ build - #24786
Merged
Merged
Fix C++ build#24786
Conversation
devnexen
reviewed
Oct 27, 2026
| { | ||
| static_assert(sizeof(_Atomic uint32_t) == sizeof(uint32_t), "atomic size"); | ||
| static_assert(alignof(_Atomic uint32_t) == alignof(uint32_t), "atomic align"); | ||
| #ifdef __cplusplus |
Member
There was a problem hiding this comment.
Suggested change
| #ifdef __cplusplus | |
| #ifdef __cplusplus | |
| static_assert(sizeof(std::atomic<uint32_t>) == sizeof(uint32_t), "atomic size"); | |
| static_assert(alignof(std::atomic<uint32_t>) == alignof(uint32_t), "atomic align"); | |
| static_assert(ATOMIC_INT_LOCK_FREE == 2, "not always lock-free"); | |
| uint32_t type_info = reinterpret_cast<const std::atomic<uint32_t> *>(&GC_TYPE_INFO(s))->load(std::memory_order_acquire); | |
| #else | |
| static_assert(sizeof(_Atomic uint32_t) == sizeof(uint32_t), "atomic size"); | |
| static_assert(alignof(_Atomic uint32_t) == alignof(uint32_t), "atomic align"); | |
| static_assert(ATOMIC_INT_LOCK_FREE == 2, "not always lock-free"); | |
| uint32_t type_info = atomic_load_explicit((_Atomic uint32_t *)&GC_TYPE_INFO(s), memory_order_acquire); | |
| #endif |
Member
Author
There was a problem hiding this comment.
Thank you. I've pushed a simplified version before seeing this comment because MSVC also doesn't have ATOMIC_INT_LOCK_FREE == 2 in C.
arnaud-lb
force-pushed
the
fix-cpp-build
branch
from
October 27, 2026 13:59
486ea52 to
c365895
Compare
Contributor
I think a file just for atomics because of C++ is overkill, perhaps a |
arnaud-lb
marked this pull request as ready for review
October 27, 2026 14:42
Member
Author
|
@henderkes that would be ideal indeed |
Member
Author
|
I'm going to merge this to fix the build for now |
Member
|
@arnaud-lb I think you should also backport this to 8.6? |
Member
Author
|
@LamentXU123 is 8.6 broken too? |
Member
|
Oh my bad. I look into the wrong branch. Sry :) |
This file contains hidden or 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
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.
Broke the build while merging #24585 up, as I didn't anticipate that the header needs to be C++ compatible when building intl.
I'm wondering if we should eventually re-introduce a smaller zend_atomics.h header for C++ compat.
For now I would like to fix the build.
cc @henderkes @devnexen