Browse Source

--- Merging r19628 into '.':
U rtl/objpas/classes/streams.inc
--- Merging r19760 into '.':
U rtl/inc/lineinfo.pp
U rtl/inc/exeinfo.pp
--- Merging r19894 into '.':
U packages/libc/src/sstat.inc
--- Merging r19897 into '.':
U packages/fv/src/sysmsg.pas
U packages/fv/src/go32smsg.inc
U packages/fv/src/w32smsg.inc
U packages/fv/src/unixsmsg.inc
U packages/fv/src/colorsel.pas
U packages/fv/src/amismsg.inc
U packages/fv/src/timeddlg.pas
U packages/fv/src/tabs.pas
--- Merging r19900 into '.':
U rtl/inc/system.fpd

# revisions: 19628,19760,19894,19897,19900
------------------------------------------------------------------------
r19628 | michael | 2011-11-11 18:32:17 +0100 (Fri, 11 Nov 2011) | 1 line
Changed paths:
M /trunk/rtl/objpas/classes/streams.inc

* Avoid code duplication in TFileStream.Create
------------------------------------------------------------------------
------------------------------------------------------------------------
r19760 | pierre | 2011-12-05 17:29:43 +0100 (Mon, 05 Dec 2011) | 1 line
Changed paths:
M /trunk/rtl/inc/exeinfo.pp
M /trunk/rtl/inc/lineinfo.pp

* Fix lineinfo problems for BeOS/Haiku
------------------------------------------------------------------------
------------------------------------------------------------------------
r19894 | marco | 2011-12-27 14:04:10 +0100 (Tue, 27 Dec 2011) | 2 lines
Changed paths:
M /trunk/packages/libc/src/sstat.inc

* Fix results of a bunch of stat functions, sstat.inc.patch from #20974

------------------------------------------------------------------------
------------------------------------------------------------------------
r19897 | jonas | 2011-12-28 13:49:46 +0100 (Wed, 28 Dec 2011) | 6 lines
Changed paths:
M /trunk/packages/fv/src/amismsg.inc
M /trunk/packages/fv/src/colorsel.pas
M /trunk/packages/fv/src/go32smsg.inc
M /trunk/packages/fv/src/sysmsg.pas
M /trunk/packages/fv/src/tabs.pas
M /trunk/packages/fv/src/timeddlg.pas
M /trunk/packages/fv/src/unixsmsg.inc
M /trunk/packages/fv/src/w32smsg.inc

* replaced LGPL license notice with reference to COPYING.FPC to make it
clear that the static linking exception also applies to these units (they
were all written by FPC core team members except for colorsel, but that
unit was explicitly released with the static linking exception as well:
http://andis63.homeftp.net/downloads/colorsel/COPYING )

------------------------------------------------------------------------
------------------------------------------------------------------------
r19900 | marco | 2011-12-28 19:11:45 +0100 (Wed, 28 Dec 2011) | 2 lines
Changed paths:
M /trunk/rtl/inc/system.fpd

* power functions added

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@20024 -

marco 13 years ago
parent
commit
0c2fedd463

+ 2 - 4
packages/fv/src/amismsg.inc

@@ -3,10 +3,8 @@
 
 
    Copyright (c) 2008 by Karoly Balogh
    Copyright (c) 2008 by Karoly Balogh
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,

+ 2 - 4
packages/fv/src/colorsel.pas

@@ -5,10 +5,8 @@
 
 
    Copyright 2008 by Marco van de Voort and Andreas Jakobsche
    Copyright 2008 by Marco van de Voort and Andreas Jakobsche
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 2 - 4
packages/fv/src/go32smsg.inc

@@ -4,10 +4,8 @@
 
 
    Copyright (c) 2000 by Pierre Muller
    Copyright (c) 2000 by Pierre Muller
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,

+ 2 - 4
packages/fv/src/sysmsg.pas

@@ -4,10 +4,8 @@
 
 
    Copyright 2000 by Pierre Muller <[email protected]>
    Copyright 2000 by Pierre Muller <[email protected]>
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,

+ 2 - 4
packages/fv/src/tabs.pas

@@ -4,10 +4,8 @@
 
 
    Copyright 2000-4 by Free Pascal core team
    Copyright 2000-4 by Free Pascal core team
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 2 - 4
packages/fv/src/timeddlg.pas

@@ -4,10 +4,8 @@
 
 
    Copyright (c) 2004 by Free Pascal core team
    Copyright (c) 2004 by Free Pascal core team
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 2 - 4
packages/fv/src/unixsmsg.inc

@@ -3,10 +3,8 @@
 
 
    Copyright (c) 2002 by Pierre Muller
    Copyright (c) 2002 by Pierre Muller
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,

+ 2 - 5
packages/fv/src/w32smsg.inc

@@ -3,11 +3,8 @@
 
 
    Copyright (c) 2000 by Pierre Muller
    Copyright (c) 2000 by Pierre Muller
 
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
 
 
    This library is distributed in the hope that it will be useful,
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 12 - 12
packages/libc/src/sstat.inc

@@ -46,71 +46,71 @@ end;
 
 
 function fstat(__fd:longint; __buf:Pstat):longint;
 function fstat(__fd:longint; __buf:Pstat):longint;
   begin
   begin
-    __fxstat(_STAT_VER,__fd,__buf);
+    fstat:=__fxstat(_STAT_VER,__fd,__buf);
   end;
   end;
 
 
 
 
 function lstat(__file:Pchar; __buf:Pstat):longint;
 function lstat(__file:Pchar; __buf:Pstat):longint;
   begin
   begin
-    __lxstat(_STAT_VER,__file,__buf);
+    lstat:=__lxstat(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function stat(__file:Pchar; __buf:Pstat):longint;
 function stat(__file:Pchar; __buf:Pstat):longint;
   begin
   begin
-    __xstat(_STAT_VER,__file,__buf);
+    stat:=__xstat(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function fstat64(__fd:longint; __buf:Pstat64):longint;
 function fstat64(__fd:longint; __buf:Pstat64):longint;
   begin
   begin
-    __fxstat64(_STAT_VER,__fd,__buf);
+    fstat64:=__fxstat64(_STAT_VER,__fd,__buf);
   end;
   end;
 
 
 
 
 function lstat64(__file:Pchar; __buf:Pstat64):longint;
 function lstat64(__file:Pchar; __buf:Pstat64):longint;
   begin
   begin
-    __lxstat64(_STAT_VER,__file,__buf);
+    lstat64:=__lxstat64(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function stat64(__file:Pchar; __buf:Pstat64):longint;
 function stat64(__file:Pchar; __buf:Pstat64):longint;
   begin
   begin
-    __xstat64(_STAT_VER,__file,__buf);
+    stat64:=__xstat64(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function stat(__file:Pchar; var __buf:_stat):longint;
 function stat(__file:Pchar; var __buf:_stat):longint;
   begin
   begin
-    __xstat(_STAT_VER,__file,__buf);
+    stat:=__xstat(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function fstat(__fd:longint; var __buf:_stat):longint;
 function fstat(__fd:longint; var __buf:_stat):longint;
   begin
   begin
-    __fxstat(_STAT_VER,__fd,__buf);
+    fstat:=__fxstat(_STAT_VER,__fd,__buf);
   end;
   end;
 
 
 
 
 function stat64(__file:Pchar; var __buf: _stat64):longint;
 function stat64(__file:Pchar; var __buf: _stat64):longint;
   begin
   begin
-    __xstat64(_STAT_VER,__file,__buf);
+    stat64:=__xstat64(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function fstat64(__fd:longint; var __buf: _stat64):longint;
 function fstat64(__fd:longint; var __buf: _stat64):longint;
   begin
   begin
-    __fxstat64(_STAT_VER,__fd,__buf);
+    fstat64:=__fxstat64(_STAT_VER,__fd,__buf);
   end;
   end;
 
 
 
 
 function lstat(__file:Pchar; var __buf:_stat):longint;
 function lstat(__file:Pchar; var __buf:_stat):longint;
   begin
   begin
-    __lxstat(_STAT_VER,__file,__buf);
+    lstat:=__lxstat(_STAT_VER,__file,__buf);
   end;
   end;
 
 
 
 
 function lstat64(__file:Pchar; var __buf:_stat64):longint;
 function lstat64(__file:Pchar; var __buf:_stat64):longint;
   begin
   begin
-    __lxstat64(_STAT_VER,__file,__buf);
+    lstat64:=__lxstat64(_STAT_VER,__file,__buf);
   end;
   end;

+ 15 - 7
rtl/inc/exeinfo.pp

@@ -815,7 +815,8 @@ const
    B_LIBRARY_IMAGE = 2;
    B_LIBRARY_IMAGE = 2;
    B_ADD_ON_IMAGE  = 3;
    B_ADD_ON_IMAGE  = 3;
    B_SYSTEM_IMAGE  = 4;
    B_SYSTEM_IMAGE  = 4;
-
+   B_OK = 0;
+   
 type
 type
     image_info = packed record
     image_info = packed record
      id      : image_id;
      id      : image_id;
@@ -848,13 +849,20 @@ var
 begin
 begin
   // The only BeOS specific part is setting the processaddress
   // The only BeOS specific part is setting the processaddress
   cookie := 0;
   cookie := 0;
+  OpenElf32Beos:=false;
   fillchar(info, sizeof(image_info), 0);
   fillchar(info, sizeof(image_info), 0);
-  get_next_image_info(0,cookie,info,sizeof(info));
-  if (info._type = B_APP_IMAGE) then
-     e.processaddress := cardinal(info.text)
-  else
-     e.processaddress := 0;
-  OpenElf32Beos := OpenElf(e);
+  while get_next_image_info(0,cookie,info,sizeof(info))=B_OK do
+    begin
+        if e.filename=String(pchar(@info.name)) then
+          begin
+              if (info._type = B_APP_IMAGE) then
+                e.processaddress := cardinal(info.text)
+             else
+                e.processaddress := 0;
+             OpenElf32Beos := OpenElf(e);
+             exit;
+         end;
+    end;
 end;
 end;
 {$endif beos}
 {$endif beos}
 
 

+ 6 - 1
rtl/inc/lineinfo.pp

@@ -96,7 +96,12 @@ begin
       if not OpenExeFile(e,dbgfn) then
       if not OpenExeFile(e,dbgfn) then
         exit;
         exit;
     end;
     end;
-  e.processaddress:=ptruint(baseaddr)-e.processaddress;
+{$ifdef BeOS}
+  { Do not change ProcessAddress field for BeOS/Haiku
+    if baseAddr is lower than ProcessAdress }
+  if ptruint(baseaddr)>ptruint(e.processaddress) then
+{$endif BeOS}
+    e.processaddress:=ptruint(baseaddr)-e.processaddress;
   StabsFunctionRelative := E.FunctionRelative;
   StabsFunctionRelative := E.FunctionRelative;
   if FindExeSection(e,'.stab',stabofs,stablen) and
   if FindExeSection(e,'.stab',stabofs,stablen) and
      FindExeSection(e,'.stabstr',stabstrofs,stabstrlen) then
      FindExeSection(e,'.stabstr',stabstrofs,stabstrlen) then

+ 2 - 0
rtl/inc/system.fpd

@@ -57,6 +57,8 @@ Procedure SetLength(Var S : AStringType; Len : Integer);
 Procedure SetLength(Var A : DynArrayType; Len : Integer);
 Procedure SetLength(Var A : DynArrayType; Len : Integer);
 Function Length(S : AStringType) : Integer;
 Function Length(S : AStringType) : Integer;
 Function Length(A : DynArrayType) : Integer;
 Function Length(A : DynArrayType) : Integer;
+Function Power(Base:double;expon:double):double;
+Function Power(Base:Longint;expon:Longint):Longint;
 Procedure WriteStr(Out S : String; Args : Arguments);
 Procedure WriteStr(Out S : String; Args : Arguments);
 Procedure ReadStr(Const S : String; Args : Arguments);
 Procedure ReadStr(Const S : String; Args : Arguments);
 Procedure Pack(Const A : UnpackedArrayType; StartIndex : TIndexType; Out Z : PackedArrayType);
 Procedure Pack(Const A : UnpackedArrayType; StartIndex : TIndexType; Out Z : PackedArrayType);

+ 1 - 11
rtl/objpas/classes/streams.inc

@@ -535,17 +535,7 @@ end;
 constructor TFileStream.Create(const AFileName: string; Mode: Word);
 constructor TFileStream.Create(const AFileName: string; Mode: Word);
 
 
 begin
 begin
-  FFileName:=AFileName;
-  If (Mode and fmCreate) > 0 then
-    FHandle:=FileCreate(AFileName,Mode,438)
-  else
-    FHAndle:=FileOpen(AFileName,Mode);
-
-  If (THandle(FHandle)=feInvalidHandle) then
-    If Mode=fmcreate then
-      raise EFCreateError.createfmt(SFCreateError,[AFileName])
-    else
-      raise EFOpenError.Createfmt(SFOpenError,[AFilename]);
+  Create(AFileName,Mode,438);
 end;
 end;