Browse Source

* Fix interlockedincrement

Michaël Van Canneyt 2 years ago
parent
commit
d07e34297f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/fcl-web/src/jsonrpc/fpjsonrpc.pp

+ 8 - 0
packages/fcl-web/src/jsonrpc/fpjsonrpc.pp

@@ -362,7 +362,11 @@ Type
   TCustomJSONRPCHandlerManager = Class(TComponent)
   TCustomJSONRPCHandlerManager = Class(TComponent)
   Private
   Private
     FRegistering: Boolean;
     FRegistering: Boolean;
+{$IFDEF CPU64}
     FHandlerCount : Int64;
     FHandlerCount : Int64;
+{$ELSE}
+    FHandlerCount : Integer;
+{$ENDIF}
   Protected
   Protected
     procedure Initialize; virtual;
     procedure Initialize; virtual;
     procedure DoClear; virtual;
     procedure DoClear; virtual;
@@ -1827,7 +1831,11 @@ begin
   N:=aContainer.Name;
   N:=aContainer.Name;
   if N='' then
   if N='' then
     N:=aContainer.ClassName;
     N:=aContainer.ClassName;
+{$IFDEF CPU64}
   N:=N+IntToStr(InterlockedIncrement64(FHandlerCount));
   N:=N+IntToStr(InterlockedIncrement64(FHandlerCount));
+{$ELSE}
+  N:=N+IntToStr(InterlockedIncrement(FHandlerCount));
+{$ENDIF}
   aContainer.Name:=N;
   aContainer.Name:=N;
   O.InsertComponent(aContainer);
   O.InsertComponent(aContainer);
 end;
 end;