summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-dxc-compiler.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 13:59:28 +0800
committerGitHub <noreply@github.com>2024-10-29 13:59:28 +0800
commita729c15e9dce9f5116a38afc66329ab2ca4cea54 (patch)
tree9580072eb0d796b51c04ad5be95230a747709150 /source/compiler-core/slang-dxc-compiler.cpp
parenta15d770242f88aa4b33cd7d3a97de9c8d86a2315 (diff)
preparation for clang format (#5422)
* Clang-format excludes * Add .clang-format * Don't clang-format in external * Missing includes and forward declarations * Replace wonky include-once macro name * neaten include naming * Add clang-format to formatting script * Add xargs and diff to required binaries * add clang-format to ci formatting check * Add max version check to formatting script * temporarily disable checking formatting for cpp files
Diffstat (limited to 'source/compiler-core/slang-dxc-compiler.cpp')
-rw-r--r--source/compiler-core/slang-dxc-compiler.cpp47
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