소스 검색

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

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 6 년 전
부모
커밋
add3d7c354
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;