Rename near identifier to avoid Windows macro clash #1983

Manually merged
github merged 1 commit from gh-pr/1983/head into gh-pr/1983/base 2026-11-26 10:10:47 +00:00
Owner

@⁠KairosMakki on GitHub · 2026-10-29 21:00 UTC · original
KairosMakki:fix/rename-near-identifier → main · +6 −6 · 1 files · 1 commits · merged 2026-10-29 23:41 UTC

Rename near identifier to avoid Windows macro clash

On Windows, <windows.h> defines near as an empty macro, a legacy far-pointer keyword. The test file tests/ShaderRayTracingGpuTests.inc uses near as a local variable name, so after preprocessing a declaration like const std::array<float, 8> near {...} turns into const std::array<float, 8> {...}, which is invalid C++. This is why the clang-cl build of shader_recompiler_compute_tests fails with errors such as “expected unqualified-id” and “expected body of lambda expression,” and the build stops at the link step. This change renames the local identifier to nearDist throughout the file, using word boundaries so no larger identifiers are touched

**@⁠KairosMakki** on GitHub · 2026-10-29 21:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1983) `KairosMakki:fix/rename-near-identifier` → `main` · +6 −6 · 1 files · 1 commits · merged 2026-10-29 23:41 UTC Rename near identifier to avoid Windows macro clash On Windows, <windows.h> defines near as an empty macro, a legacy far-pointer keyword. The test file tests/ShaderRayTracingGpuTests.inc uses near as a local variable name, so after preprocessing a declaration like const std::array<float, 8> near {...} turns into const std::array<float, 8> {...}, which is invalid C++. This is why the clang-cl build of shader_recompiler_compute_tests fails with errors such as “expected unqualified-id” and “expected body of lambda expression,” and the build stops at the link step. This change renames the local identifier to nearDist throughout the file, using word boundaries so no larger identifiers are touched
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:10:46 +00:00
github manually merged commit 341f61ed8f into gh-pr/1983/base 2026-11-26 10:10:47 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-29 21:02 UTC · original

Review in Change Stack →

Walkthrough

The local near array in TrinityBvhIntersections was renamed to nearDist. Bounds construction and child-order comparisons now use the new name. Values, bounds, quantization, and comparison rules remain unchanged.

Suggested reviewers: nmzik

Priority: Low

Change: Bug fix

Merge Risk: Minimal · up to 341f6

The rename is limited to the local distance array and its references, with no identified behavior change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: renaming the near identifier to avoid a Windows macro conflict.
Description check Passed The description directly explains the identifier rename, the Windows macro clash, and the resulting build failure.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-29 21:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1983#issuecomment-6508247315) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1983?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> The local `near` array in `TrinityBvhIntersections` was renamed to `nearDist`. Bounds construction and child-order comparisons now use the new name. Values, bounds, quantization, and comparison rules remain unchanged. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <strong>Priority: <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/priority-low-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Low</strong> <!-- change_assessment_commit:"341f61ed8f898f338b8c876349e2e7025789094a" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>341f6</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `341f6` --> <!-- final_review_risk_coverage:{"sourceCommitId":"341f61ed8f898f338b8c876349e2e7025789094a","coveredCommitId":"341f61ed8f898f338b8c876349e2e7025789094a","kind":"reviewed"} --> The rename is limited to the local distance array and its references, with no identified behavior change. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 5</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly and concisely identifies the main change: renaming the near identifier to avoid a Windows macro conflict. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the identifier rename, the Windows macro clash, and the resulting build failure. | | Docstring Coverage | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1983)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.