[Feature] Implement `mod_t` packed struct
Description
As per title, a little more info the issue
Types of Changes
- [X] Core
- [ ] Bugfix
- [X] New feature
- [X] Enhancement/optimization
- [ ] Keyboard (addition or update)
- [ ] Keymap/layout (addition or update)
- [ ] Documentation
Issues Fixed or Closed by This PR
- Fixes #25163
Checklist
- [x] My code follows the code style of this project: C, Python
- [x] I have read the PR Checklist document and have made the appropriate changes.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
- [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).
Looks like CPP (used for tests) does not like _Static_assert
Should i add something like this to util.h and update all references to "bad" name across codebase?
/**
* @brief Perfom an assertion at compile time.
*
* _Static_assert is C<23, while static_assert is C++/C23.
*/
#if !defined(STATIC_ASSERT)
# ifdef __cplusplus
# define STATIC_ASSERT static_assert
# else
# define STATIC_ASSERT _Static_assert
# endif
#endif
Noticed that there's already a couple places adding compatibility by means of
#ifdef __cplusplus
# define _Static_assert static_assert
#endif
But i don't know where this could be unified. Perhaps just declare this as a flag passed to the compiler when building tests? 🤔
I'd say we start a compiler_support.h file -- there are adaptations of _Static_assert/static_assert which I'd like to include as well in the future.
Please remove the changes to quantum/led.h as they have no bearing on the functionality being added.
Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.
Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.