Skip to content

fix: only define true/false for C in bnxt_re_hsi.h - #457

Merged
jhchouuu merged 1 commit into
mainfrom
pemeliya/true_false_redefine_fix
Jul 8, 2026
Merged

fix: only define true/false for C in bnxt_re_hsi.h#457
jhchouuu merged 1 commit into
mainfrom
pemeliya/true_false_redefine_fix

Conversation

@pemeliya

@pemeliya pemeliya commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This issue has popped up during MORI bazelification for XLA

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents bnxt_re_hsi.h from redefining true/false when included from C++ translation units, which can break subsequent C++ parsing during MORI’s Bazel/XLA build work.

Changes:

  • Guard true/false macro definitions so they are only emitted for C (not C++).
  • Avoid redefining true/false if they are already defined (e.g., via <stdbool.h>).
  • Add an explanatory comment documenting the rationale and failure mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jhchouuu jhchouuu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhchouuu jhchouuu changed the title Redefine fix for true/false values fix: only define true/false for C in bnxt_re_hsi.h Jul 8, 2026
@jhchouuu
jhchouuu merged commit 51b0b09 into main Jul 8, 2026
24 of 27 checks passed
@QizhouZhang97
QizhouZhang97 deleted the pemeliya/true_false_redefine_fix branch July 21, 2026 14:52
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.

3 participants