THRIFT-4262 Invalid binding to InterlockedCompareExchange64() with 64-bit targets Client: Delphi Patch: Jens Geyer
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index a6567fa..043ff33 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -39,6 +39,7 @@
Thrift.Transport,
Thrift.Stream,
Thrift.Test,
+ Thrift.Utils,
Thrift.Collections,
Thrift.Console;
@@ -88,6 +89,9 @@
{$IFDEF StressTest}
procedure StressTest(const client : TThriftTest.Iface);
{$ENDIF}
+ {$IFDEF Win64}
+ procedure UseInterlockedExchangeAdd64;
+ {$ENDIF}
protected
procedure Execute; override;
public
@@ -1014,6 +1018,18 @@
end;
+{$IFDEF Win64}
+procedure TClientThread.UseInterlockedExchangeAdd64;
+var a,b : Int64;
+begin
+ a := 1;
+ b := 2;
+ Thrift.Utils.InterlockedExchangeAdd64( a,b);
+ Expect( a = 3, 'InterlockedExchangeAdd64');
+end;
+{$ENDIF}
+
+
procedure TClientThread.JSONProtocolReadWriteTest;
// Tests only then read/write procedures of the JSON protocol
// All tests succeed, if we can read what we wrote before
@@ -1249,7 +1265,11 @@
begin
// perform all tests
try
+ {$IFDEF Win64}
+ UseInterlockedExchangeAdd64;
+ {$ENDIF}
JSONProtocolReadWriteTest;
+
for i := 0 to FNumIteration - 1 do
begin
ClientTest;