Repository navigation
Use #pragma pack instead of PABB_PACK in the shared protocol headers - #1886
Merged
Merged
Conversation
#pragma pack(push, 1) / #pragma pack(pop) is supported by MSVC, GCC/Clang and avr-gcc alike, so the #if _WIN32 / #elif __GNUC__ PABB_PACK macro (#define PABB_PACK __attribute__((packed)) on GCC, empty on MSVC) is replaced by a single pack(1) region around the message structs, and the PABB_PACK tokens are dropped from the struct declarations.
The PC copy was still at 2026061804 from the 2026-09-02 sync, while the firmware reports 2026061806. The constant is only informational on the PC side (compatibility is decided by SerialPABotBase::SUPPORTED_VERSIONS2()), but keeping the shared header byte-identical in both repos.
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.
Summary
#pragma pack(push, 1)/#pragma pack(pop)is supported by MSVC, GCC/Clang and avr-gcc alike, so this mess is replaced by a single pack(1) region around the message structs in the 9 shared headers under Common/, and allPABB_PACKtokens are dropped from the struct declarations (plus the inline block in SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp).These headers are the shared wire format with Firmware, and after this PR the 9 files are byte-identical in both repos (Firmware has the matching PR: PokemonAutomation/Firmware#57).
Also in this PR
Second commit: syncs
PABB2_MESSAGE_PROTOCOL_VERSIONto 2026061806 (the value the firmware reports; this copy was stale at 2026061804 since the 2026-09-02 sync). The constant is informational on the PC side — compatibility is decided by SerialPABotBase::SUPPORTED_VERSIONS2() — so this is a pure sync to keep the shared file identical.Verification