THRIFT-3788 Compatibility improvements and Win64 support
Client: Delphi
Patch: Nick Homolibere

Tested on XE, XE5, XE8, XE10

This closes #987
diff --git a/lib/delphi/src/Thrift.Stream.pas b/lib/delphi/src/Thrift.Stream.pas
index 74c1782..d78afe6 100644
--- a/lib/delphi/src/Thrift.Stream.pas
+++ b/lib/delphi/src/Thrift.Stream.pas
@@ -19,6 +19,10 @@
 
 unit Thrift.Stream;
 
+{$IF CompilerVersion >= 23.0}
+  {$LEGACYIFEND ON}
+{$IFEND}
+
 interface
 
 uses
@@ -26,8 +30,12 @@
   SysUtils,
   SysConst,
   RTLConsts,
-  Thrift.Utils,
-  ActiveX;
+  {$IF CompilerVersion < 23.0}
+    ActiveX,
+  {$ELSE}
+    Winapi.ActiveX,
+  {$IFEND}
+  Thrift.Utils;
 
 type
 
@@ -140,7 +148,7 @@
 var
   statstg: TStatStg;
   len : Integer;
-  NewPos : {$IF CompilerVersion >= 30.0} UInt64 {$ELSE} Int64  {$IFEND};
+  NewPos : {$IF CompilerVersion >= 29.0} UInt64 {$ELSE} Int64  {$IFEND};
   cbRead : Integer;
 begin
   FillChar( statstg, SizeOf( statstg), 0);