Переглянути джерело

--- Merging r17142 into '.':
U rtl/morphos/Makefile.fpc
--- Merging r17143 into '.':
C rtl/morphos/Makefile
--- Merging r17145 into '.':
U rtl/objpas/fmtbcd.pp
--- Merging r17146 into '.':
G rtl/morphos/Makefile.fpc
G rtl/morphos/Makefile
--- Merging r17221 into '.':
U rtl/unix/sysutils.pp
--- Merging r17224 into '.':
G rtl/unix/sysutils.pp
--- Merging r17225 into '.':
U rtl/objpas/sysutils/dati.inc
--- Merging r17228 into '.':
U packages/cdrom/src/cdromlin.inc
U packages/cdrom/src/lincd.pp
--- Merging r17229 into '.':
U rtl/inc/system.fpd
--- Merging r17258 into '.':
U rtl/win/wininc/func.inc
U rtl/win/wininc/redef.inc
--- Merging r17266 into '.':
U packages/winunits-base/src/uxtheme.pp
Summary of conflicts:
Text conflicts: 1

# revisions: 17142,17143,17145,17146,17198,17221,17224,17225,17228,17229,17258,17266
------------------------------------------------------------------------
r17142 | karoly | 2011-03-17 09:10:30 +0100 (Thu, 17 Mar 2011) | 2 lines
Changed paths:
M /trunk/rtl/morphos/Makefile.fpc

+ compile mouse before keyboard, as keyboard depends on it (MorphOS)

------------------------------------------------------------------------
------------------------------------------------------------------------
r17143 | karoly | 2011-03-17 17:11:10 +0100 (Thu, 17 Mar 2011) | 2 lines
Changed paths:
M /trunk/rtl/morphos/Makefile

+ regenerated Makefile

------------------------------------------------------------------------
------------------------------------------------------------------------
r17145 | marco | 2011-03-19 14:04:00 +0100 (Sat, 19 Mar 2011) | 2 lines
Changed paths:
M /trunk/rtl/objpas/fmtbcd.pp

* Patch from LacaK2, implementing an initial BCDToStrF

------------------------------------------------------------------------
------------------------------------------------------------------------
r17146 | karoly | 2011-03-19 15:43:58 +0100 (Sat, 19 Mar 2011) | 2 lines
Changed paths:
M /trunk/rtl/morphos/Makefile
M /trunk/rtl/morphos/Makefile.fpc

+ compile some units in correct order of dependence

------------------------------------------------------------------------
------------------------------------------------------------------------
r17198 | paul | 2011-03-28 08:28:25 +0200 (Mon, 28 Mar 2011) | 1 line
Changed paths:
M /trunk/rtl/win/wininc/messages.inc

rtl: add missing TWMWindowPosChanged, TWMWindowPosChanging from messages interface
------------------------------------------------------------------------
------------------------------------------------------------------------
r17221 | michael | 2011-04-02 12:43:39 +0200 (Sat, 02 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/unix/sysutils.pp

* Do not allow fileage for directories (15873)
------------------------------------------------------------------------
------------------------------------------------------------------------
r17224 | michael | 2011-04-02 17:28:24 +0200 (Sat, 02 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/unix/sysutils.pp

* Corrected fix for FileAge
------------------------------------------------------------------------
------------------------------------------------------------------------
r17225 | michael | 2011-04-02 17:41:39 +0200 (Sat, 02 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/objpas/sysutils/dati.inc

* Fixed 18183
------------------------------------------------------------------------
------------------------------------------------------------------------
r17228 | michael | 2011-04-02 17:58:21 +0200 (Sat, 02 Apr 2011) | 1 line
Changed paths:
M /trunk/packages/cdrom/src/cdromlin.inc
M /trunk/packages/cdrom/src/lincd.pp

* Patch GetCDRomDevices so all CD roms are used, by Andrew H (18314)
------------------------------------------------------------------------
------------------------------------------------------------------------
r17229 | michael | 2011-04-02 18:11:37 +0200 (Sat, 02 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/inc/system.fpd

* Added mem,memw, meml for documentation purposes
------------------------------------------------------------------------
------------------------------------------------------------------------
r17258 | sergei | 2011-04-06 05:33:45 +0200 (Wed, 06 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/win/wininc/func.inc
M /trunk/rtl/win/wininc/redef.inc

* CreateIoCompletionPort and GetCompletionPortStarus: changed type of 'completionKey' parameter to ULONG_PTR, patch from cobines, resolves #19104.
------------------------------------------------------------------------
------------------------------------------------------------------------
r17266 | paul | 2011-04-07 08:27:16 +0200 (Thu, 07 Apr 2011) | 1 line
Changed paths:
M /trunk/packages/winunits-base/src/uxtheme.pp

winunits-base: correct GetThemeFont, GetThemeSystemFont font argument must be LogFontW instead of LogFont
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17584 -

marco 14 роки тому
батько
коміт
e3fbde85cd

+ 45 - 10
packages/cdrom/src/cdromlin.inc

@@ -117,20 +117,55 @@ end;
 
 Function GetCDRomDevices(Var Devices : Array of string) : Integer;
 
-Var
-  S : String;
 
-begin
-  Result:=TestFSTab(Devices);
-  If (Result<1) then
+  Function AlreadyAdded(AName: String; AMax: Integer): Boolean;
+  var
+    I: Integer;
+  begin
+    Result := False;
+    for I := 0 to AMax do
+      if Devices[I] = AName then
+        Exit(True);
+  end;
+
+  // Resolves name if it's a symlink and adds it ensuring no dups
+  Function AddCdrom(ACDRom: String; I: Integer): Integer;
+  var
+    SInfo : stat;
+    RealName: String;
+  begin
+    Result := I;
+    if fpStat(PChar(ACDRom), SInfo) <> -1 then
     begin
-    S:=DetectCD;
-    If (S<>'') then
+      RealName := ACDRom;
+      if SInfo.st_mode and S_IFMT = S_IFLNK then
+        RealName := fpReadLink(ACDRom);
+
+      if not AlreadyAdded(RealName, I-1) then
       begin
-      Devices[0]:=S;
-      Result:=1;
+        Devices[I] := RealName;
+        Result := I+1;
       end;
-    end
+    end;
+  end;
+
+var
+  I,J: Integer;
+  CDRec: TCDSearchRec;
+  FSTab: array[0..10] of String;
+
+begin
+  I := 0;
+  // First Add Entries From FSTab
+  for J := 0 to TestFSTab(FSTab)-1 do
+    I := AddCdrom(FSTab[J], I);
+
+  //Now Do A Search
+  if FindFirstCD(CDRec) then
+  repeat
+    I := AddCdrom(CDRec.Name, I);
+  until FindNextCD(CDRec) = False;
+  Result := I;
 end;
 
 

+ 64 - 0
packages/cdrom/src/lincd.pp

@@ -708,8 +708,15 @@ procedure set_sense_key(var a : Trequest_sense; __sense_key : Tu8);
 { ---------------------------------------------------------------------
     Utility functions
   ---------------------------------------------------------------------}
+type
+  TCDSearchRec = record
+    Name: String;
+    i,j: Integer;
+  end;
 
 Function IsCDDevice(Device : String) : Boolean;
+Function FindFirstCD(var ACDSearchRec: TCDSearchRec): Boolean;
+Function FindNextCD(var ACDSearchRec: TCDSearchRec): Boolean;
 Function DetectCd : String;
 
 implementation
@@ -1098,6 +1105,61 @@ Const
   '/dev/sr?',
   '/dev/optcd');
 
+function FindFirstCD(var ACDSearchRec: TCDSearchRec): Boolean;
+begin
+  Result := False;
+  With ACDSearchRec do
+  begin
+    I := 1;
+    J := 0;
+    Name := '';
+  end;
+  Result := FindNextCD(ACDSearchRec);
+end;
+
+function FindNextCD(var ACDSearchRec: TCDSearchRec): Boolean;
+var
+  L: integer;
+  S: String;
+  FoundDev: String;
+begin
+
+  Result := False;
+  FoundDev := '';
+  with ACDSearchRec do
+  begin
+    While (FoundDev='') and (I<NrDevices) do
+    begin
+      S:=Devices[i];
+      L:=Length(S);
+      If S[l]='?' then
+      begin
+        S:=Copy(S,1,L-1);
+        if j >= 3 then
+          j := 0;
+        while (j <= 3) and (Length(FoundDev)=0) do
+        begin
+          If IsCdDevice(S+Chr(Ord('0')+J)) then
+            FoundDev:=S+Chr(Ord('0')+J)
+          else If IsCdDevice(S+Chr(Ord('a')+J)) then
+            FoundDev:=S+Chr(Ord('a')+J);
+          Inc(j);
+        end;
+        if J >= 3 then
+          Inc(i);
+      end
+      else
+      begin
+        If IsCdDevice(S) then
+          FoundDev:=S;
+        Inc(i);
+      end;
+    end;
+  end;
+  Result := Length(FoundDev) > 0;
+  ACDSearchRec.Name:=FoundDev;
+end;
+
 Function DetectCD : String;
 
 Var
@@ -1163,7 +1225,9 @@ begin
   If fpStat(Device,info)<>0 then
     exit;
   DeviceMajor:=info.st_rdev shr 8;
+  {$ifdef debug}
   Writeln('Device major : ',DeviceMajor);
+  {$endif}
   If DeviceMajor in [IDE0_MAJOR,IDE1_MAJOR,IDE2_MAJOR,IDE3_MAJOR] then
     Result:=TestCDRomIOCTL(Device)
   else 

+ 2 - 2
packages/winunits-base/src/uxtheme.pp

@@ -782,7 +782,7 @@ var
 
 var
   GetThemeFont: function(hTheme: HTHEME; hdc: HDC; iPartId, iStateId, iPropId: Integer;
-    var pFont: LOGFONT): HRESULT; stdcall;
+    var pFont: LOGFONTW): HRESULT; stdcall;
 {$EXTERNALSYM GetThemeFont}
 
 //----------------------------------------------------------------------------------------------------------------------
@@ -1039,7 +1039,7 @@ var
 //----------------------------------------------------------------------------------------------------------------------
 
 var
-  GetThemeSysFont: function(hTheme: HTHEME; iFontId: Integer; var plf: LOGFONT): HRESULT; stdcall;
+  GetThemeSysFont: function(hTheme: HTHEME; iFontId: Integer; var plf: LOGFONTW): HRESULT; stdcall;
 {$EXTERNALSYM GetThemeSysFont}
 
 //----------------------------------------------------------------------------------------------------------------------

+ 6 - 0
rtl/inc/system.fpd

@@ -62,3 +62,9 @@ Procedure ReadStr(Const S : String; Args : Arguments);
 Procedure Pack(Const A : UnpackedArrayType; StartIndex : TIndexType; Out Z : PackedArrayType);
 Procedure UnPack(Const Z : PackedArrayType; Out A : UnpackedArrayType; StartIndex : TIndexType);
 
+{$IFNDEF GO32V2}
+Var
+  mem  : array[0..$7fffffff-1] of byte;
+  memw : array[0..($7fffffff div sizeof(word))-1] of word;
+  meml : array[0..($7fffffff div sizeof(longint))-1] of longint;
+{$ENDIF}

+ 62 - 62
rtl/morphos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/02/22]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/05/18]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
@@ -280,184 +280,184 @@ endif
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video mouse keyboard sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0
@@ -2508,7 +2508,7 @@ sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
 classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
-		   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) types$(PPUEXT) fgl$(PPUEXT)
+		   sysutils$(PPUEXT) rtlconsts$(PPUEXT) typinfo$(PPUEXT) types$(PPUEXT) fgl$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
 fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/fgl.pp

+ 2 - 2
rtl/morphos/Makefile.fpc

@@ -15,7 +15,7 @@ units=$(SYSTEMUNIT) objpas macpas strings \
       exec timer doslib utility hardware inputevent keymap graphics layers \
       intuition aboxlib mui \
 # these units are here, because they depend on system interface units above
-      kvm video keyboard mouse sockets \
+      kvm video mouse keyboard sockets \
 # these can be moved to packages later
       clipboard datatypes asl ahi tinygl get9 muihelper
 #implicitunits=exeinfo
@@ -127,7 +127,7 @@ sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
         $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
 
 classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
-                   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) types$(PPUEXT) fgl$(PPUEXT)
+                   sysutils$(PPUEXT) rtlconsts$(PPUEXT) typinfo$(PPUEXT) types$(PPUEXT) fgl$(PPUEXT)
         $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
 
 fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)

+ 145 - 10
rtl/objpas/fmtbcd.pp

@@ -142,7 +142,6 @@ INTERFACE
 
   USES
     SysUtils,
-{    dateutils,}
     Variants;
 
   const
@@ -2426,26 +2425,23 @@ writeln ( '> ', i4, ' ', bh.Singles[i4], ' ', Add );
 { TBCD variant creation utils }
   procedure VarFmtBCDCreate (   var aDest : Variant;
                               const aBCD : tBCD );
-
     begin
       VarClear(aDest);
       TVarData(aDest).Vtype:=FMTBcdFactory.Vartype;
       TVarData(aDest).VPointer:=TFMTBcdVarData.create(aBCD);
-     end;
+    end;
 
   function VarFmtBCDCreate : Variant;
-
     begin
       VarFmtBCDCreate ( result, NullBCD );
-     end;
+    end;
 
   function VarFmtBCDCreate ( const aValue : FmtBCDStringtype;
                                    Precision,
                                    Scale : Word ) : Variant;
-
     begin
       VarFmtBCDCreate ( result, StrToBCD ( aValue ) );
-     end;
+    end;
 
 {$ifndef FPUNONE}
   function VarFmtBCDCreate ( const aValue : myRealtype;
@@ -2471,7 +2467,6 @@ writeln ( '> ', i4, ' ', bh.Singles[i4], ' ', Add );
 
 
   function VarFmtBCD : TVartype;
-
     begin
       Result:=FMTBcdFactory.VarType;
     end;
@@ -2482,9 +2477,149 @@ writeln ( '> ', i4, ' ', bh.Singles[i4], ' ', Add );
                              Format : TFloatFormat;
                        const Precision,
                              Digits : Integer ) : FmtBCDStringtype;
+    var P, E: integer;
+        Negative: boolean;
+        DS, TS: char;
+
+    procedure RoundDecimalDigits(const D: integer);
+    var i,j: integer;
     begin
-      not_implemented;
-      result:='';
+      j:=P+D;
+      if (Length(Result) > j) and (Result[j+1] >= '5') then
+        for i:=j downto 1+ord(Negative) do
+        begin
+          if Result[i] = '9' then
+          begin
+            Result[i] := '0';
+            if i = 1+ord(Negative) then
+            begin
+              Insert('1', Result, i);
+              inc(P);
+              inc(j);
+            end;
+          end
+          else if Result[i] <> DS then
+          begin
+            inc(Result[i]);
+            break;
+          end;
+        end;
+      Result := copy(Result, 1, j);
+    end;
+
+    procedure AddDecimalDigits;
+    var n,d: integer;
+    begin
+      if Digits < 0 then d := 2 else d := Digits;
+
+      n := d + P - Length(Result);
+
+       if n > 0 then
+         Result := Result + StringOfChar('0', n)
+       else if n < 0 then
+         RoundDecimalDigits(d);
+    end;
+
+    procedure AddThousandSeparators;
+    begin
+      Dec(P, 3);
+      While (P > 1) Do
+      Begin
+        If (Result[P - 1] <> '-') And (TS <> #0) Then
+          Insert(TS, Result, P);
+        Dec(P, 3);
+      End;
+    end;
+
+    begin
+      Result := BCDToStr(BCD);
+      if Format = ffGeneral then Exit;
+
+      SetDecimals(DS, TS);
+
+      Negative := Result[1] = '-';
+      P := Pos(DS, Result);
+      if P = 0 then
+      begin
+        P := Length(Result) + 1;
+        if Digits <> 0 then
+          Result := Result + DS;
+      end;
+
+      Case Format Of
+        ffExponent:
+        Begin
+          E := P - 2 - ord(Negative);
+
+          if (E = 0) and (Result[P-1] = '0') then
+            repeat
+              dec(E);
+            until (Length(Result) <= P-E) or (Result[P-E] <> '0');
+
+          if E <> 0 then
+          begin
+            System.Delete(Result, P, 1);
+            dec(P, E);
+            Insert(DS, Result, P);
+          end;
+
+          RoundDecimalDigits(Precision-1);
+
+          if E < 0 then
+          begin
+            System.Delete(Result, P+E-1, -E);
+            Result := Result + SysUtils.Format('E%.*d' , [Digits,E])
+          end
+          else
+            Result := Result + SysUtils.Format('E+%.*d', [Digits,E]);
+        End;
+
+        ffFixed:
+        Begin
+          AddDecimalDigits;
+        End;
+
+        ffNumber:
+        Begin
+          AddDecimalDigits;
+          AddThousandSeparators;
+        End;
+
+        ffCurrency:
+        Begin
+          //implementation based on FloatToStrFIntl()
+          if Negative then System.Delete(Result, 1, 1);
+
+          AddDecimalDigits;
+          AddThousandSeparators;
+
+          If Not Negative Then
+          Begin
+            Case CurrencyFormat Of
+              0: Result := CurrencyString + Result;
+              1: Result := Result + CurrencyString;
+              2: Result := CurrencyString + ' ' + Result;
+              3: Result := Result + ' ' + CurrencyString;
+            End
+          End
+          Else
+          Begin
+            Case NegCurrFormat Of
+              0: Result := '(' + CurrencyString + Result + ')';
+              1: Result := '-' + CurrencyString + Result;
+              2: Result := CurrencyString + '-' + Result;
+              3: Result := CurrencyString + Result + '-';
+              4: Result := '(' + Result + CurrencyString + ')';
+              5: Result := '-' + Result + CurrencyString;
+              6: Result := Result + '-' + CurrencyString;
+              7: Result := Result + CurrencyString + '-';
+              8: Result := '-' + Result + ' ' + CurrencyString;
+              9: Result := '-' + CurrencyString + ' ' + Result;
+              10: Result := CurrencyString + ' ' + Result + '-';
+            End;
+          End;
+        End;
+      End;
     end;
 
 

+ 6 - 7
rtl/objpas/sysutils/dati.inc

@@ -358,7 +358,7 @@ var
    c:word;
    dp,mp,yp,which : Byte;
    s1:string[4];
-   values:array[1..3] of longint;
+   values:array[0..3] of longint;
    LocalTime:tsystemtime;
    YearMoreThenTwoDigits : boolean;
 begin
@@ -402,12 +402,6 @@ begin
           end;
      end;
    end;
-  if Which<>3 then
-    begin
-      FixErrorMsg(SErrIllegalDateFormatString,useformat);
-      Exit;
-    end;
-{ Get actual values }
   for i := 1 to 3 do
     values[i] := 0;
   s1 := '';
@@ -448,6 +442,11 @@ begin
          Exit;
        end;
    end ;
+   if (Which<3) and (N>Which) then
+    begin
+    FixErrorMsg(SInvalidDateFormat,s);
+    Exit;
+    end; 
   // Fill in values.
   getLocalTime(LocalTime);
   ly := LocalTime.Year;

+ 2 - 2
rtl/unix/sysutils.pp

@@ -524,9 +524,9 @@ Function FileAge (Const FileName : String): Longint;
 Var Info : Stat;
 
 begin
-  If  fpstat (pointer(FileName),Info)<0 then
+  If  (fpstat (pointer(FileName),Info)<0) or fpS_ISDIR(info.st_mode) then
     exit(-1)
-  else
+  else 
     Result:=UnixToWinAge(info.st_mtime);
 end;
 {$endif}

+ 1 - 1
rtl/win/wininc/func.inc

@@ -134,7 +134,7 @@ function GetExitCodeThread(hThread:HANDLE; lpExitCode:LPDWORD):WINBOOL; external
 function GetThreadSelectorEntry(hThread:HANDLE; dwSelector:DWORD; lpSelectorEntry:LPLDT_ENTRY):WINBOOL; external 'kernel32' name 'GetThreadSelectorEntry';
 function GetLastError:DWORD; external 'kernel32' name 'GetLastError';
 procedure SetLastError(dwErrCode:DWORD); external 'kernel32' name 'SetLastError';
-function CreateIoCompletionPort(FileHandle:HANDLE; ExistingCompletionPort:HANDLE; CompletionKey:DWORD; NumberOfConcurrentThreads:DWORD):HANDLE; external 'kernel32' name 'CreateIoCompletionPort';
+function CreateIoCompletionPort(FileHandle:HANDLE; ExistingCompletionPort:HANDLE; CompletionKey:ULONG_PTR; NumberOfConcurrentThreads:DWORD):HANDLE; external 'kernel32' name 'CreateIoCompletionPort';
 function SetErrorMode(uMode:UINT):UINT; external 'kernel32' name 'SetErrorMode';
 function ReadProcessMemory(hProcess:HANDLE; lpBaseAddress:LPCVOID; lpBuffer:LPVOID; nSize:DWORD; lpNumberOfBytesRead:LPDWORD):WINBOOL; external 'kernel32' name 'ReadProcessMemory';
 function WriteProcessMemory(hProcess:HANDLE; lpBaseAddress:LPVOID; lpBuffer:LPVOID; nSize:DWORD; lpNumberOfBytesWritten:LPDWORD):WINBOOL; external 'kernel32' name 'WriteProcessMemory';

+ 1 - 1
rtl/win/wininc/redef.inc

@@ -586,7 +586,7 @@ function GetProcessPriorityBoost(hThread: THandle; var DisablePriorityBoost: Boo
 function GetProcessShutdownParameters(var lpdwLevel, lpdwFlags: DWORD): BOOL; external 'kernel32' name 'GetProcessShutdownParameters';
 function GetProcessTimes(hProcess: THandle; var lpCreationTime, lpExitTime, lpKernelTime, lpUserTime: TFileTime): BOOL; external 'kernel32' name 'GetProcessTimes';
 function GetProcessWorkingSetSize(hProcess: THandle; var lpMinimumWorkingSetSize, lpMaximumWorkingSetSize: DWORD): BOOL; external 'kernel32' name 'GetProcessWorkingSetSize';
-function GetQueuedCompletionStatus(CompletionPort: THandle; var lpNumberOfBytesTransferred, lpCompletionKey: DWORD; var lpOverlapped: POverlapped; dwMilliseconds: DWORD): BOOL; external 'kernel32' name 'GetQueuedCompletionStatus';
+function GetQueuedCompletionStatus(CompletionPort: THandle; var lpNumberOfBytesTransferred: DWORD; var lpCompletionKey: ULONG_PTR; var lpOverlapped: POverlapped; dwMilliseconds: DWORD): BOOL; external 'kernel32' name 'GetQueuedCompletionStatus';
 function PostQueuedCompletionStatus(CompletionPort: THandle; NumberOfBytesTransferred:dword; dwCompletionKey: ULONG_PTR; lpOverlapped: POverlapped): BOOL; external 'kernel32' name 'PostQueuedCompletionStatus';
 function GetRasterizerCaps(var p1: TRasterizerStatus; p2: UINT): BOOL; external 'gdi32' name 'GetRasterizerCaps';
 function GetRgnBox(RGN: HRGN; var p2: TRect): Integer; external 'gdi32' name 'GetRgnBox';