Fix macOS RTP endian macro mapping - #269
Open
idy wants to merge 1 commit into
Open
Conversation
The Apple endian header exposes non-underscored macro names while the RTP bit-field selector reads underscored names, selecting the wrong layout. - Map the Apple byte-order macro to the identifier used by RTP - Map both endian constants so the existing comparisons remain valid - Leave non-Apple preprocessing and RTP layout unchanged Fixes sepfy#268 Generated with [Codex](https://github.com/openai)
3 tasks
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
<machine/endian.h>to the underscored identifiers used by libpeer's RTP bit-field selectorRoot cause
On macOS,
BYTE_ORDER,BIG_ENDIAN, andLITTLE_ENDIANare defined, but__BYTE_ORDER,__BIG_ENDIAN, and__LITTLE_ENDIANare not. Undefined identifiers in the RTP#ifexpression evaluate as zero, so the big-endian bit-field layout is selected and an Opus RTP v2/PT111 header starts with02 deinstead of80 6f.Validation
src/rtp.cwith a strict (-Wall -Wextra -Werror) RTP wire regression on AppleClangmainat the expected first-byte assertion and passes with this changeFixes #268