浏览代码

Merge pull request #11630 from ghalliday/issue20429

HPCC-20429 Work around windows build problem (template expansion bug)

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 年之前
父节点
当前提交
88414d87d9
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 2 2
      thorlcr/msort/tsorta.cpp
  2. 10 2
      thorlcr/msort/tsorta.hpp

+ 2 - 2
thorlcr/msort/tsorta.cpp

@@ -514,8 +514,8 @@ void CThorKeyArray::split()
     unsigned n = ordinality();
     CThorExpandingRowArray newkeys(activity, rowif);
     newkeys.resize(n);
-    OwnedPtr<UnsignedArray> newSizes;
-    OwnedPtr<Int64Array> newFilePos;
+    OwnedUnsignedArray newSizes;
+    OwnedInt64Array newFilePos;
     if (sizes)
     {
         newSizes.setown(new UnsignedArray);

+ 10 - 2
thorlcr/msort/tsorta.hpp

@@ -61,6 +61,14 @@ interface IThorRowSortedLoader: extends IInterface
     virtual unsigned overflowScale()=0;
 };
 
+using OwnedUnsignedArray = OwnedPtr<UnsignedArray>;
+#ifdef _WIN32
+//Work around a strange windows compiler bug - the second use of OwnedPtr fails.
+using OwnedInt64Array = OwnedPtrCustomFree<Int64Array, ownedPtrDoDelete<Int64Array>>;
+#else
+using OwnedInt64Array = OwnedPtr<Int64Array>;
+#endif
+
 class THORSORT_API CThorKeyArray
 {
     CActivityBase &activity;
@@ -75,8 +83,8 @@ class THORSORT_API CThorKeyArray
     ICompare *icompare;
     ICompare *ikeycompare;
     ICompare *irowkeycompare;
-    OwnedPtr<UnsignedArray> sizes;       // serial sizes (needed if keysize==0)
-    OwnedPtr<Int64Array> filepos;
+    OwnedInt64Array filepos;
+    OwnedUnsignedArray sizes;       // serial sizes (needed if keysize==0)
     size32_t filerecsize;
     size32_t filerecnum;
     offset_t totalfilesize;