Skip to content

Allow macro definitions to pick up precise C types - #3518

Merged
emilio merged 1 commit into
rust-lang:mainfrom
emilio:precise-macro-value-type-rebase
Oct 13, 2026
Merged

emilio merged 1 commit into
rust-lang:mainfrom
emilio:precise-macro-value-type-rebase

Conversation

@emilio

@emilio emilio commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Upon activating the --macro-const-use-ctypes flag, bindgen should generate bindings with precise type resolution to the exact C types.

This flag implies --clang-macro-fallback as its pre-requisite.

This is a rebase of #3323 with two changes:

  • The option is read inside the clang fallback to avoid changing behavior without it.
  • Removed miscellaneous changes to .gitignore, and test fallback dir creation which didn't seem to be needed.

Upon activating the `--macro-const-use-ctypes` flag, `bindgen` should
generate bindings with precise type resolution to the exact C types.

This flag implies `--clang-macro-fallback` as its pre-requisite.

Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
@emilio
emilio enabled auto-merge October 13, 2026 10:41
@emilio emilio mentioned this pull request Oct 13, 2026
@emilio
emilio added this pull request to the merge queue Oct 13, 2026
Merged via the queue into rust-lang:main with commit 381d374 Oct 13, 2026
52 checks passed
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.

2 participants