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

toolchain: common: iterable sections: add alternate foreach #55429

Merged

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Mar 4, 2023

Previously, it was possible to declare an iterable section using the alternate form (where the out_type does not correspond to the struct_type) but there was no convenient means to iterate over them.

Add STRUCT_SECTION_FOREACH_ALTERNATE() to fill the gap.

@cfriedt cfriedt added area: Build System area: Tests Issues related to a particular existing or missing test labels Mar 4, 2023
@cfriedt cfriedt force-pushed the struct-section-foreach-alternate branch 2 times, most recently from 7e24906 to a656c31 Compare March 4, 2023 21:54
@cfriedt
Copy link
Member Author

cfriedt commented Mar 4, 2023

I can't be sure, but I feel like we actually had this a long time ago... 🤔

@cfriedt cfriedt force-pushed the struct-section-foreach-alternate branch from a656c31 to 4ed989f Compare March 5, 2023 01:08
@cfriedt
Copy link
Member Author

cfriedt commented Mar 5, 2023

  • define STRUCT_SECTION_FOREACH() in terms of STRUCT_SECTION_FOREACH_ALTERNATE()

cfriedt added 2 commits March 4, 2023 20:13
Previously, it was possible to declare an iterable section using
the alternate form (where the `out_type` does not correspond
to the `struct_type`) but there was no convenient means to
iterate over them.

Add `STRUCT_SECTION_FOREACH_ALTERNATE()` to fill the gap.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
Add tests for `STRUCT_SECTION_FOREACH_ALTERNATE()`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
@cfriedt cfriedt force-pushed the struct-section-foreach-alternate branch from 4ed989f to 4dafe9f Compare March 5, 2023 01:13
@carlescufi carlescufi merged commit 6841d96 into zephyrproject-rtos:main Mar 6, 2023
@cfriedt cfriedt deleted the struct-section-foreach-alternate branch June 3, 2023 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants