Release 1.3.1: fix TI ARM CGT big-endian detection in the C library, render README on PyPI#86
Merged
Merged
Conversation
hit9
commented
Jun 19, 2026
Owner
- fix: render the README as the long description on PyPI
- fix: extend BP_BIG_ENDIAN auto-detection to TI ARM CGT in the C library
- release: 1.3.1
The bitproto package had no `readme`, so the PyPI project page showed no description. setuptools rejects a path outside the project dir (`../README.md`), so symlink compiler/README.md -> ../README.md and set `readme = "README.md"`; the README body is embedded into the package METADATA (text/markdown) at build time. Also make the data-encoding image an absolute raw.githubusercontent URL so it renders on PyPI (relative paths break there) while still working on GitHub. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR #84 added __BIG_ENDIAN__ detection to the optimization-mode generated code, but missed the same macro in the standard-mode C library (lib/c/bitproto.c), which only recognised GCC/Clang's __BYTE_ORDER__. So on TI ARM CGT big-endian targets (--be32, e.g. TMS570) non-optimization mode still fell through to the little-endian path, producing incorrect encode/decode results for multi-byte fields. Mirror the codegen detection here so both modes behave consistently: #if !defined(BP_BIG_ENDIAN) && ( (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) || defined(__BIG_ENDIAN__)) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- TI ARM CGT big-endian auto-detection fix (codegen PR #84 + C library). - Render the README as the PyPI long description. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Broaden BP_BIG_ENDIAN auto-detection to cover IAR, which always defines __LITTLE_ENDIAN__ (1 for little, 0 for big), in addition to GCC/Clang (__BYTE_ORDER__) and TI ARM CGT (__BIG_ENDIAN__). The check uses "== 0" rather than "defined()" so GCC/Clang (which define __LITTLE_ENDIAN__ to 1 on little-endian) are not falsely detected as big-endian. Applied to both the standard-mode C library (lib/c/bitproto.c) and the optimization-mode codegen (renderer_c.py); regenerated the opt-mode examples. Documented the full detection set (GCC/Clang, TI CGT, IAR) in docs/endianness.rst, updated the 1.3.1 changelog entry, and synced the zh translation catalogs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.