Browse Source

* patch by Bi0T1N: fix result type of InterlockedCompareExchange64 for QWord, resolves #37186

git-svn-id: trunk@45647 -
florian 5 years ago
parent
commit
bc1b7960ec
2 changed files with 7 additions and 6 deletions
  1. 6 5
      packages/fcl-stl/src/ghashmap.pp
  2. 1 1
      rtl/inc/systemh.inc

+ 6 - 5
packages/fcl-stl/src/ghashmap.pp

@@ -73,15 +73,15 @@
           Key:TKey;
         end;
       var
-      private 
+      private
       type
         TContainer = specialize TVector<TPair>;
         TTable = specialize TVector<TContainer>;
-      var 
+      var
         FData:TTable;
-        FDataSize:SizeUInt; 
+        FDataSize:SizeUInt;
         procedure EnlargeTable;
-      public 
+      public
       type
         TIterator = specialize THashmapIterator<TKey, TValue, TPair, TTable>;
         constructor Create;
@@ -124,7 +124,7 @@ begin
 end;
 
 procedure THashmap.EnlargeTable;
-var i,j,h,oldDataSize:SizeUInt; 
+var i,j,h,oldDataSize:SizeUInt;
     curbucket:TContainer;
     value:TPair;
 begin
@@ -195,6 +195,7 @@ begin
 {$endif}
     inc(i);
   end;
+  // Result:=Default(TValue);
   // exception?
 end;
 

+ 1 - 1
rtl/inc/systemh.inc

@@ -1550,7 +1550,7 @@ function InterlockedIncrement64 (var Target: qword) : qword; external name 'FPC_
 function InterlockedDecrement64 (var Target: qword) : qword; external name 'FPC_INTERLOCKEDDECREMENT64';
 function InterlockedExchange64 (var Target: qword;Source : qword) : qword; external name 'FPC_INTERLOCKEDEXCHANGE64';
 function InterlockedExchangeAdd64 (var Target: qword;Source : qword) : qword; external name 'FPC_INTERLOCKEDEXCHANGEADD64';
-function InterlockedCompareExchange64(var Target: qword; NewValue: qword; Comperand: qword): int64; external name 'FPC_INTERLOCKEDCOMPAREEXCHANGE64';
+function InterlockedCompareExchange64(var Target: qword; NewValue: qword; Comperand: qword): qword; external name 'FPC_INTERLOCKEDCOMPAREEXCHANGE64';
 {$endif cpu64}