Skip to content

Release 1.3.1: fix TI ARM CGT big-endian detection in the C library, render README on PyPI#86

Merged
hit9 merged 9 commits into
masterfrom
fix-pyproject-description
Jun 19, 2026
Merged

Release 1.3.1: fix TI ARM CGT big-endian detection in the C library, render README on PyPI#86
hit9 merged 9 commits into
masterfrom
fix-pyproject-description

Conversation

@hit9

@hit9 hit9 commented Jun 19, 2026

Copy link
Copy Markdown
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

hit9 and others added 9 commits June 19, 2026 06:03
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>
@hit9 hit9 merged commit 867c324 into master Jun 19, 2026
7 checks passed
@hit9 hit9 deleted the fix-pyproject-description branch June 19, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant