浏览代码

Minor fixes that make the compilers happier. (#1258)

CDxcTMHeapPtr templated with 2 classes does not exist.

A code block has also been moved so that the caller function knows about
the existence of the callee function. Previous code order is not allowed
by some compilers.
Ehsan 7 年之前
父节点
当前提交
d63be91f5c
共有 2 个文件被更改,包括 15 次插入16 次删除
  1. 1 1
      include/dxc/Support/FileIOHelper.h
  2. 14 15
      include/dxc/Support/microcom.h

+ 1 - 1
include/dxc/Support/FileIOHelper.h

@@ -53,7 +53,7 @@ public:
   }
 
   explicit CDxcTMHeapPtr(_In_ T* pData) throw() :
-    CDxcTMHeapPtr<T, CDxcThreadMallocAllocator>(pData)
+    CHeapPtr<T, CDxcThreadMallocAllocator>(pData)
   {
   }
 };

+ 14 - 15
include/dxc/Support/microcom.h

@@ -139,21 +139,6 @@ void DxcCallDestructor(T *obj) {
 /// marshaling. This will help catch marshaling problems early or avoid
 /// them altogether.
 /// </remarks>
-template<typename... Ts, typename TObject>
-HRESULT DoBasicQueryInterface(TObject* self, REFIID iid, void** ppvObject) {
-  if (ppvObject == nullptr) return E_POINTER;
-
-  // Support INoMarshal to void GIT shenanigans.
-  if (IsEqualIID(iid, __uuidof(IUnknown)) ||
-    IsEqualIID(iid, __uuidof(INoMarshal))) {
-    *ppvObject = reinterpret_cast<IUnknown*>(self);
-    reinterpret_cast<IUnknown*>(self)->AddRef();
-    return S_OK;
-  }
-
-  return DoBasicQueryInterface_recurse<TObject, Ts...>(self, iid, ppvObject);
-}
-
 template<typename TObject>
 HRESULT DoBasicQueryInterface_recurse(TObject* self, REFIID iid, void** ppvObject) {
   return E_NOINTERFACE;
@@ -168,6 +153,20 @@ HRESULT DoBasicQueryInterface_recurse(TObject* self, REFIID iid, void** ppvObjec
   }
   return DoBasicQueryInterface_recurse<TObject, Ts...>(self, iid, ppvObject);
 }
+template<typename... Ts, typename TObject>
+HRESULT DoBasicQueryInterface(TObject* self, REFIID iid, void** ppvObject) {
+  if (ppvObject == nullptr) return E_POINTER;
+
+  // Support INoMarshal to void GIT shenanigans.
+  if (IsEqualIID(iid, __uuidof(IUnknown)) ||
+    IsEqualIID(iid, __uuidof(INoMarshal))) {
+    *ppvObject = reinterpret_cast<IUnknown*>(self);
+    reinterpret_cast<IUnknown*>(self)->AddRef();
+    return S_OK;
+  }
+
+  return DoBasicQueryInterface_recurse<TObject, Ts...>(self, iid, ppvObject);
+}
 
 template <typename T>
 HRESULT AssignToOut(T value, _Out_ T* pResult) {