Browse Source

--- Merging r16233 into '.':
U rtl/inc/ustrings.inc
--- Merging r16340 into '.':
U packages/fcl-db/src/base/Makefile.fpc
C packages/fcl-db/src/base/Makefile
--- Merging r16356 into '.':
U ide/vesa.pas
--- Merging r16368 into '.':
U rtl/inc/variants.pp
--- Merging r16371 into '.':
U packages/fcl-web/src/base/httpdefs.pp
--- Merging r16372 into '.':
G packages/fcl-web/src/base/httpdefs.pp
--- Merging r16373 into '.':
U packages/fcl-web/src/base/webpage.pp
--- Merging r16374 into '.':
U packages/fcl-web/src/base/fphtml.pp
--- Merging r16388 into '.':
U packages/winunits-base/src/comobj.pp
--- Merging r16392 into '.':
U packages/fcl-db/src/base/dsparams.inc
--- Merging r16395 into '.':
U rtl/objpas/classes/stringl.inc
U rtl/objpas/classes/classesh.inc
--- Merging r16404 into '.':
U rtl/objpas/fmtbcd.pp
--- Merging r16408 into '.':
G rtl/objpas/classes/classesh.inc
--- Merging r16409 into '.':
U rtl/bsd/ipcbsd.inc
--- Merging r16410 into '.':
U rtl/win64/buildrtl.pp
U rtl/win64/system.pp
U rtl/win64/Makefile.fpc
C rtl/win64/Makefile
A rtl/win64/signals.pp
--- Merging r16411 into '.':
U rtl/inc/cmem.pp
--- Merging r16413 into '.':
U ide/globdir.inc
--- Merging r16414 into '.':
G rtl/win64/system.pp
Summary of conflicts:
Text conflicts: 2

# revisions: 16233,16340,16356,16368,16371,16372,16373,16374,16388,16392,16395,16404,16408,16409,16410,16411,16413,16414
------------------------------------------------------------------------
r16233 | sergei | 2010-10-27 20:49:52 +0200 (Wed, 27 Oct 2010) | 2 lines
Changed paths:
M /trunk/rtl/inc/ustrings.inc

* DefaultUnicode2AnsiMove, DefaultAnsi2UnicodeMove: replaced indexed access to destination string by pointer access, this eliminates numerous unnecessary calls to fpc_xxxstring_unique.

------------------------------------------------------------------------
------------------------------------------------------------------------
r16340 | joost | 2010-11-13 21:47:01 +0100 (Sat, 13 Nov 2010) | 5 lines
Changed paths:
M /trunk/packages/fcl-db/src/base/Makefile
M /trunk/packages/fcl-db/src/base/Makefile.fpc

* Set the version in the Makefile.fpc from the fcl-db sub package base so that
a Package.fpc is generated. There is no Package.fpc generated for the main
fcl-db package because there are no ppu-files generated. A Package.fpc (even
if it is invalid) is necessary for fpmake to detect the fcl-db installation.

------------------------------------------------------------------------
------------------------------------------------------------------------
r16356 | pierre | 2010-11-17 17:14:08 +0100 (Wed, 17 Nov 2010) | 1 line
Changed paths:
M /trunk/ide/vesa.pas

* Fix DEBUG go32v2 compilation error
------------------------------------------------------------------------
------------------------------------------------------------------------
r16368 | paul | 2010-11-19 04:19:52 +0100 (Fri, 19 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/inc/variants.pp

rtl: fixed typo in variants.pp noticed by Ivan Shikhalev (mantis #0017983)
------------------------------------------------------------------------
------------------------------------------------------------------------
r16371 | joost | 2010-11-19 15:44:34 +0100 (Fri, 19 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/fcl-web/src/base/httpdefs.pp

* Added TRequest.LocalPathPrefix property
------------------------------------------------------------------------
------------------------------------------------------------------------
r16372 | joost | 2010-11-19 15:45:37 +0100 (Fri, 19 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/fcl-web/src/base/httpdefs.pp

* Process request variables for a HEAD request as if it is a GET request
------------------------------------------------------------------------
------------------------------------------------------------------------
r16373 | joost | 2010-11-19 15:50:41 +0100 (Fri, 19 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/fcl-web/src/base/webpage.pp

* Made WebPage.IsAjaxCall public
------------------------------------------------------------------------
------------------------------------------------------------------------
r16374 | joost | 2010-11-19 15:57:44 +0100 (Fri, 19 Nov 2010) | 3 lines
Changed paths:
M /trunk/packages/fcl-web/src/base/fphtml.pp

* Fixed type in THTMLContentProducerClass name
* Added TJavaScriptStack.Redirect
* Added TWebController.AddrelativeLinkPrefix
------------------------------------------------------------------------
------------------------------------------------------------------------
r16388 | sergei | 2010-11-20 22:36:29 +0100 (Sat, 20 Nov 2010) | 1 line
Changed paths:
M /trunk/packages/winunits-base/src/comobj.pp

+ comobj.pp, DispatchInvoke and DoDispCallByID: support Variant parameters passed by value, support Int64 and QWord arguments.
------------------------------------------------------------------------
------------------------------------------------------------------------
r16392 | marco | 2010-11-21 15:46:26 +0100 (Sun, 21 Nov 2010) | 3 lines
Changed paths:
M /trunk/packages/fcl-db/src/base/dsparams.inc

* using value instead of avalue does not properly set bound because getvalueasvariant
returns 0.0 if isnull. Mantis 17819, patch from Martin Schreiber.

------------------------------------------------------------------------
------------------------------------------------------------------------
r16395 | michael | 2010-11-21 19:20:44 +0100 (Sun, 21 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/objpas/classes/classesh.inc
M /trunk/rtl/objpas/classes/stringl.inc

* Changed var to out in TStringList.Find
------------------------------------------------------------------------
------------------------------------------------------------------------
r16404 | sergei | 2010-11-22 23:50:40 +0100 (Mon, 22 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/objpas/fmtbcd.pp

* Patch from LacaK2 implementing some missing properties of BCDVariant, partially fixes #16853.
------------------------------------------------------------------------
------------------------------------------------------------------------
r16408 | michael | 2010-11-23 22:19:39 +0100 (Tue, 23 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/objpas/classes/classesh.inc

* Tag is now PtrInt, for upcoming Delphi 64-bit compatibility
------------------------------------------------------------------------
------------------------------------------------------------------------
r16409 | pierre | 2010-11-24 00:44:34 +0100 (Wed, 24 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/bsd/ipcbsd.inc

* fix type of fourth parameter of msgrcv function
------------------------------------------------------------------------
------------------------------------------------------------------------
r16410 | pierre | 2010-11-24 00:57:10 +0100 (Wed, 24 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/win64/Makefile
M /trunk/rtl/win64/Makefile.fpc
M /trunk/rtl/win64/buildrtl.pp
A /trunk/rtl/win64/signals.pp
M /trunk/rtl/win64/system.pp

+ Add signals unit for win64
------------------------------------------------------------------------
------------------------------------------------------------------------
r16411 | pierre | 2010-11-24 00:02:05 +0100 (Wed, 24 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/inc/cmem.pp

+ Allow compilation for go32v2 target
------------------------------------------------------------------------
------------------------------------------------------------------------
r16413 | pierre | 2010-11-24 00:08:09 +0100 (Wed, 24 Nov 2010) | 1 line
Changed paths:
M /trunk/ide/globdir.inc

+ Add win64 target conditionals
------------------------------------------------------------------------
------------------------------------------------------------------------
r16414 | pierre | 2010-11-24 08:57:01 +0100 (Wed, 24 Nov 2010) | 1 line
Changed paths:
M /trunk/rtl/win64/system.pp

* Fix RIP relative assmebler code of rev 16410
------------------------------------------------------------------------

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

marco 14 years ago
parent
commit
9637c11cbf

+ 1 - 0
.gitattributes

@@ -7011,6 +7011,7 @@ rtl/win64/Makefile svneol=native#text/plain
 rtl/win64/Makefile.fpc svneol=native#text/plain
 rtl/win64/Makefile.fpc svneol=native#text/plain
 rtl/win64/buildrtl.pp svneol=native#text/plain
 rtl/win64/buildrtl.pp svneol=native#text/plain
 rtl/win64/classes.pp svneol=native#text/plain
 rtl/win64/classes.pp svneol=native#text/plain
+rtl/win64/signals.pp svneol=native#text/plain
 rtl/win64/system.pp svneol=native#text/plain
 rtl/win64/system.pp svneol=native#text/plain
 rtl/win64/windows.pp svneol=native#text/plain
 rtl/win64/windows.pp svneol=native#text/plain
 rtl/wince/Makefile svneol=native#text/plain
 rtl/wince/Makefile svneol=native#text/plain

+ 5 - 0
ide/globdir.inc

@@ -75,6 +75,11 @@
     {$define SignalIsFunction}
     {$define SignalIsFunction}
     {$define SignalIsCdecl}
     {$define SignalIsCdecl}
   {$endif}
   {$endif}
+  {$ifdef win64}
+    {$define HasSignal}
+    {$define SignalIsFunction}
+    {$define SignalIsCdecl}
+  {$endif}
   {$define FSCaseInsensitive}
   {$define FSCaseInsensitive}
   {$define HasSysMsgUnit}
   {$define HasSysMsgUnit}
 {$endif}
 {$endif}

+ 2 - 2
ide/vesa.pas

@@ -582,7 +582,7 @@ begin
   if Force or MustUpdate then
   if Force or MustUpdate then
    begin
    begin
      PrevColor:=GetColor;
      PrevColor:=GetColor;
-     PrevBkColor:=GetBkColor;
+     PrevBkColor:=GetBkColor{$ifdef FPC}(){$endif};
 
 
      for y:=0 to ScreenHeight-1 do
      for y:=0 to ScreenHeight-1 do
        for x:=0 to Screenwidth-1 do
        for x:=0 to Screenwidth-1 do
@@ -617,7 +617,7 @@ begin
        move(videobuf^,oldvideobuf^,
        move(videobuf^,oldvideobuf^,
          VideoBufSize);
          VideoBufSize);
      SetColor(PrevColor);
      SetColor(PrevColor);
-     SetBkColor(GetBkColor);
+     SetBkColor(GetBkColor{$ifdef FPC}(){$endif});
    end;
    end;
   DrawTextBackground:=StoreDrawTextBackground;
   DrawTextBackground:=StoreDrawTextBackground;
 {$endif TESTGRAPHIC}
 {$endif TESTGRAPHIC}

+ 2 - 1
packages/fcl-db/src/base/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/08/25]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2010/11/11]
 #
 #
 default: all
 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
 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
@@ -265,6 +265,7 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 override PACKAGE_NAME=fcl-db
 override PACKAGE_NAME=fcl-db
+override PACKAGE_VERSION=2.5.1
 PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-db/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-db/Makefile.fpc,$(PACKAGESDIR))))))
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader

+ 1 - 0
packages/fcl-db/src/base/Makefile.fpc

@@ -4,6 +4,7 @@
 
 
 [package]
 [package]
 main=fcl-db
 main=fcl-db
+version=2.5.1
 
 
 [target]
 [target]
 units=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 units=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader

+ 1 - 1
packages/fcl-db/src/base/dsparams.inc

@@ -678,7 +678,7 @@ end;
 Procedure TParam.SetAsVariant(const AValue: Variant);
 Procedure TParam.SetAsVariant(const AValue: Variant);
 begin
 begin
   FValue:=AValue;
   FValue:=AValue;
-  FBound:=not VarIsClear(Value);
+  FBound:=not VarIsClear(AValue);
   if FDataType = ftUnknown then
   if FDataType = ftUnknown then
     case VarType(Value) of
     case VarType(Value) of
       varBoolean  : FDataType:=ftBoolean;
       varBoolean  : FDataType:=ftBoolean;

+ 20 - 1
packages/fcl-web/src/base/fphtml.pp

@@ -57,6 +57,7 @@ type
     procedure RedrawContentProducer(AContentProducer: THTMLContentProducer); virtual;
     procedure RedrawContentProducer(AContentProducer: THTMLContentProducer); virtual;
     procedure CallServerEvent(AHTMLContentProducer: THTMLContentProducer; AEvent: Integer; APostVariable: string = ''); virtual;
     procedure CallServerEvent(AHTMLContentProducer: THTMLContentProducer; AEvent: Integer; APostVariable: string = ''); virtual;
     procedure Clear; virtual;
     procedure Clear; virtual;
+    procedure Redirect(AUrl: string); virtual;
     function ScriptIsEmpty: Boolean; virtual;
     function ScriptIsEmpty: Boolean; virtual;
     function GetScript: String; virtual;
     function GetScript: String; virtual;
     property WebController: TWebController read GetWebController;
     property WebController: TWebController read GetWebController;
@@ -66,6 +67,7 @@ type
 
 
   TWebController = class(TComponent)
   TWebController = class(TComponent)
   private
   private
+    FAddRelURLPrefix: boolean;
     FBaseURL: string;
     FBaseURL: string;
     FMessageBoxHandler: TMessageBoxHandler;
     FMessageBoxHandler: TMessageBoxHandler;
     FScriptName: string;
     FScriptName: string;
@@ -95,6 +97,7 @@ type
     function MessageBox(AText: String; Buttons: TWebButtons; ALoaded: string = ''): string; virtual;
     function MessageBox(AText: String; Buttons: TWebButtons; ALoaded: string = ''): string; virtual;
     function DefaultMessageBoxHandler(Sender: TObject; AText: String; Buttons: TWebButtons;  ALoaded: string = ''): string; virtual; abstract;
     function DefaultMessageBoxHandler(Sender: TObject; AText: String; Buttons: TWebButtons;  ALoaded: string = ''): string; virtual; abstract;
     function CreateNewScript: TStringList; virtual; abstract;
     function CreateNewScript: TStringList; virtual; abstract;
+    function AddrelativeLinkPrefix(AnURL: string): string;
     procedure FreeScript(var AScript: TStringList); virtual; abstract;
     procedure FreeScript(var AScript: TStringList); virtual; abstract;
     property ScriptFileReferences: TStringList read GetScriptFileReferences;
     property ScriptFileReferences: TStringList read GetScriptFileReferences;
     property Scripts: TFPObjectList read GetScripts;
     property Scripts: TFPObjectList read GetScripts;
@@ -103,6 +106,7 @@ type
   published
   published
     property BaseURL: string read FBaseURL write SetBaseURL;
     property BaseURL: string read FBaseURL write SetBaseURL;
     property ScriptName: string read FScriptName write SetScriptName;
     property ScriptName: string read FScriptName write SetScriptName;
+    property AddRelURLPrefix: boolean read FAddRelURLPrefix write FAddRelURLPrefix;
   end;
   end;
 
 
   { TAjaxResponse }
   { TAjaxResponse }
@@ -205,7 +209,7 @@ type
     property AcceptChildsAtDesignTime: boolean read FAcceptChildsAtDesignTime;
     property AcceptChildsAtDesignTime: boolean read FAcceptChildsAtDesignTime;
     property parent: TComponent read FParent write SetParent;
     property parent: TComponent read FParent write SetParent;
   end;
   end;
-  THTMLContentProducerClas = class of THTMLContentProducer;
+  THTMLContentProducerClass = class of THTMLContentProducer;
 
 
 
 
   TWriterElementEvent = procedure (Sender:THTMLContentProducer; aWriter : THTMLWriter; var anElement : THTMLCustomElement) of object;
   TWriterElementEvent = procedure (Sender:THTMLContentProducer; aWriter : THTMLWriter; var anElement : THTMLCustomElement) of object;
@@ -491,6 +495,11 @@ begin
   FScript.Clear;
   FScript.Clear;
 end;
 end;
 
 
+procedure TJavaScriptStack.Redirect(AUrl: string);
+begin
+  AddScriptLine('window.location = "'+AUrl+'";');
+end;
+
 function TJavaScriptStack.ScriptIsEmpty: Boolean;
 function TJavaScriptStack.ScriptIsEmpty: Boolean;
 begin
 begin
   result := FScript.Count=0;
   result := FScript.Count=0;
@@ -1241,6 +1250,16 @@ begin
     result := DefaultMessageBoxHandler(self,AText,Buttons,ALoaded);
     result := DefaultMessageBoxHandler(self,AText,Buttons,ALoaded);
 end;
 end;
 
 
+function TWebController.AddrelativeLinkPrefix(AnURL: string): string;
+var
+  i: Integer;
+begin
+  if FAddRelURLPrefix and (AnURL<>'') and (copy(AnURL,1,1)<>'/') and assigned(Owner) and (owner is TWebPage) and assigned(TWebPage(Owner).Request) then
+    result := TWebPage(Owner).Request.LocalPathPrefix + AnURL
+  else
+    result := AnURL;
+end;
+
 function TWebController.GetRequest: TRequest;
 function TWebController.GetRequest: TRequest;
 begin
 begin
   if assigned(Owner) and (owner is TWebPage) then
   if assigned(Owner) and (owner is TWebPage) then

+ 27 - 2
packages/fcl-web/src/base/httpdefs.pp

@@ -268,6 +268,8 @@ type
     FURI: String;
     FURI: String;
     FFiles : TUploadedFiles;
     FFiles : TUploadedFiles;
     FReturnedPathInfo : String;
     FReturnedPathInfo : String;
+    FLocalPathPrefix : string;
+    function GetLocalPathPrefix: string;
     procedure ParseFirstHeaderLine(const line: String);override;
     procedure ParseFirstHeaderLine(const line: String);override;
     function GetFirstHeaderLine: String;
     function GetFirstHeaderLine: String;
   Protected
   Protected
@@ -287,6 +289,7 @@ type
     destructor destroy; override;
     destructor destroy; override;
     Function  GetNextPathInfo : String;
     Function  GetNextPathInfo : String;
     Property  ReturnedPathInfo : String Read FReturnedPathInfo Write FReturnedPathInfo;
     Property  ReturnedPathInfo : String Read FReturnedPathInfo Write FReturnedPathInfo;
+    Property  LocalPathPrefix : string Read GetLocalPathPrefix;
     Property  CommandLine : String Read FCommandLine;
     Property  CommandLine : String Read FCommandLine;
     Property  Command : String read FCommand;
     Property  Command : String read FCommand;
     Property  URI : String read FURI;                // Uniform Resource Identifier
     Property  URI : String read FURI;                // Uniform Resource Identifier
@@ -381,9 +384,11 @@ Function IncludeHTTPPathDelimiter(const AStr: String): String;
 
 
 implementation
 implementation
 
 
+uses
 {$ifdef CGIDEBUG}
 {$ifdef CGIDEBUG}
-uses dbugintf;
+  dbugintf,
 {$endif}
 {$endif}
+  strutils;
 
 
 Resourcestring
 Resourcestring
   SErrContentAlreadySent        = 'HTTP Response content was already sent';
   SErrContentAlreadySent        = 'HTTP Response content was already sent';
@@ -907,6 +912,7 @@ begin
   inherited create;
   inherited create;
   FHandleGetOnPost:=True;
   FHandleGetOnPost:=True;
   FFiles:=TUploadedFiles.Create(TUPloadedFile);
   FFiles:=TUploadedFiles.Create(TUPloadedFile);
+  FLocalPathPrefix:='-';
 end;
 end;
 
 
 destructor TRequest.destroy;
 destructor TRequest.destroy;
@@ -976,6 +982,25 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TRequest.GetLocalPathPrefix: string;
+var
+  pi: String;
+  i: Cardinal;
+begin
+  if FLocalPathPrefix='-' then
+    begin
+    pi := PathInfo;
+    FLocalPathPrefix := '';
+    i := 0;
+    repeat
+    i := PosEx('/',PI,i+1);
+    if i > 0 then
+      FLocalPathPrefix := FLocalPathPrefix + '../';
+    until i=0;
+    end;
+  result := FLocalPathPrefix;
+end;
+
 function TRequest.GetFieldValue(AIndex: integer): String;
 function TRequest.GetFieldValue(AIndex: integer): String;
 begin
 begin
   if AIndex = 35 then // Content
   if AIndex = 35 then // Content
@@ -1141,7 +1166,7 @@ begin
     if FHandleGetOnPost then
     if FHandleGetOnPost then
       InitGetVars;
       InitGetVars;
     end
     end
-  else if CompareText(R,'GET')=0 then
+  else if (CompareText(R,'GET')=0) or (CompareText(R,'HEAD')=0) then
     InitGetVars
     InitGetVars
   else
   else
     Raise Exception.CreateFmt(SErrInvalidRequestMethod,[R]);
     Raise Exception.CreateFmt(SErrInvalidRequestMethod,[R]);

+ 1 - 1
packages/fcl-web/src/base/webpage.pp

@@ -63,7 +63,6 @@ type
     procedure DoHandleAjaxRequest(ARequest: TRequest; AnAjaxResponse: TAjaxResponse; var Handled: boolean); virtual;
     procedure DoHandleAjaxRequest(ARequest: TRequest; AnAjaxResponse: TAjaxResponse; var Handled: boolean); virtual;
     procedure DoBeforeRequest(ARequest: TRequest); virtual;
     procedure DoBeforeRequest(ARequest: TRequest); virtual;
     procedure DoBeforeShowPage(ARequest: TRequest); virtual;
     procedure DoBeforeShowPage(ARequest: TRequest); virtual;
-    function IsAjaxCall: boolean; virtual;
     property WebModule: TFPWebModule read FWebModule;
     property WebModule: TFPWebModule read FWebModule;
     procedure DoCleanupAfterRequest(const AContentProducer: THTMLContentProducer);
     procedure DoCleanupAfterRequest(const AContentProducer: THTMLContentProducer);
     procedure SetRequest(ARequest: TRequest); virtual;
     procedure SetRequest(ARequest: TRequest); virtual;
@@ -78,6 +77,7 @@ type
     function ExchangeContentProducers(Child1, Child2: THTMLContentProducer) : boolean;
     function ExchangeContentProducers(Child1, Child2: THTMLContentProducer) : boolean;
     function MoveContentProducer(MoveElement, MoveBeforeElement: THTMLContentProducer) : boolean;
     function MoveContentProducer(MoveElement, MoveBeforeElement: THTMLContentProducer) : boolean;
     procedure ForeachContentProducer(AForeachChildsProc: TForeachContentProducerProc; Recursive: boolean);
     procedure ForeachContentProducer(AForeachChildsProc: TForeachContentProducerProc; Recursive: boolean);
+    function IsAjaxCall: boolean; virtual;
 
 
     procedure HandlePage(ARequest: TRequest; AResponse: TResponse; AWriter: THTMLwriter; AWebModule: TFPWebModule = nil); virtual;
     procedure HandlePage(ARequest: TRequest; AResponse: TResponse; AWriter: THTMLwriter; AWebModule: TFPWebModule = nil); virtual;
     procedure DoBeforeGenerateXML; virtual;
     procedure DoBeforeGenerateXML; virtual;

+ 23 - 14
packages/winunits-base/src/comobj.pp

@@ -1085,7 +1085,7 @@ HKCR
           for i:=0 to CallDesc^.ArgCount-1 do
           for i:=0 to CallDesc^.ArgCount-1 do
             begin
             begin
 {$ifdef DEBUG_COMDISPATCH}
 {$ifdef DEBUG_COMDISPATCH}
-              writeln('DispatchInvoke: Params = ',hexstr(PtrInt(Params),SizeOf(Pointer)*2));
+              writeln('DispatchInvoke: Params = ',hexstr(Params));
 {$endif DEBUG_COMDISPATCH}
 {$endif DEBUG_COMDISPATCH}
               { get plain type }
               { get plain type }
               CurrType:=CallDesc^.ArgTypes[i] and $3f;
               CurrType:=CallDesc^.ArgTypes[i] and $3f;
@@ -1138,7 +1138,7 @@ HKCR
                       end;
                       end;
                   end
                   end
                 end
                 end
-              else
+              else   { by-value argument }
                 case CurrType of
                 case CurrType of
                   varStrArg:
                   varStrArg:
                     begin
                     begin
@@ -1156,18 +1156,24 @@ HKCR
                   varVariant:
                   varVariant:
                     begin
                     begin
 {$ifdef DEBUG_COMDISPATCH}
 {$ifdef DEBUG_COMDISPATCH}
-                      writeln('Unimplemented variant dispatch');
+                      writeln('By-value Variant, making a copy');
 {$endif DEBUG_COMDISPATCH}
 {$endif DEBUG_COMDISPATCH}
+                      { Codegen always passes a pointer to variant,
+                       *unlike* Delphi which pushes the entire TVarData }
+                      Arguments[i]:=PVarData(PPointer(Params)^)^;
+                      Inc(PPointer(Params));
                     end;
                     end;
                   varCurrency,
                   varCurrency,
                   varDouble,
                   varDouble,
-                  VarDate:
+                  varInt64,
+                  varQWord,
+                  varDate:
                     begin
                     begin
 {$ifdef DEBUG_COMDISPATCH}
 {$ifdef DEBUG_COMDISPATCH}
-                      writeln('Got 8 byte float argument');
+                      writeln('Got 8 byte argument');
 {$endif DEBUG_COMDISPATCH}
 {$endif DEBUG_COMDISPATCH}
                       Arguments[i].VType:=CurrType;
                       Arguments[i].VType:=CurrType;
-                      move(PPointer(Params)^,Arguments[i].VDouble,sizeof(Double));
+                      Arguments[i].VDouble:=PDouble(Params)^;
                       inc(PDouble(Params));
                       inc(PDouble(Params));
                     end;
                     end;
                   else
                   else
@@ -1334,7 +1340,7 @@ HKCR
         flags : WORD;
         flags : WORD;
         invokeresult : HRESULT;
         invokeresult : HRESULT;
         preallocateddata : array[0..15] of TVarData;
         preallocateddata : array[0..15] of TVarData;
-        Arguments : ^TVarData;
+        Arguments : PVarData;
         NamedArguments : PPointer;
         NamedArguments : PPointer;
         CurrType : byte;
         CurrType : byte;
         namedcount,i : byte;
         namedcount,i : byte;
@@ -1350,7 +1356,7 @@ HKCR
           for i:=0 to desc^.CallDesc.ArgCount-1 do
           for i:=0 to desc^.CallDesc.ArgCount-1 do
             begin
             begin
   {$ifdef DEBUG_DISPATCH}
   {$ifdef DEBUG_DISPATCH}
-              writeln('DoDispCallByID: Params = ',hexstr(PtrInt(Params),SizeOf(Pointer)*2));
+              writeln('DoDispCallByID: Params = ',hexstr(Params));
   {$endif DEBUG_DISPATCH}
   {$endif DEBUG_DISPATCH}
               { get plain type }
               { get plain type }
               CurrType:=desc^.CallDesc.ArgTypes[i] and $3f;
               CurrType:=desc^.CallDesc.ArgTypes[i] and $3f;
@@ -1368,24 +1374,27 @@ HKCR
               else
               else
                 begin
                 begin
   {$ifdef DEBUG_DISPATCH}
   {$ifdef DEBUG_DISPATCH}
-                  writeln('DispatchInvoke: Got ref argument with type = ',CurrType);
+                  writeln('DispatchInvoke: Got value argument with type = ',CurrType);
   {$endif DEBUG_DISPATCH}
   {$endif DEBUG_DISPATCH}
                   case CurrType of
                   case CurrType of
                     varVariant:
                     varVariant:
                       begin
                       begin
-                        Arguments[i].VType:=CurrType;
-                        move(PVarData(Params)^,Arguments[i],sizeof(TVarData));
+                       { Codegen always passes a pointer to variant,
+                         *unlike* Delphi which pushes the entire TVarData }
+                        Arguments[i]:=PVarData(PPointer(Params)^)^;
                         inc(PVarData(Params));
                         inc(PVarData(Params));
                       end;
                       end;
                     varCurrency,
                     varCurrency,
                     varDouble,
                     varDouble,
-                    VarDate:
+                    varInt64,
+                    varQWord,
+                    varDate:
                       begin
                       begin
   {$ifdef DEBUG_DISPATCH}
   {$ifdef DEBUG_DISPATCH}
-                        writeln('DispatchInvoke: Got 8 byte float argument');
+                        writeln('DispatchInvoke: Got 8 byte argument');
   {$endif DEBUG_DISPATCH}
   {$endif DEBUG_DISPATCH}
                         Arguments[i].VType:=CurrType;
                         Arguments[i].VType:=CurrType;
-                        move(PPointer(Params)^,Arguments[i].VDouble,sizeof(Double));
+                        Arguments[i].VDouble:=PDouble(Params)^;
                         inc(PDouble(Params));
                         inc(PDouble(Params));
                       end;
                       end;
                   else
                   else

+ 1 - 1
rtl/bsd/ipcbsd.inc

@@ -80,7 +80,7 @@ begin
   msgsnd:=do_syscall(syscall_nr_msgsys,2, msqid, TSysParam(msgp), TSysParam(msgsz), msgflg);
   msgsnd:=do_syscall(syscall_nr_msgsys,2, msqid, TSysParam(msgp), TSysParam(msgsz), msgflg);
 end;
 end;
 
 
-Function msgrcv(msqid:cint; msgp: PMSGBuf; msgsz: size_t; msgtyp:cint; msgflg:cint):cint;
+Function msgrcv(msqid:cint; msgp: PMSGBuf; msgsz: size_t; msgtyp:clong; msgflg:cint):cint;
 begin
 begin
   msgrcv:=(do_syscall(syscall_nr_msgsys,3, msqid, TSysParam(msgp), msgsz, msgtyp, msgflg));
   msgrcv:=(do_syscall(syscall_nr_msgsys,3, msqid, TSysParam(msgp), msgsz, msgtyp, msgflg));
 end;
 end;

+ 13 - 1
rtl/inc/cmem.pp

@@ -19,6 +19,10 @@ interface
 
 
 Const
 Const
 
 
+{$if defined(go32v2)}
+  {$define USE_STATIC_LIBC}
+{$endif}
+
 {$if defined(win32)}
 {$if defined(win32)}
   LibName = 'msvcrt';
   LibName = 'msvcrt';
 {$elseif defined(win64)}
 {$elseif defined(win64)}
@@ -37,10 +41,18 @@ Const
   LibName = 'c';
   LibName = 'c';
 {$endif}
 {$endif}
 
 
+{$ifdef USE_STATIC_LIBC}
+  {$linklib c}
+Function malloc (Size : ptruint) : Pointer;cdecl; external;
+Procedure free (P : pointer); cdecl; external;
+function realloc (P : Pointer; Size : ptruint) : pointer;cdecl; external;
+Function calloc (unitSize,UnitCount : ptruint) : pointer;cdecl; external;
+{$else not USE_STATIC_LIBC}
 Function Malloc (Size : ptruint) : Pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'malloc';
 Function Malloc (Size : ptruint) : Pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'malloc';
 Procedure Free (P : pointer); {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
 Procedure Free (P : pointer); {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
 function ReAlloc (P : Pointer; Size : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'realloc';
 function ReAlloc (P : Pointer; Size : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'realloc';
 Function CAlloc (unitSize,UnitCount : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'calloc';
 Function CAlloc (unitSize,UnitCount : ptruint) : pointer; {$ifdef win32}stdcall{$else}cdecl{$endif}; external LibName name 'calloc';
+{$endif not USE_STATIC_LIBC}
 
 
 implementation
 implementation
 
 
@@ -154,7 +166,7 @@ Const
       DoneThread : nil;
       DoneThread : nil;
       RelocateHeap : nil;
       RelocateHeap : nil;
       GetHeapStatus : @CGetHeapStatus;
       GetHeapStatus : @CGetHeapStatus;
-      GetFPCHeapStatus: @CGetFPCHeapStatus;	
+      GetFPCHeapStatus: @CGetFPCHeapStatus;
     );
     );
 
 
 Var
 Var

+ 10 - 4
rtl/inc/ustrings.inc

@@ -48,7 +48,7 @@ Const
 
 
 {
 {
   Default UnicodeChar <-> Char conversion is to only convert the
   Default UnicodeChar <-> Char conversion is to only convert the
-  lower 127 chars, all others are translated to spaces.
+  lower 127 chars, all others are translated to '?'.
 
 
   These routines can be overwritten for the Current Locale
   These routines can be overwritten for the Current Locale
 }
 }
@@ -56,15 +56,18 @@ Const
 procedure DefaultUnicode2AnsiMove(source:punicodechar;var dest:ansistring;len:SizeInt);
 procedure DefaultUnicode2AnsiMove(source:punicodechar;var dest:ansistring;len:SizeInt);
 var
 var
   i : SizeInt;
   i : SizeInt;
+  p : PAnsiChar;
 begin
 begin
   setlength(dest,len);
   setlength(dest,len);
+  p:=pointer(dest);         {SetLength guarantees that dest is unique}
   for i:=1 to len do
   for i:=1 to len do
     begin
     begin
       if word(source^)<256 then
       if word(source^)<256 then
-        dest[i]:=char(word(source^))
+        p^:=char(word(source^))
       else
       else
-        dest[i]:='?';
+        p^:='?';
       inc(source);
       inc(source);
+      inc(p);
     end;
     end;
 end;
 end;
 
 
@@ -72,12 +75,15 @@ end;
 procedure DefaultAnsi2UnicodeMove(source:pchar;var dest:unicodestring;len:SizeInt);
 procedure DefaultAnsi2UnicodeMove(source:pchar;var dest:unicodestring;len:SizeInt);
 var
 var
   i : SizeInt;
   i : SizeInt;
+  p : PUnicodeChar;
 begin
 begin
   setlength(dest,len);
   setlength(dest,len);
+  p:=pointer(dest);         {SetLength guarantees that dest is unique}
   for i:=1 to len do
   for i:=1 to len do
     begin
     begin
-      dest[i]:=unicodechar(byte(source^));
+      p^:=unicodechar(byte(source^));
       inc(source);
       inc(source);
+      inc(p);
     end;
     end;
 end;
 end;
 
 

+ 1 - 1
rtl/inc/variants.pp

@@ -3590,7 +3590,7 @@ function Null: Variant;       // Null standard constant
 
 
 procedure VarDispInvokeError;
 procedure VarDispInvokeError;
   begin
   begin
-    raise EVariantDispatchError(SDispatchError);
+    raise EVariantDispatchError.Create(SDispatchError);
   end;
   end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------

+ 3 - 3
rtl/objpas/classes/classesh.inc

@@ -693,7 +693,7 @@ type
     procedure Clear; override;
     procedure Clear; override;
     procedure Delete(Index: Integer); override;
     procedure Delete(Index: Integer); override;
     procedure Exchange(Index1, Index2: Integer); override;
     procedure Exchange(Index1, Index2: Integer); override;
-    function Find(const S: string; var Index: Integer): Boolean; virtual;
+    function Find(const S: string; Out Index: Integer): Boolean; virtual;
     function IndexOf(const S: string): Integer; override;
     function IndexOf(const S: string): Integer; override;
     procedure Insert(Index: Integer; const S: string); override;
     procedure Insert(Index: Integer; const S: string); override;
     procedure Sort; virtual;
     procedure Sort; virtual;
@@ -1577,7 +1577,7 @@ type
   private
   private
     FOwner: TComponent;
     FOwner: TComponent;
     FName: TComponentName;
     FName: TComponentName;
-    FTag: Longint;
+    FTag: Ptrint;
     FComponents: TFpList;
     FComponents: TFpList;
     FFreeNotifies: TFpList;
     FFreeNotifies: TFpList;
     FDesignInfo: Longint;
     FDesignInfo: Longint;
@@ -1676,7 +1676,7 @@ type
     property VCLComObject: Pointer read FVCLComObject write FVCLComObject;
     property VCLComObject: Pointer read FVCLComObject write FVCLComObject;
   published
   published
     property Name: TComponentName read FName write SetName stored False;
     property Name: TComponentName read FName write SetName stored False;
-    property Tag: Longint read FTag write FTag default 0;
+    property Tag: PtrInt read FTag write FTag default 0;
   end;
   end;
 
 
 { TBasicActionLink }
 { TBasicActionLink }

+ 1 - 1
rtl/objpas/classes/stringl.inc

@@ -1234,7 +1234,7 @@ Function TStringList.DoCompareText(const s1,s2 : string) : PtrInt;
   end;
   end;
 
 
 
 
-Function TStringList.Find(const S: string; var Index: Integer): Boolean;
+Function TStringList.Find(const S: string; Out Index: Integer): Boolean;
 
 
 var
 var
   L, R, I: Integer;
   L, R, I: Integer;

+ 6 - 8
rtl/objpas/fmtbcd.pp

@@ -234,7 +234,7 @@ INTERFACE
     eBCDNotImplementedException = CLASS ( eBCDException );
     eBCDNotImplementedException = CLASS ( eBCDException );
 
 
   var
   var
-    DecimalPoint : tDecimalPoint = DecimalPoint_is_Point;
+    DecimalPoint : tDecimalPoint = DecimalPoint_is_System;
 
 
 { Utility functions for TBCD access }
 { Utility functions for TBCD access }
 
 
@@ -1640,13 +1640,13 @@ IMPLEMENTATION
           pack_BCD ( bh, result );
           pack_BCD ( bh, result );
        _endSELECT;
        _endSELECT;
      end;
      end;
-{$warnings off}
+
   function VarToBCD ( const aValue : Variant ) : tBCD;
   function VarToBCD ( const aValue : Variant ) : tBCD;
 
 
     begin
     begin
-      not_implemented;
+      if VarIsFmtBCD(aValue) then
+        Result:=TFMTBcdVarData(TVarData(aValue).VPointer).BCD
      end;
      end;
-{$warnings on}
 
 
   function CurrToBCD ( const Curr : currency;
   function CurrToBCD ( const Curr : currency;
                          var BCD : tBCD;
                          var BCD : tBCD;
@@ -2467,16 +2467,14 @@ writeln ( '> ', i4, ' ', bh.Singles[i4], ' ', Add );
 
 
   function VarIsFmtBCD ( const aValue : Variant ) : Boolean;
   function VarIsFmtBCD ( const aValue : Variant ) : Boolean;
     begin
     begin
-      result:=false;
-      not_implemented;
+      Result:=TVarData(aValue).VType=FMTBcdFactory.VarType;
     end;
     end;
 
 
 
 
   function VarFmtBCD : TVartype;
   function VarFmtBCD : TVartype;
 
 
     begin
     begin
-      result:=0;
-      not_implemented;
+      Result:=FMTBcdFactory.VarType;
     end;
     end;
 
 
 
 

+ 60 - 60
rtl/win64/Makefile

@@ -460,184 +460,184 @@ ifeq ($(FULL_TARGET),mipsel-linux)
 override TARGET_UNITS+=system objpas macpas buildrtl lineinfo lnfodwrf
 override TARGET_UNITS+=system objpas macpas buildrtl lineinfo lnfodwrf
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem exeinfo fpintres cpu signals
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=$(LOADERS)
 override TARGET_LOADERS+=$(LOADERS)

+ 1 - 1
rtl/win64/Makefile.fpc

@@ -18,7 +18,7 @@ implicitunits=ctypes strings \
       stdconvs sockets printer charset ucomplex fmtbcd \
       stdconvs sockets printer charset ucomplex fmtbcd \
       winevent video mouse keyboard \
       winevent video mouse keyboard \
       sharemem exeinfo fpintres \
       sharemem exeinfo fpintres \
-      cpu
+      cpu signals
 # mmx
 # mmx
 #      fpcmemdll
 #      fpcmemdll
 #     winsysut signals
 #     winsysut signals

+ 1 - 1
rtl/win64/buildrtl.pp

@@ -13,7 +13,7 @@ unit buildrtl;
       winevent, sockets, printer,
       winevent, sockets, printer,
       video, mouse, keyboard, fmtbcd,
       video, mouse, keyboard, fmtbcd,
       sharemem, fpintres,
       sharemem, fpintres,
-      cpu;
+      cpu, signals;
 
 
   implementation
   implementation
 
 

+ 698 - 0
rtl/win64/signals.pp

@@ -0,0 +1,698 @@
+{
+    This file is part of the Free Pascal run time library.
+    This unit implements unix like signal handling for win32
+    Copyright (c) 1999-2006 by the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit signals;
+
+interface
+
+{$PACKRECORDS C}
+
+  { Signals }
+  const
+    SIGABRT   = 288;
+    SIGFPE    = 289;
+    SIGILL    = 290;
+    SIGSEGV   = 291;
+    SIGTERM   = 292;
+    SIGALRM   = 293;
+    SIGHUP    = 294;
+    SIGINT    = 295;
+    SIGKILL   = 296;
+    SIGPIPE   = 297;
+    SIGQUIT   = 298;
+    SIGUSR1   = 299;
+    SIGUSR2   = 300;
+    SIGNOFP   = 301;
+    SIGTRAP   = 302;
+    SIGTIMR   = 303;    { Internal for setitimer (SIGALRM, SIGPROF) }
+    SIGPROF   = 304;
+    SIGMAX    = 320;
+
+    SIG_BLOCK   = 1;
+    SIG_SETMASK = 2;
+    SIG_UNBLOCK = 3;
+
+  function SIG_DFL( x: longint) : longint; cdecl;
+
+  function SIG_ERR( x: longint) : longint; cdecl;
+
+  function SIG_IGN( x: longint) : longint; cdecl;
+
+  type
+
+    SignalHandler  = function (v : longint) : longint;cdecl;
+
+    PSignalHandler = ^SignalHandler; { to be compatible with linux.pp }
+
+  function signal(sig : longint;func : SignalHandler) : SignalHandler;
+
+  const
+
+     EXCEPTION_MAXIMUM_PARAMETERS = 15;
+
+
+{$define __HASCONTEXT__}
+//
+// Define 128-bit 16-byte aligned xmm register type.
+//
+
+//typedef struct DECLSPEC_ALIGN(16) _M128A {
+{$note todo, fix alignment }
+  type
+     DWORD64 = QWORD;
+     ULONGLONG = QWORD;
+     LONGLONG = int64;
+
+     M128A = record
+          Low: ULONGLONG;
+          High: LONGLONG;
+       end;
+     _M128A = M128A;
+     TM128A = M128A;
+     PM128A = TM128A;
+
+//
+// Format of data for 32-bit fxsave/fxrstor instructions.
+//
+
+//typedef struct _XMM_SAVE_AREA32 {
+  type
+     XMM_SAVE_AREA32 = record
+          ControlWord: WORD;
+          StatusWord: WORD;
+          TagWord: BYTE;
+          Reserved1: BYTE;
+          ErrorOpcode: WORD;
+          ErrorOffset: DWORD;
+          ErrorSelector: WORD;
+          Reserved2: WORD;
+          DataOffset: DWORD;
+          DataSelector: WORD;
+          Reserved3: WORD;
+          MxCsr: DWORD;
+          MxCsr_Mask: DWORD;
+          FloatRegisters: array[0..7] of M128A;
+          XmmRegisters: array[0..16] of M128A;
+          Reserved4: array[0..95] of BYTE;
+       end;
+     _XMM_SAVE_AREA32 = XMM_SAVE_AREA32;
+     TXmmSaveArea = XMM_SAVE_AREA32;
+     PXmmSaveArea = ^TXmmSaveArea;
+
+  const
+     LEGACY_SAVE_AREA_LENGTH = sizeof(XMM_SAVE_AREA32);
+
+//
+// Context Frame
+//
+//  This frame has a several purposes: 1) it is used as an argument to
+//  NtContinue, 2) is is used to constuct a call frame for APC delivery,
+//  and 3) it is used in the user level thread creation routines.
+//
+//
+// The flags field within this record controls the contents of a CONTEXT
+// record.
+//
+// If the context record is used as an input parameter, then for each
+// portion of the context record controlled by a flag whose value is
+// set, it is assumed that that portion of the context record contains
+// valid context. If the context record is being used to modify a threads
+// context, then only that portion of the threads context is modified.
+//
+// If the context record is used as an output parameter to capture the
+// context of a thread, then only those portions of the thread's context
+// corresponding to set flags will be returned.
+//
+// CONTEXT_CONTROL specifies SegSs, Rsp, SegCs, Rip, and EFlags.
+//
+// CONTEXT_INTEGER specifies Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, and R8-R15.
+//
+// CONTEXT_SEGMENTS specifies SegDs, SegEs, SegFs, and SegGs.
+//
+// CONTEXT_DEBUG_REGISTERS specifies Dr0-Dr3 and Dr6-Dr7.
+//
+// CONTEXT_MMX_REGISTERS specifies the floating point and extended registers
+//     Mm0/St0-Mm7/St7 and Xmm0-Xmm15).
+//
+
+//typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
+{$packrecords C}
+  type
+
+     CONTEXT = record
+
+          //
+          // Register parameter home addresses.
+          //
+          // N.B. These fields are for convience - they could be used to extend the
+          //      context record in the future.
+          //
+
+          P1Home: DWORD64;
+          P2Home: DWORD64;
+          P3Home: DWORD64;
+          P4Home: DWORD64;
+          P5Home: DWORD64;
+          P6Home: DWORD64;
+
+          //
+          // Control flags.
+          //
+
+          ContextFlags: DWORD;
+          MxCsr: DWORD;
+
+          //
+          // Segment Registers and processor flags.
+          //
+
+          SegCs: WORD;
+          SegDs: WORD;
+          SegEs: WORD;
+          SegFs: WORD;
+          SegGs: WORD;
+          SegSs: WORD;
+          EFlags: DWORD;
+
+          //
+          // Debug registers
+          //
+
+          Dr0: DWORD64;
+          Dr1: DWORD64;
+          Dr2: DWORD64;
+          Dr3: DWORD64;
+          Dr6: DWORD64;
+          Dr7: DWORD64;
+
+          //
+          // Integer registers.
+          //
+
+          Rax: DWORD64;
+          Rcx: DWORD64;
+          Rdx: DWORD64;
+          Rbx: DWORD64;
+          Rsp: DWORD64;
+          Rbp: DWORD64;
+          Rsi: DWORD64;
+          Rdi: DWORD64;
+          R8: DWORD64;
+          R9: DWORD64;
+          R10: DWORD64;
+          R11: DWORD64;
+          R12: DWORD64;
+          R13: DWORD64;
+          R14: DWORD64;
+          R15: DWORD64;
+
+          //
+          // Program counter.
+          //
+
+          Rip: DWORD64;
+
+          //
+          // Floating point state.
+          //
+
+          FltSave: XMM_SAVE_AREA32; // MWE: only translated the FltSave part of the union
+(*
+          union  {
+              XMM_SAVE_AREA32 FltSave;
+              struct {
+                  M128A Header[2];
+                  M128A Legacy[8];
+                  M128A Xmm0;
+                  M128A Xmm1;
+                  M128A Xmm2;
+                  M128A Xmm3;
+                  M128A Xmm4;
+                  M128A Xmm5;
+                  M128A Xmm6;
+                  M128A Xmm7;
+                  M128A Xmm8;
+                  M128A Xmm9;
+                  M128A Xmm10;
+                  M128A Xmm11;
+                  M128A Xmm12;
+                  M128A Xmm13;
+                  M128A Xmm14;
+                  M128A Xmm15;
+              };
+          };
+*)
+
+          //
+          // Vector registers.
+          //
+
+          VectorRegister: array[0..25] of M128A;
+          VectorControl: DWORD64;
+
+          //
+          // Special debug control registers.
+          //
+
+          DebugControl: DWORD64;
+          LastBranchToRip: DWORD64;
+          LastBranchFromRip: DWORD64;
+          LastExceptionToRip: DWORD64;
+          LastExceptionFromRip: DWORD64;
+      end;
+
+
+(*
+  type
+
+     FLOATING_SAVE_AREA = record
+          ControlWord : DWORD;
+          StatusWord : DWORD;
+          TagWord : DWORD;
+          ErrorOffset : DWORD;
+          ErrorSelector : DWORD;
+          DataOffset : DWORD;
+          DataSelector : DWORD;
+          RegisterArea : array[0..79] of BYTE;
+          Cr0NpxState : DWORD;
+       end;
+     _FLOATING_SAVE_AREA = FLOATING_SAVE_AREA;
+     TFLOATINGSAVEAREA = FLOATING_SAVE_AREA;
+     PFLOATINGSAVEAREA = ^FLOATING_SAVE_AREA;
+
+     CONTEXT = record
+          ContextFlags : DWORD;
+          Dr0 : DWORD;
+          Dr1 : DWORD;
+          Dr2 : DWORD;
+          Dr3 : DWORD;
+          Dr6 : DWORD;
+          Dr7 : DWORD;
+          FloatSave : FLOATING_SAVE_AREA;
+          SegGs : DWORD;
+          SegFs : DWORD;
+          SegEs : DWORD;
+          SegDs : DWORD;
+          Edi : DWORD;
+          Esi : DWORD;
+          Ebx : DWORD;
+          Edx : DWORD;
+          Ecx : DWORD;
+          Eax : DWORD;
+          Ebp : DWORD;
+          Eip : DWORD;
+          SegCs : DWORD;
+          EFlags : DWORD;
+          Esp : DWORD;
+          SegSs : DWORD;
+       end;
+
+*)
+     LPCONTEXT = ^CONTEXT;
+     _CONTEXT = CONTEXT;
+     TCONTEXT = CONTEXT;
+     PCONTEXT = ^CONTEXT;
+
+
+  type
+     pexception_record = ^exception_record;
+     EXCEPTION_RECORD  = record
+       ExceptionCode   : cardinal;
+       ExceptionFlags  : longint;
+       ExceptionRecord : pexception_record;
+       ExceptionAddress : pointer;
+       NumberParameters : longint;
+       ExceptionInformation : array[0..EXCEPTION_MAXIMUM_PARAMETERS-1] of pointer;
+     end;
+
+     PEXCEPTION_POINTERS = ^EXCEPTION_POINTERS;
+     EXCEPTION_POINTERS = record
+       ExceptionRecord   : PEXCEPTION_RECORD ;
+       ContextRecord     : PCONTEXT ;
+     end;
+
+
+implementation
+
+
+const
+     EXCEPTION_ACCESS_VIOLATION = $c0000005;
+     EXCEPTION_BREAKPOINT = $80000003;
+     EXCEPTION_DATATYPE_MISALIGNMENT = $80000002;
+     EXCEPTION_SINGLE_STEP = $80000004;
+     EXCEPTION_ARRAY_BOUNDS_EXCEEDED = $c000008c;
+     EXCEPTION_FLT_DENORMAL_OPERAND = $c000008d;
+     EXCEPTION_FLT_DIVIDE_BY_ZERO = $c000008e;
+     EXCEPTION_FLT_INEXACT_RESULT = $c000008f;
+     EXCEPTION_FLT_INVALID_OPERATION = $c0000090;
+     EXCEPTION_FLT_OVERFLOW = $c0000091;
+     EXCEPTION_FLT_STACK_CHECK = $c0000092;
+     EXCEPTION_FLT_UNDERFLOW = $c0000093;
+     EXCEPTION_INT_DIVIDE_BY_ZERO = $c0000094;
+     EXCEPTION_INT_OVERFLOW = $c0000095;
+     EXCEPTION_INVALID_HANDLE = $c0000008;
+     EXCEPTION_PRIV_INSTRUCTION = $c0000096;
+     EXCEPTION_NONCONTINUABLE_EXCEPTION = $c0000025;
+     EXCEPTION_NONCONTINUABLE = $1;
+     EXCEPTION_STACK_OVERFLOW = $c00000fd;
+     EXCEPTION_INVALID_DISPOSITION = $c0000026;
+     EXCEPTION_ILLEGAL_INSTRUCTION = $C000001D;
+     EXCEPTION_IN_PAGE_ERROR = $C0000006;
+
+     EXCEPTION_EXECUTE_HANDLER = 1;
+     EXCEPTION_CONTINUE_EXECUTION = -(1);
+     EXCEPTION_CONTINUE_SEARCH = 0;
+
+  type
+     { type of functions that should be used for exception handling }
+     LPTOP_LEVEL_EXCEPTION_FILTER = function(excep :PEXCEPTION_POINTERS) : longint;stdcall;
+
+     function SetUnhandledExceptionFilter(lpTopLevelExceptionFilter : LPTOP_LEVEL_EXCEPTION_FILTER)
+       : LPTOP_LEVEL_EXCEPTION_FILTER;
+       stdcall; external 'kernel32' name 'SetUnhandledExceptionFilter';
+
+var
+  signal_list : Array[SIGABRT..SIGMAX] of SignalHandler;
+{ var
+   value of the stack segment
+    to check if the call stack can be written on exceptions
+    this is without any object on win64
+  _SS : cardinal;                      }
+
+const
+  Exception_handler_installed : boolean = false;
+  MAX_Level = 16;
+  except_level : byte = 0;
+var
+  except_rip   : array[0..Max_level-1] of dword64;
+  except_signal : array[0..Max_level-1] of dword64;
+  reset_fpu    : array[0..max_level-1] of boolean;
+
+  procedure JumpToHandleSignal;
+    var
+      res, rip, _rbp, sigtype : dword64;
+    begin
+      asm
+        movq (%rbp),%rax
+        movq %rax,_rbp
+      end;
+{$ifdef SIGNALS_DEBUG}
+      if IsConsole then
+        Writeln(stderr,'In start of JumpToHandleSignal');
+{$endif SIGNALS_DEBUG}
+
+      if except_level>0 then
+        dec(except_level)
+      else
+        RunError(216);
+      rip:=except_rip[except_level];
+
+      sigtype:=except_signal[except_level];
+      if reset_fpu[except_level] then
+        SysResetFPU;
+      if assigned(System_exception_frame) then
+        { get the handler in front again }
+        asm
+          movq  System_exception_frame,%rax
+          movq  %rax,%gs:(0)
+        end;
+      if (sigtype>=SIGABRT) and (sigtype<=SIGMAX) and
+         (signal_list[sigtype]<>@SIG_DFL) then
+        begin
+          res:=signal_list[sigtype](sigtype);
+        end
+      else
+        res:=0;
+
+      if res=0 then
+        Begin
+{$ifdef SIGNALS_DEBUG}
+          if IsConsole then
+            Writeln(stderr,'In JumpToHandleSignal');
+{$endif SIGNALS_DEBUG}
+          RunError(sigtype);
+        end
+      else
+        { jump back to old code }
+        asm
+          movq rip,%rax
+          push %rax
+          movq _rbp,%rax
+          push %rax
+          leave
+          ret
+        end;
+    end;
+
+
+
+  function Signals_exception_handler
+    (excep_exceptionrecord :PEXCEPTION_RECORD;
+     excep_frame : PEXCEPTION_FRAME;
+     excep_contextrecord : PCONTEXT;
+     dispatch : pointer) : longint;stdcall;
+    var frame,res  : longint;
+        function CallSignal(sigtype,frame : longint;must_reset_fpu : boolean) : longint;
+          begin
+{$ifdef SIGNALS_DEBUG}
+             if IsConsole then
+               begin
+                 writeln(stderr,'CallSignal called for signal ',sigtype);
+                 dump_stack(stderr,pointer(frame));
+               end;
+{$endif SIGNALS_DEBUG}
+            {if frame=0 then
+              begin
+                CallSignal:=1;
+                writeln(stderr,'CallSignal frame is zero');
+              end
+            else    }
+              begin
+                 if except_level >= Max_level then
+                   exit;
+                 except_rip[except_level]:=excep_ContextRecord^.Rip;
+                 except_signal[except_level]:=sigtype;
+                 reset_fpu[except_level]:=must_reset_fpu;
+                 inc(except_level);
+                 {dec(excep^.ContextRecord^.Esp,4);
+                 plongint (excep^.ContextRecord^.Esp)^ := longint(excep^.ContextRecord^.rip);}
+                 excep_ContextRecord^.rip:=longint(@JumpToHandleSignal);
+                 excep_ExceptionRecord^.ExceptionCode:=0;
+                 CallSignal:=0;
+{$ifdef SIGNALS_DEBUG}
+                 if IsConsole then
+                   writeln(stderr,'Exception_Continue_Execution set');
+{$endif SIGNALS_DEBUG}
+              end;
+          end;
+
+    begin
+       frame:=excep_ContextRecord^.rbp;
+       { default : unhandled !}
+       res:=1;
+{$ifdef SIGNALS_DEBUG}
+       if IsConsole then
+         writeln(stderr,'Signals exception  ',
+           hexstr(excep_ExceptionRecord^.ExceptionCode,8));
+{$endif SIGNALS_DEBUG}
+       case excep_ExceptionRecord^.ExceptionCode of
+         EXCEPTION_ACCESS_VIOLATION :
+           res:=CallSignal(SIGSEGV,frame,false);
+         { EXCEPTION_BREAKPOINT = $80000003;
+         EXCEPTION_DATATYPE_MISALIGNMENT = $80000002;
+         EXCEPTION_SINGLE_STEP = $80000004; }
+         EXCEPTION_ARRAY_BOUNDS_EXCEEDED :
+           res:=CallSignal(SIGSEGV,frame,false);
+         EXCEPTION_FLT_DENORMAL_OPERAND :
+           begin
+             res:=CallSignal(SIGFPE,frame,true);
+           end;
+         EXCEPTION_FLT_DIVIDE_BY_ZERO :
+           begin
+             res:=CallSignal(SIGFPE,frame,true);
+             {excep^.ContextRecord^.FloatSave.StatusWord:=excep^.ContextRecord^.FloatSave.StatusWord and $ffffff00;}
+           end;
+         {EXCEPTION_FLT_INEXACT_RESULT = $c000008f; }
+         EXCEPTION_FLT_INVALID_OPERATION :
+           begin
+             res:=CallSignal(SIGFPE,frame,true);
+           end;
+         EXCEPTION_FLT_OVERFLOW :
+           begin
+             res:=CallSignal(SIGFPE,frame,true);
+           end;
+         EXCEPTION_FLT_STACK_CHECK :
+           begin
+             res:=CallSignal(SIGFPE,frame,true);
+           end;
+         EXCEPTION_FLT_UNDERFLOW :
+           begin
+             res:=CallSignal(SIGFPE,frame,true); { should be accepted as zero !! }
+           end;
+         EXCEPTION_INT_DIVIDE_BY_ZERO :
+           res:=CallSignal(SIGFPE,frame,false);
+         EXCEPTION_INT_OVERFLOW :
+           res:=CallSignal(SIGFPE,frame,false);
+         {EXCEPTION_INVALID_HANDLE = $c0000008;
+         EXCEPTION_PRIV_INSTRUCTION = $c0000096;
+         EXCEPTION_NONCONTINUABLE_EXCEPTION = $c0000025;
+         EXCEPTION_NONCONTINUABLE = $1;}
+         EXCEPTION_STACK_OVERFLOW :
+           res:=CallSignal(SIGSEGV,frame,false);
+         {EXCEPTION_INVALID_DISPOSITION = $c0000026;}
+         EXCEPTION_ILLEGAL_INSTRUCTION,
+         EXCEPTION_PRIV_INSTRUCTION,
+         EXCEPTION_IN_PAGE_ERROR,
+         EXCEPTION_SINGLE_STEP : res:=CallSignal(SIGSEGV,frame,false);
+         { Ignore EXCEPTION_INVALID_HANDLE exceptions }
+         EXCEPTION_INVALID_HANDLE : res:=0;
+         end;
+       Signals_exception_handler:=res;
+    end;
+
+
+    function API_signals_exception_handler(exceptptrs : PEXCEPTION_POINTERS) : longint; stdcall;
+      begin
+        API_signals_exception_handler:=Signals_exception_handler(
+          @exceptptrs^.ExceptionRecord,
+          nil,
+          @exceptptrs^.ContextRecord,
+          nil);
+      end;
+
+
+const
+  PreviousHandler : LPTOP_LEVEL_EXCEPTION_FILTER = nil;
+  Prev_Handler : pointer = nil;
+  Prev_fpc_handler : pointer = nil;
+
+  procedure install_exception_handler;
+{$ifdef SIGNALS_DEBUG}
+    var
+      oldexceptaddr,newexceptaddr : longint;
+{$endif SIGNALS_DEBUG}
+    begin
+      if Exception_handler_installed then
+        exit;
+      if assigned(System_exception_frame) then
+        begin
+          prev_fpc_handler:=System_exception_frame^.handler;
+          System_exception_frame^.handler:=@Signals_exception_handler;
+          { get the handler in front again }
+          asm
+            movq  %gs:(0),%rax
+            movq  %rax,prev_handler
+            movq  System_exception_frame,%rax
+            movq  %rax,%gs:(0)
+          end;
+          Exception_handler_installed:=true;
+          exit;
+        end;
+{$ifdef SIGNALS_DEBUG}
+      asm
+        movq $0,%rax
+        movq %gs:(%rax),%rax
+        movq %rax,oldexceptaddr
+      end;
+{$endif SIGNALS_DEBUG}
+      PreviousHandler:=SetUnhandledExceptionFilter(@API_signals_exception_handler);
+{$ifdef SIGNALS_DEBUG}
+      asm
+        movq $0,%rax
+        movq %gs:(%rax),%rax
+        movq %rax,newexceptaddr
+      end;
+      if IsConsole then
+        begin
+          writeln(stderr,'Old exception  ',hexstr(oldexceptaddr,8),
+            ' new exception  ',hexstr(newexceptaddr,8));
+          writeln('SetUnhandledExceptionFilter returned ',hexstr(longint(PreviousHandler),8));
+        end;
+{$endif SIGNALS_DEBUG}
+      Exception_handler_installed := true;
+    end;
+
+  procedure remove_exception_handler;
+    begin
+      if not Exception_handler_installed then
+        exit;
+      if assigned(System_exception_frame) then
+        begin
+          if assigned(prev_fpc_handler) then
+            System_exception_frame^.handler:=prev_fpc_handler;
+          prev_fpc_handler:=nil;
+          { restore old handler order again }
+          if assigned(prev_handler) then
+            asm
+            movq  prev_handler,%rax
+            movq  %rax,%gs:(0)
+            end;
+          prev_handler:=nil;
+          Exception_handler_installed:=false;
+          exit;
+        end;
+      SetUnhandledExceptionFilter(PreviousHandler);
+      PreviousHandler:=nil;
+      Exception_handler_installed:=false;
+    end;
+
+
+function SIG_ERR(x:longint):longint; cdecl;
+begin
+  SIG_ERR:=-1;
+end;
+
+
+function SIG_IGN(x:longint):longint; cdecl;
+begin
+  SIG_IGN:=-1;
+end;
+
+
+function SIG_DFL(x:longint):longint; cdecl;
+begin
+  SIG_DFL:=0;
+end;
+
+function signal(sig : longint;func : SignalHandler) : SignalHandler;
+var
+  temp : SignalHandler;
+begin
+  if ((sig < SIGABRT) or (sig > SIGMAX) or (sig = SIGKILL)) then
+   begin
+     signal:=@SIG_ERR;
+     runerror(201);
+   end;
+  if not Exception_handler_installed then
+    install_exception_handler;
+  temp := signal_list[sig];
+  signal_list[sig] := func;
+  signal:=temp;
+end;
+
+
+var
+  i : longint;
+initialization
+
+  for i:=SIGABRT to SIGMAX do
+    signal_list[i]:=@SIG_DFL;
+
+  {install_exception_handler;
+   delay this to first use
+  as other units also might install their handlers PM }
+
+finalization
+  remove_exception_handler;
+end.

+ 14 - 0
rtl/win64/system.pp

@@ -55,6 +55,7 @@ const
   StdInputHandle  : THandle = 0;
   StdInputHandle  : THandle = 0;
   StdOutputHandle : THandle = 0;
   StdOutputHandle : THandle = 0;
   StdErrorHandle  : THandle = 0;
   StdErrorHandle  : THandle = 0;
+  System_exception_frame : PEXCEPTION_FRAME =nil;
 
 
   FileNameCaseSensitive : boolean = true;
   FileNameCaseSensitive : boolean = true;
   CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
   CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
@@ -400,6 +401,19 @@ procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
      install_exception_handlers;
      install_exception_handlers;
      ExitCode:=0;
      ExitCode:=0;
      asm
      asm
+        { allocate space for an exception frame }
+        pushq $0
+        pushq %gs:(0)
+        { movl  %rsp,%gs:(0)
+          but don't insert it as it doesn't
+          point to anything yet
+          this will be used in signals unit }
+        movq %rsp,%rax
+{$ifdef FPC_HAS_RIP_RELATIVE}
+        movq %rax,System_exception_frame(%rip)
+{$else}
+        movq %rax,System_exception_frame
+{$endif}
         { keep stack aligned }
         { keep stack aligned }
         pushq $0
         pushq $0
         pushq %rbp
         pushq %rbp