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.Utils.pas b/lib/delphi/src/Thrift.Utils.pas
index 17131ef..962ef54 100644
--- a/lib/delphi/src/Thrift.Utils.pas
+++ b/lib/delphi/src/Thrift.Utils.pas
@@ -21,8 +21,16 @@
 
 interface
 
+{$IF CompilerVersion >= 23.0}
+  {$LEGACYIFEND ON}
+{$IFEND}
+
 uses
+{$IF CompilerVersion < 23.0}
   Classes, Windows, SysUtils, Character, SyncObjs;
+{$ELSE}
+  System.Classes, Winapi.Windows, System.SysUtils, System.Character, System.SyncObjs;
+{$IFEND}
 
 type
   IOverlappedHelper = interface
@@ -199,7 +207,11 @@
   {$IF RTLVersion  >= 28.0}  // XE7+
   result := c.IsHighSurrogate();
   {$ELSE}
-  result := Character.IsHighSurrogate( c);
+    {$IF CompilerVersion < 23.0}
+      result := Character.IsHighSurrogate( c);
+    {$ELSE}
+      result := c.IsHighSurrogate;
+    {$IFEND}
   {$IFEND}
 end;
 
@@ -209,7 +221,11 @@
   {$IF RTLVersion  >= 28.0}  // XE7+
   result := c.IsLowSurrogate();
   {$ELSE}
-  result := Character.IsLowSurrogate( c);
+    {$IF CompilerVersion < 23.0}
+      result := Character.IsLowSurrogate( c);
+    {$ELSE}
+      result := c.IsLowSurrogate;
+    {$IFEND}
   {$IFEND}
 end;