Index: packages/fpc/Jcl.lpk
===================================================================
--- packages/fpc/Jcl.lpk	(revision 3869)
+++ packages/fpc/Jcl.lpk	(working copy)
@@ -1,17 +1,16 @@
 <?xml version="1.0"?>
 <CONFIG>
-  <Package Version="3">
+  <Package Version="4">
     <PathDelim Value="\"/>
     <Name Value="Jcl"/>
-    <AddToProjectUsesSection Value="False"/>
     <Author Value="Project JEDI"/>
     <AutoUpdate Value="OnRebuildingAll"/>
     <CompilerOptions>
-      <Version Value="9"/>
+      <Version Value="11"/>
       <PathDelim Value="\"/>
       <SearchPaths>
-        <IncludeFiles Value="..\..\source\include\"/>
-        <OtherUnitFiles Value=".;..\..\source\common;..\..\source\windows;;..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
+        <IncludeFiles Value="..\..\source\include"/>
+        <OtherUnitFiles Value=".;..\..\source\common;..\..\source\windows;..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
         <UnitOutputDirectory Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
       </SearchPaths>
       <Parsing>
@@ -30,6 +29,7 @@
       </CodeGeneration>
       <Linking>
         <Debugging>
+          <GenerateDebugInfo Value="False"/>
           <UseLineInfoUnit Value="False"/>
         </Debugging>
       </Linking>
@@ -39,7 +39,7 @@
     </CompilerOptions>
     <Description Value="JEDI Code Library RTL package"/>
     <License Value="Copyright (C) 1999, 2012 Project JEDI"/>
-    <Version Major="2" Minor="5" Release="0" Build="4572"/>
+    <Version Major="2" Minor="5" Build="4572"/>
     <Files Count="74">
       <Item1>
         <Filename Value="..\..\source\common\bzip2.pas"/>
@@ -344,10 +344,10 @@
       </Item1>
     </RequiredPkgs>
     <UsageOptions>
-      <IncludePath Value="..\..\source\include\"/>
-      <LibraryPath Value="$(PkgOutDir)\"/>
-      <ObjectPath Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)\"/>
-      <UnitPath Value="$(PkgOutDir)\"/>
+      <IncludePath Value="..\..\source\include"/>
+      <LibraryPath Value="$(PkgOutDir)"/>
+      <ObjectPath Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
+      <UnitPath Value="$(PkgOutDir)"/>
     </UsageOptions>
     <PublishOptions>
       <Version Value="2"/>
Index: packages/fpc/JclContainers.lpk
===================================================================
--- packages/fpc/JclContainers.lpk	(revision 3869)
+++ packages/fpc/JclContainers.lpk	(working copy)
@@ -1,17 +1,16 @@
 <?xml version="1.0"?>
 <CONFIG>
-  <Package Version="3">
+  <Package Version="4">
     <PathDelim Value="\"/>
     <Name Value="JclContainers"/>
-    <AddToProjectUsesSection Value="False"/>
     <Author Value="Project JEDI"/>
     <AutoUpdate Value="OnRebuildingAll"/>
     <CompilerOptions>
-      <Version Value="9"/>
+      <Version Value="11"/>
       <PathDelim Value="\"/>
       <SearchPaths>
-        <IncludeFiles Value="..\..\source\include\"/>
-        <OtherUnitFiles Value=".;..\..\source\common;;..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
+        <IncludeFiles Value="..\..\source\include"/>
+        <OtherUnitFiles Value=".;..\..\source\common;..\..\lib\fpc\$(TargetCPU)-$(TargetOS);..\..\source\windows"/>
         <UnitOutputDirectory Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
       </SearchPaths>
       <Parsing>
@@ -30,6 +29,7 @@
       </CodeGeneration>
       <Linking>
         <Debugging>
+          <GenerateDebugInfo Value="False"/>
           <UseLineInfoUnit Value="False"/>
         </Debugging>
       </Linking>
@@ -39,7 +39,7 @@
     </CompilerOptions>
     <Description Value="JEDI Code Library Containers package"/>
     <License Value="Copyright (C) 1999, 2012 Project JEDI"/>
-    <Version Major="2" Minor="5" Release="0" Build="4572"/>
+    <Version Major="2" Minor="5" Build="4572"/>
     <Files Count="15">
       <Item1>
         <Filename Value="..\..\source\common\JclAbstractContainers.pas"/>
@@ -111,10 +111,10 @@
       </Item2>
     </RequiredPkgs>
     <UsageOptions>
-      <IncludePath Value="..\..\source\include\"/>
-      <LibraryPath Value="$(PkgOutDir)\"/>
-      <ObjectPath Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)\"/>
-      <UnitPath Value="$(PkgOutDir)\"/>
+      <IncludePath Value="..\..\source\include"/>
+      <LibraryPath Value="$(PkgOutDir)"/>
+      <ObjectPath Value="..\..\lib\fpc\$(TargetCPU)-$(TargetOS)"/>
+      <UnitPath Value="$(PkgOutDir)"/>
     </UsageOptions>
     <PublishOptions>
       <Version Value="2"/>
Index: source/common/JclAbstractContainers.pas
===================================================================
--- source/common/JclAbstractContainers.pas	(revision 3869)
+++ source/common/JclAbstractContainers.pas	(working copy)
@@ -1374,12 +1374,12 @@
   else
   begin
     case FEncoding of
-      seISO:
+      JclContainerIntf.seISO:
         if FCaseSensitive then
           Result := AnsiStrSimpleHashConvert(AString)
         else
           Result := AnsiStrSimpleHashConvertI(AString);
-      seUTF8:
+      JclContainerIntf.seUTF8:
         if FCaseSensitive then
           Result := AnsiStrSimpleHashConvertU(AString)
         else
@@ -1397,7 +1397,7 @@
   else
   begin
     case FEncoding of
-      seISO, seUTF8:
+      JclContainerIntf.seISO, JclContainerIntf.seUTF8:
         if FCaseSensitive then
           Result := AnsiStrSimpleCompare(A, B)
         else
@@ -1418,7 +1418,7 @@
   else
   begin
     case FEncoding of
-      seISO, seUTF8:
+      JclContainerIntf.seISO, JclContainerIntf.seUTF8:
         if FCaseSensitive then
           Result := AnsiStrSimpleEqualityCompare(A, B)
         else
Index: source/common/JclAnsiStrings.pas
===================================================================
--- source/common/JclAnsiStrings.pas	(revision 3869)
+++ source/common/JclAnsiStrings.pas	(working copy)
@@ -518,8 +518,8 @@
 
 function ArrayOf(List: TJclAnsiStrings): TDynStringArray; overload;
 
-function AnsiCompareNaturalStr(const S1, S2: AnsiString): SizeInt;
-function AnsiCompareNaturalText(const S1, S2: AnsiString): SizeInt;
+function AnsiCompareNaturalStr(const S1, S2: AnsiString): SizeInt;overload;
+function AnsiCompareNaturalText(const S1, S2: AnsiString): SizeInt;overload;
 
 // internal structures published to make function inlining working
 const
Index: source/common/JclDateTime.pas
===================================================================
--- source/common/JclDateTime.pas	(revision 3869)
+++ source/common/JclDateTime.pas	(working copy)
@@ -87,7 +87,7 @@
 
 { Encode / Decode functions }
 
-function EncodeDate(const Year: Integer; Month, Day: Word): TDateTime;
+function EncodeDate(const Year: Integer; Month, Day: Word): TDateTime;overload;
 procedure DecodeDate(Date: TDateTime; out Year, Month, Day: Word); overload;
 procedure DecodeDate(Date: TDateTime; out Year: Integer; out Month, Day: Word); overload;
 procedure DecodeDate(Date: TDateTime; out Year, Month, Day: Integer); overload;
Index: source/common/JclSimpleXml.pas
===================================================================
--- source/common/JclSimpleXml.pas	(revision 3869)
+++ source/common/JclSimpleXml.pas	(working copy)
@@ -68,8 +68,16 @@
   IniFiles,
   Contnrs,
   {$ENDIF ~HAS_UNITSCOPE}
+  {$IFDEF FPC}
+  fgl,
+  {$ENDIF FPC}
   JclBase, JclStreams;
 
+{$IFDEF FPC}
+Type
+  TFPCStringHash = TFPGMap<String, Integer>;
+{$ENDIF FPC}
+
 type
   TJclSimpleItem = class(TObject)
   private
@@ -83,7 +91,11 @@
 type
   TJclSimpleItemHashedList = class(TObjectList)
   private
+    {$IFNDEF FPC}
     FNameHash: TStringHash;
+    {$ELSE}
+    FNameHash: TFPCStringHash;
+    {$ENDIF }
     FCaseSensitive: Boolean;
     function GetSimpleItemByName(const Name: string): TJclSimpleItem;
     function GetSimpleItem(Index: Integer): TJclSimpleItem;
@@ -1076,21 +1088,43 @@
   begin
     if FNameHash = nil then
     begin
+      {$IFNDEF FPC}
       FNameHash := TStringHash.Create(8);
+      {$ELSE}
+      FNameHash := TFPCStringHash.Create;
+      {$ENDIF}
       for I := 0 to Count - 1 do
         FNameHash.Add(TJclSimpleData(Items[I]).Name, I);
     end;
+    {$IFNDEF FPC}
     Result := FNameHash.ValueOf(Name);
+    {$ELSE}
+    I := FNameHash.IndexOf(Name);
+    Result := I;
+    If I <> -1 Then
+      Result := FNameHash.Data[I];
+    {$ENDIF}
   end
   else
   begin
     if FNameHash = nil then
     begin
+      {$IFNDEF FPC}
       FNameHash := TStringHash.Create(8);
+      {$ELSE}
+      FNameHash := TFPCStringHash.Create;
+      {$ENDIF}
       for I := 0 to Count - 1 do
         FNameHash.Add(UpperCase(TJclSimpleData(Items[I]).Name), I);
     end;
+    {$IFNDEF FPC}
     Result := FNameHash.ValueOf(UpperCase(Name));
+    {$ELSE}
+    I := FNameHash.IndexOf(UpperCase(Name));
+    Result := I;
+    If I <> -1 Then
+      Result := FNameHash.Data[I];
+    {$ENDIF}
   end;
 end;
 
Index: source/common/JclStrings.pas
===================================================================
--- source/common/JclStrings.pas	(revision 3869)
+++ source/common/JclStrings.pas	(working copy)
@@ -603,8 +603,8 @@
 {$ENDIF SUPPORTS_UNICODE_STRING}
 
 // natural comparison functions
-function CompareNaturalStr(const S1, S2: string): SizeInt;
-function CompareNaturalText(const S1, S2: string): SizeInt;
+function CompareNaturalStr(const S1, S2: string): SizeInt;overload;
+function CompareNaturalText(const S1, S2: string): SizeInt;overload;
 
 {$IFNDEF UNICODE_RTL_DATABASE}
 // internal structures published to make function inlining working
Index: source/include/jclfpc.inc
===================================================================
--- source/include/jclfpc.inc	(revision 0)
+++ source/include/jclfpc.inc	(working copy)
@@ -0,0 +1,141 @@
+{**************************************************************************************************}
+{                                                                                                  }
+{ Project JEDI Code Library (JCL)                                                                  }
+{                                                                                                  }
+{ The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); }
+{ you may not use this file except in compliance with the License. You may obtain a copy of the    }
+{ License at http://www.mozilla.org/MPL/                                                           }
+{                                                                                                  }
+{ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF   }
+{ ANY KIND, either express or implied. See the License for the specific language governing rights  }
+{ and limitations under the License.                                                               }
+{                                                                                                  }
+{ The Original Code is jcl.inc                                                                     }
+{                                                                                                  }
+{ The Initial Developer of the Original Code is Marcel van Brakel.                                 }
+{ Portions created by Marcel van Brakel are Copyright (C) Marcel van Brakel.                       }
+{                                                                                                  }
+{ Contributors:                                                                                    }
+{   Marcel van Brakel                                                                              }
+{   Matthias Thoma (mthoma)                                                                        }
+{   Petr Vones                                                                                     }
+{   Robert Marquardt (marquardt)                                                                   }
+{   Robert Rossmair (rrossmair)                                                                    }
+{   Florent Ouchet (outchy)                                                                        }
+{                                                                                                  }
+{**************************************************************************************************}
+{                                                                                                  }
+{ This include file defines various JCL specific defines.                                          }
+{ The more generic JCL defines are defined in jcl.inc and the generic defines in the jedi.inc file }
+{ which is shared with the JEDI VCL.                                                               }
+{                                                                                                  }
+{**************************************************************************************************}
+{                                                                                                  }
+{ This file is filled by the JCL installer, all the changes made in its content will be lost the   }
+{ next time the JCL is installed.                                                                  }
+{                                                                                                  }
+{**************************************************************************************************}
+
+// $Id: jcl.template.inc 3855 2012-09-02 22:25:26Z outchy $
+
+// Math precision selection, mutually exclusive
+// FPC does not support EXTENDED when targetting x86_64, MATH_DOUBLE_PRECISION is the default in this situation
+{.$DEFINE MATH_EXTENDED_PRECISION} // default
+{.$DEFINE MATH_DOUBLE_PRECISION}
+{.$DEFINE MATH_SINGLE_PRECISION}
+
+
+// Math functions takes care of infinites and NaN
+{.$DEFINE MATH_EXT_EXTREMEVALUES}
+
+
+// JclHookExcept support for hooking exceptions from DLLs
+{.$DEFINE HOOK_DLL_EXCEPTIONS}
+
+
+//Threadsafe directive
+{.$DEFINE THREADSAFE}
+
+
+// To exclude obsolete code from compilation, remove the point from the line below
+{.$DEFINE DROP_OBSOLETE_CODE}
+
+
+//Support for JclUnitVersioning.pas, not supported by Delphi 2005 (automatically disabled afterward)
+{.$DEFINE UNITVERSIONING}
+
+
+// debug sources
+// defining these symbols will the debug source to be automatically registered
+{.$DEFINE DEBUG_NO_BINARY}
+{.$DEFINE DEBUG_NO_TD32}     // automatically defined for FPC
+{.$DEFINE DEBUG_NO_MAP}
+{.$DEFINE DEBUG_NO_EXPORTS}
+{.$DEFINE DEBUG_NO_SYMBOLS}
+
+
+// PCRE options, mutually exclusive
+// IMPORTANT: The static link works only for Delphi 2005 and newer
+//            (an internal error is raised on other compilers)
+// Only one of the following defines can be defined at a time
+//   static link: PCRE_STATICLINK
+//   static dll import: PCRE_LINKDLL
+//   dynamic dll import: PCRE_LINKONREQUEST
+//   RTL's RegularExpressionsAPI: PCRE_RTL
+
+{.$DEFINE PCRE_STATICLINK}
+{.$DEFINE PCRE_LINKDLL}
+{.$DEFINE PCRE_LINKONREQUEST} // default
+{.$DEFINE PCRE_RTL} // DXE and newer
+
+// ANSI/UTF8 PCRE
+{$DEFINE PCRE_8}
+// UCS2/UTF16 enabled PCRE
+{$DEFINE PCRE_16} // only valid when PCRE_STATICLINK is enabled, the RTL does not support it and the DLL found over the internet are completly outdated.
+
+// use PCRE16 when available rather than good old PCRE8
+{$DEFINE PCRE_PREFER_16}
+
+// BZIP2 options, mutually exclusive
+
+{.$DEFINE BZIP2_STATICLINK} // default
+{.$DEFINE BZIP2_LINKDLL}
+{$DEFINE BZIP2_LINKONREQUEST}
+
+
+// ZLIB options, mutually exclusive
+
+{.$DEFINE ZLIB_STATICLINK} // default
+{.$DEFINE ZLIB_LINKDLL}
+{$DEFINE ZLIB_LINKONREQUEST}
+{.$DEFINE ZLIB_RTL} // DXE2 and newer only
+
+
+// Unicode options
+// use RTL Character Database rather than JCL one, less accurate but reduce executable size
+{.$DEFINE UNICODE_RTL_DATABASE}
+
+// insert a replacement character if sequence is corrupted rather than raising an exception
+{.$DEFINE UNICODE_SILENT_FAILURE}
+
+// defines resource compression (uncompressed, compressed with ZLib, compressed with BZip2), mutually exclusive
+{.$DEFINE UNICODE_RAW_DATA} // default
+{.$DEFINE UNICODE_ZLIB_DATA}
+{.$DEFINE UNICODE_BZIP2_DATA}
+
+
+// container options
+// define mapping of TJclStr* containers to TJclAnsiStr* or TJclWideStr* (mutually exclusive)
+{.$DEFINE CONTAINER_ANSISTR} // default for D2007 and older
+{.$DEFINE CONTAINER_WIDESTR}
+{.$DEFINE CONTAINER_UNICODESTR} // default for D2009 and newer, not supported for Delphi 2007 and older
+{.$DEFINE CONTAINER_NOSTR}
+
+
+// 7Zip options, mutually exclusive
+// IMPORTANT: The static link is not supported yet
+
+{.$DEFINE 7ZIP_STATICLINK} // not supported yet
+{.$DEFINE 7ZIP_LINKDLL}
+{.$DEFINE 7ZIP_LINKONREQUEST} // default
+
Index: source/windows/JclRegistry.pas
===================================================================
--- source/windows/JclRegistry.pas	(revision 3869)
+++ source/windows/JclRegistry.pas	(working copy)
@@ -62,7 +62,7 @@
   JclBase, JclStrings;
 
 type
-  DelphiHKEY = {$IFDEF CPUX64}type Winapi.Windows.HKEY{$ELSE}Longword{$ENDIF CPUX64};
+  DelphiHKEY = {$IFDEF CPUX64}type {$IFDEF BORLAND}Winapi.{$ENDIF BORLAND}Windows.HKEY{$ELSE}Longword{$ENDIF CPUX64};
   {$HPPEMIT '// BCB users must typecast the HKEY values to DelphiHKEY or use the HK-values below.'}
 
   TExecKind = (ekMachineRun, ekMachineRunOnce, ekUserRun, ekUserRunOnce,
