Skip to content

Commit 9010244

Browse files
Add UUID compiler extension check on Clang (microsoft#7286)
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)
1 parent 6556410 commit 9010244

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)