diff options
Diffstat (limited to 'source/compiler-core/slang-dxc-compiler.cpp')
| -rw-r--r-- | source/compiler-core/slang-dxc-compiler.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/source/compiler-core/slang-dxc-compiler.cpp b/source/compiler-core/slang-dxc-compiler.cpp index 3a949b3bd..30bf71968 100644 --- a/source/compiler-core/slang-dxc-compiler.cpp +++ b/source/compiler-core/slang-dxc-compiler.cpp @@ -37,26 +37,33 @@ // generate code on Windows. #if SLANG_ENABLE_DXIL_SUPPORT -# ifdef _WIN32 -# include <windows.h> -# include <unknwn.h> -# include "../../external/dxc/dxcapi.h" -# else -# include "../../external/dxc/dxcapi.h" - -# ifdef __uuidof - // DXC's WinAdapter.h defines __uuidof(T) over types, but the existing - // usage in this file is over values (both are accepted on MSVC.) - // We also need to decay through Slang::ComPtr, hence the helper struct - template <typename T> - struct StripSlangComPtr { using type = T; }; - template <typename T> - struct StripSlangComPtr<Slang::ComPtr<T>> { using type = T; }; -# undef __uuidof -# define __uuidof(x) __emulated_uuidof<StripSlangComPtr<std::decay_t<decltype(x)>>::type>() -# endif -# endif - +# ifdef _WIN32 +# include <unknwn.h> +# include <windows.h> +# endif + +# include "../../external/dxc/dxcapi.h" + +# ifndef _WIN32 +# ifdef __uuidof +// DXC's WinAdapter.h defines __uuidof(T) over types, but the existing +// usage in this file is over values (both are accepted on MSVC.) +// We also need to decay through Slang::ComPtr, hence the helper struct +template<typename T> +struct StripSlangComPtr +{ + using type = T; +}; +template<typename T> +struct StripSlangComPtr<Slang::ComPtr<T>> +{ + using type = T; +}; +# undef __uuidof +# define __uuidof(x) \ + __emulated_uuidof<StripSlangComPtr<std::decay_t<decltype(x)>>::type>() +# endif +# endif #endif namespace Slang |
