Skip to content

Add UUID compiler extension check on Clang#7286

Merged
llvm-beanz merged 1 commit intomicrosoft:mainfrom
urshanselmann:clang-ms-extensions-fix
Apr 3, 2025
Merged

Add UUID compiler extension check on Clang#7286
llvm-beanz merged 1 commit intomicrosoft:mainfrom
urshanselmann:clang-ms-extensions-fix

Conversation

@urshanselmann
Copy link
Copy Markdown
Contributor

@urshanselmann urshanselmann commented Apr 1, 2025

Fixes #7248

Fix Clang Compilation on Linux without Microsoft extensions enabled.

Rationale

Clang support depends on the -fms-extensions compiler flag. [1]
If enabled, the _MSC_EXTENSIONS macro is defined. [2]

Fixes microsoft#7248

Fix Clang Compilation on Linux without Microsoft Extensions enabled.

## Rationale
Clang support depends on the `-fms-extensions` compiler flag. ([1](https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions))
If enabled, the `_MSC_EXTENSIONS` macro is defined. ([2](https://github.com/llvm/llvm-project/blob/19a319667b567a26a20f9829a0ae7e6a5c259cba/clang/lib/Basic/Targets/OSTargets.cpp#L248)

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/DirectXShaderCompiler/issues/7248?shareId=XXXX-XXXX-XXXX-XXXX).
@urshanselmann urshanselmann marked this pull request as ready for review April 1, 2025 13:46
@urshanselmann urshanselmann requested a review from a team as a code owner April 1, 2025 13:46
Copy link
Copy Markdown
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

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

This change LGTM, and should allow clients of DXC to use Clang without the MS extensions enabled.

@llvm-beanz llvm-beanz merged commit 9010244 into microsoft:main Apr 3, 2025
18 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

WinAdapter.h is not compilable under Clang on Linux

3 participants