Index: source/common/JclAlgorithms.pas
===================================================================
--- source/common/JclAlgorithms.pas	(revision 3478)
+++ source/common/JclAlgorithms.pas	(working copy)
@@ -828,7 +828,7 @@
 // case-sensitive and UTF8-encoded
 function AnsiStrSimpleHashConvertU(const AString: AnsiString): Integer;
 var
-  I: Integer;
+  I: SizeInt;
   C, IntegerHash: TIntegerHash;
 begin
   IntegerHash.H1 := 0;
@@ -852,7 +852,7 @@
 // case-insensitive and UTF8-encoded
 function AnsiStrSimpleHashConvertUI(const AString: AnsiString): Integer;
 var
-  I, J: Integer;
+  I, J: SizeInt;
   C, IntegerHash: TIntegerHash;
   CA: TUCS4Array;
 begin
@@ -883,7 +883,7 @@
 // default is case-sensitive
 function WideStrSimpleHashConvert(const AString: WideString): Integer;
 var
-  I: Integer;
+  I: SizeInt;
   C, IntegerHash: TIntegerHash;
 begin
   IntegerHash.H1 := 0;
@@ -907,7 +907,7 @@
 // case-insensitive
 function WideStrSimpleHashConvertI(const AString: WideString): Integer;
 var
-  I, J: Integer;
+  I, J: SizeInt;
   C, IntegerHash: TIntegerHash;
   CA: TUCS4Array;
 begin
Index: source/common/JclBase.pas
===================================================================
--- source/common/JclBase.pas	(revision 3478)
+++ source/common/JclBase.pas	(working copy)
@@ -321,6 +321,12 @@
 function Addr64ToAddr32(const Value: TJclAddr64): TJclAddr32;
 function Addr32ToAddr64(const Value: TJclAddr32): TJclAddr64;
 
+{$IFDEF FPC}
+Type
+  HWND = type Windows.HWND;
+  HMODULE = type Windows.HMODULE;
+{$ENDIF}
+
 {$IFDEF SUPPORTS_GENERICS}
 //DOM-IGNORE-BEGIN
 
Index: source/common/JclCompression.pas
===================================================================
--- source/common/JclCompression.pas	(revision 3478)
+++ source/common/JclCompression.pas	(working copy)
@@ -726,7 +726,7 @@
   TJclStreamAccess = (saCreate, saReadOnly, saReadOnlyDenyNone, saWriteOnly, saReadWrite);
 
   { TJclCompressionArchive is not ref-counted }
-  TJclCompressionArchive = class(TObject, IInterface)
+  TJclCompressionArchive = class(TInterfacedObject, IInterface)
   private
     FOnProgress: TJclCompressionProgressEvent;
     FOnVolume: TJclCompressionVolumeEvent;
Index: source/common/JclSysInfo.pas
===================================================================
--- source/common/JclSysInfo.pas	(revision 3478)
+++ source/common/JclSysInfo.pas	(working copy)
@@ -4285,17 +4285,17 @@
       SETNZ   Result
       {$ENDIF CPU32}
       {$IFDEF CPU64}
-      // PUSHFQ
-      PUSHFD
+      PUSHFQ
+      //PUSHFD
       POP     RAX
       MOV     RCX, RAX
       XOR     RAX, ID_FLAG
       AND     RCX, ID_FLAG
       PUSH    RAX
-      // POPFQ
-      POPFD
-      // PUSHFQ
-      PUSHFD
+      POPFQ
+      //POPFD
+      PUSHFQ
+      //PUSHFD
       POP     RAX
       AND     RAX, ID_FLAG
       XOR     RAX, RCX
Index: source/common/JclUnicode.pas
===================================================================
--- source/common/JclUnicode.pas	(revision 3478)
+++ source/common/JclUnicode.pas	(working copy)
@@ -2742,7 +2742,7 @@
 // Looks for all occurences of the pattern passed to FindPrepare and creates an
 // internal list of their positions.
 var
-  Start, Stop: SizeInt;
+  Start, Stop, CharCount: SizeInt;
   Run: PWideChar;
   RunLen: SizeInt;
 begin
@@ -2755,7 +2755,8 @@
   while Find(Run, RunLen, Start, Stop) do
   begin
     // store this result (consider text pointer movement)...
-    AddResult(Start + Run - Text, Stop + Run - Text);
+    CharCount := (TJclAddr(Run) - TJclAddr(Text)) div SizeOf(WideChar);
+    AddResult(Start + CharCount, Stop + CharCount);
     // ... and advance text position and length
     Inc(Run, Stop);
     Dec(RunLen, Stop);
@@ -4713,7 +4714,7 @@
 // Looks for all occurences of the pattern passed to FindPrepare and creates an
 // internal list of their positions.
 var
-  Start, Stop: SizeInt;
+  Start, Stop, CharCount: SizeInt;
   Run: PWideChar;
   RunLen: SizeInt;
 begin
@@ -4726,7 +4727,8 @@
   while ExecuteURE(0, Run, RunLen, Start, Stop) do
   begin
     // store this result (consider text pointer movement)...
-    AddResult(Start + Run - Text, Stop + Run - Text);
+    CharCount := (TJclAddr(Run) - TJclAddr(Text)) div SizeOf(WideChar);
+    AddResult(Start + CharCount, Stop + CharCount);
     // ... and advance text position and length
     Inc(Run, Stop);
     Dec(RunLen, Stop);
Index: source/windows/JclHookExcept.pas
===================================================================
--- source/windows/JclHookExcept.pas	(revision 3478)
+++ source/windows/JclHookExcept.pas	(working copy)
@@ -43,7 +43,7 @@
   {$IFDEF UNITVERSIONING}
   JclUnitVersioning,
   {$ENDIF UNITVERSIONING}
-  Windows, SysUtils, Classes;
+  Windows, SysUtils, Classes, JclBase;
 
 type
   // Exception hooking notifiers routines
@@ -96,7 +96,6 @@
 implementation
 
 uses
-  JclBase,
   JclPeImage,
   JclSysInfo, JclSysUtils;
 
