Skip to content

Commit 6e9f33b

Browse files
committed
Add UUID compiler extension check on Clang
Fixes #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).
1 parent 206b775 commit 6e9f33b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/dxc/WinAdapter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
#define _countof(a) (sizeof(a) / sizeof(*(a)))
5252

5353
// If it is GCC, there is no UUID support and we must emulate it.
54-
#ifndef __clang__
54+
// Clang support depends on the -fms-extensions compiler flag.
55+
#if !defined(__clang__) || !defined(_MSC_EXTENSIONS)
5556
#define __EMULATE_UUID 1
5657
#endif // __clang__
5758

0 commit comments

Comments
 (0)