Browse Source

* $ifdef ver0_99_5 updates

peter 27 years ago
parent
commit
bd57e42086
12 changed files with 197 additions and 104 deletions
  1. 18 10
      rtl/i386/cpu.pp
  2. 18 14
      rtl/i386/i386.inc
  3. 1 1
      rtl/i386/makefile.cpu
  4. 44 10
      rtl/i386/math.inc
  5. 6 1
      rtl/i386/readme
  6. 18 11
      rtl/i386/setjump.inc
  7. 10 6
      rtl/i386/setjumph.inc
  8. 11 8
      rtl/inc/mathh.inc
  9. 9 6
      rtl/inc/real2str.inc
  10. 23 19
      rtl/inc/system.inc
  11. 22 8
      rtl/inc/systemh.inc
  12. 17 10
      rtl/inc/text.inc

+ 18 - 10
rtl/i386/cpu.pp

@@ -1,9 +1,11 @@
 {
 {
     $Id$
     $Id$
     This file is part of the Free Pascal run time library.
     This file is part of the Free Pascal run time library.
-    Copyright (c) 1993,98 by Florian Klaempfl,
-    member of the Free Pascal development team.
+    Copyright (c) 1998 by Florian Klaempfl
 
 
+    This unit contains some routines to get informations about the
+    processor
+    
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -12,11 +14,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-{ this unit contains some routines to get informations about the
-  processor
-}
 unit cpu;
 unit cpu;
-{$I386_INTEL}
   interface
   interface
 
 
     { returns true, if the processor supports the cpuid instruction }
     { returns true, if the processor supports the cpuid instruction }
@@ -28,10 +26,17 @@ unit cpu;
     { returns the contents of the cr0 register }
     { returns the contents of the cr0 register }
     function cr0 : longint;
     function cr0 : longint;
 
 
+
   implementation
   implementation
 
 
-    function cpuid_support : boolean;assembler;
+{$ifdef VER0_99_5}
+  {$I386_INTEL}
+{$endif}
 
 
+{$ASMMODE INTEL}
+  
+
+    function cpuid_support : boolean;assembler;
       {
       {
         Check if the ID-flag can be changed, if changed then CpuID is supported.
         Check if the ID-flag can be changed, if changed then CpuID is supported.
         Tested under go32v1 and Linux on c6x86 with CpuID enabled and disabled (PFV)
         Tested under go32v1 and Linux on c6x86 with CpuID enabled and disabled (PFV)
@@ -53,8 +58,8 @@ unit cpu;
          setnz   al
          setnz   al
       end;
       end;
 
 
-    function cr0 : longint;assembler;
 
 
+    function cr0 : longint;assembler;
       asm
       asm
          DB 0Fh,20h,0C0h
          DB 0Fh,20h,0C0h
          { mov eax,cr0
          { mov eax,cr0
@@ -62,8 +67,8 @@ unit cpu;
   	        parsers }
   	        parsers }
       end;
       end;
 
 
-    function floating_point_emulation : boolean;
 
 
+    function floating_point_emulation : boolean;
       begin
       begin
          {!!!! I don't know currently the position of the EM flag }
          {!!!! I don't know currently the position of the EM flag }
          { $4 after Ralf Brown's list }
          { $4 after Ralf Brown's list }
@@ -74,7 +79,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-05-25 10:51:27  pierre
+  Revision 1.4  1998-08-11 00:04:46  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.3  1998/05/25 10:51:27  pierre
     * CR0 works now (written using DB to allow to use it we INTEL and ATT output)
     * CR0 works now (written using DB to allow to use it we INTEL and ATT output)
     * floating_emulation bit set correctly
     * floating_emulation bit set correctly
 
 

+ 18 - 14
rtl/i386/i386.inc

@@ -552,16 +552,16 @@ end;
 
 
 procedure runerror(w : word);[alias: 'runerror'];
 procedure runerror(w : word);[alias: 'runerror'];
 
 
-function get_addr : Pointer;assembler;
-asm
-   movl (%ebp),%eax
-   movl 4(%eax),%eax
-end;
+  function get_addr : Pointer;assembler;
+  asm
+    movl (%ebp),%eax
+    movl 4(%eax),%eax
+  end;
 
 
-function get_error_bp : Longint;assembler;
-asm
-   movl (%ebp),%eax {%ebp of run_error}
-end;
+  function get_error_bp : Longint;assembler;
+  asm
+    movl (%ebp),%eax {%ebp of run_error}
+  end;
 
 
 begin
 begin
   errorcode:=w;
   errorcode:=w;
@@ -719,7 +719,7 @@ end ['EAX'];
          end;
          end;
       end;
       end;
 
 
-{$IFNDEF NEW_READWRITE}
+{$ifdef VER0_99_5}
     procedure f1;[public,alias: 'FLUSH_STDOUT'];
     procedure f1;[public,alias: 'FLUSH_STDOUT'];
 
 
       begin
       begin
@@ -731,7 +731,7 @@ end ['EAX'];
             popal
             popal
          end;
          end;
       end;
       end;
-{$ENDIF NEW_READWRITE}
+{$endif VER0_99_5}
 
 
 
 
 Function Sptr : Longint;
 Function Sptr : Longint;
@@ -744,14 +744,18 @@ begin
 end;
 end;
 
 
 
 
-{$I386_ATT} {can be removed}
-{$I386_DIRECT} {can be removed}
+{$ifdef VER_0_99_5}
+  {$I386_DIRECT}
+{$endif}
 
 
 {$ASMMODE ATT}
 {$ASMMODE ATT}
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-07-30 13:26:20  michael
+  Revision 1.18  1998-08-11 00:04:47  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.17  1998/07/30 13:26:20  michael
   + Added support for ErrorProc variable. All internal functions are required
   + Added support for ErrorProc variable. All internal functions are required
     to call HandleError instead of runerror from now on.
     to call HandleError instead of runerror from now on.
     This is necessary for exception support.
     This is necessary for exception support.

+ 1 - 1
rtl/i386/makefile.cpu

@@ -2,6 +2,6 @@
 # Here we set processor dependent include file names.
 # Here we set processor dependent include file names.
 #
 #
 
 
-CPUNAMES=i386 heap math set rttip
+CPUNAMES=i386 heap math set rttip setjump setjumph
 CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES))
 CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES))
 
 

+ 44 - 10
rtl/i386/math.inc

@@ -15,7 +15,24 @@
  **********************************************************************}
  **********************************************************************}
 
 
 {$ASMMODE DIRECT}
 {$ASMMODE DIRECT}
-{$ifdef dummy}
+
+{$ifndef SUPPORT_EXTENDED}
+
+{****************************************************************************
+                       Real/Double data type routines
+ ****************************************************************************}
+
+    function pi : real;
+
+      begin
+         asm
+            fldpi
+            leave
+            ret
+         end [];
+      end;
+
+
     function abs(d : real) : real;
     function abs(d : real) : real;
 
 
       begin
       begin
@@ -241,12 +258,8 @@
      begin
      begin
         power:=exp(ln(bas)*expo);
         power:=exp(ln(bas)*expo);
      end;
      end;
-{$endif dummy}
-
-   function power(bas,expo : longint) : longint;
-     begin
-        power:=round(exp(ln(bas)*expo));
-     end;
+     
+{$else SUPPORT_EXTENDED}
 
 
 {****************************************************************************
 {****************************************************************************
                        EXTENDED data type routines
                        EXTENDED data type routines
@@ -494,7 +507,24 @@
         power:=exp(ln(bas)*expo);
         power:=exp(ln(bas)*expo);
      end;
      end;
 
 
-{$ifdef fixed}
+{$endif SUPPORT_EXTENDED}
+
+
+{****************************************************************************
+                       Longint data type routines
+ ****************************************************************************}
+
+   function power(bas,expo : longint) : longint;
+     begin
+        power:=round(exp(ln(bas)*expo));
+     end;
+
+
+{****************************************************************************
+                         Fixed data type routines
+ ****************************************************************************}
+
+{$ifdef _SUPPORT_FIXED} { Not yet allowed }
 
 
     function sqrt(d : fixed) : fixed;
     function sqrt(d : fixed) : fixed;
 
 
@@ -524,6 +554,7 @@
          end;
          end;
       end;
       end;
 
 
+
     function int(d : fixed) : fixed;
     function int(d : fixed) : fixed;
     {*****************************************************************}
     {*****************************************************************}
     { Returns the integral part of d                                  }
     { Returns the integral part of d                                  }
@@ -604,13 +635,16 @@
       Round:= longint(highf);
       Round:= longint(highf);
     end;
     end;
 
 
-{$endif}
+{$endif SUPPORT_FIXED}
 
 
 {$ASMMODE ATT}
 {$ASMMODE ATT}
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-08-10 15:54:50  peter
+  Revision 1.5  1998-08-11 00:04:50  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.4  1998/08/10 15:54:50  peter
     * removed dup power(longint)
     * removed dup power(longint)
 
 
   Revision 1.3  1998/08/08 12:28:09  florian
   Revision 1.3  1998/08/08 12:28:09  florian

+ 6 - 1
rtl/i386/readme

@@ -7,6 +7,11 @@ Include files for system are :
   set.inc  (sets operations)
   set.inc  (sets operations)
   math.inc (mathematic operations using the coprocessor)
   math.inc (mathematic operations using the coprocessor)
   i386.inc (several functions/procedures containing assembler parts)
   i386.inc (several functions/procedures containing assembler parts)
-
+  setjump.inc (setjmp/longjmp implementation for exceptions)
+  rttip.inc (rtti handling, for speed reasons)
+  
 Units are :
 Units are :
   strings.pp (written in assembler for speed)
   strings.pp (written in assembler for speed)
+  cpu.pp     (routines to access cpu info)
+  mmx.pp     (special mmx routines)
+  

+ 18 - 11
rtl/i386/setjump.inc

@@ -1,9 +1,10 @@
 {
 {
     $Id$
     $Id$
     This file is part of the Free Pascal run time library.
     This file is part of the Free Pascal run time library.
-    Copyright (c) 1993,97 by xxxx
-    member of the Free Pascal development team
+    Copyright (c) 1998 by the Free Pascal development team
 
 
+    SetJmp and LongJmp implementation for exception handling
+    
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -13,13 +14,13 @@
 
 
  **********************************************************************}
  **********************************************************************}
 
 
-{**********************************************************************
-           Set_Jmp/Long_jmp
- **********************************************************************}
+{$ifdef VER0_99_5}
+  {$I386_DIRECT}
+{$endif}
 
 
-{$I386_DIRECT}
+{$ASMMODE DIRECT}
+  
 Function SetJmp (Var S : Jmp_buf) : longint;assembler;[Public, alias : 'FPC_SETJMP'];
 Function SetJmp (Var S : Jmp_buf) : longint;assembler;[Public, alias : 'FPC_SETJMP'];
-
 asm
 asm
   movl 8(%ebp),%eax
   movl 8(%ebp),%eax
   movl %ebx,(%eax)
   movl %ebx,(%eax)
@@ -34,15 +35,15 @@ asm
   xorl %eax,%eax
   xorl %eax,%eax
 end;
 end;
 
 
-Procedure longJmp (Var S : Jmp_buf; value : longint); assembler;[Public, alias : 'FPC_LONGJMP'];
 
 
+Procedure longJmp (Var S : Jmp_buf; value : longint); assembler;[Public, alias : 'FPC_LONGJMP'];
 asm
 asm
   movl 8(%ebp),%ecx
   movl 8(%ebp),%ecx
   movl 12(%ebp),%eax
   movl 12(%ebp),%eax
   testl %eax,%eax
   testl %eax,%eax
-  jne .nonzero
+  jne .Ljnonzero
   movl $1,%eax
   movl $1,%eax
-.nonzero:
+.Ljnonzero:
   movl (%ecx),%ebx
   movl (%ecx),%ebx
   movl 4(%ecx),%esi
   movl 4(%ecx),%esi
   movl 8(%ecx),%edi
   movl 8(%ecx),%edi
@@ -51,5 +52,11 @@ asm
   jmp *20(%ecx)
   jmp *20(%ecx)
 end;
 end;
 
 
-{ I386_ATT removed for bugfix branch }
+{$ASMMODE ATT}
+
+{
+  $Log$
+  Revision 1.3  1998-08-11 00:04:52  peter
+    * $ifdef ver0_99_5 updates
 
 
+}

+ 10 - 6
rtl/i386/setjumph.inc

@@ -1,8 +1,9 @@
 {
 {
     $Id$
     $Id$
     This file is part of the Free Pascal run time library.
     This file is part of the Free Pascal run time library.
-    Copyright (c) 1993,97 by xxxx
-    member of the Free Pascal development team
+    Copyright (c) 1998 the Free Pascal development team
+    
+    SetJmp/Longjmp declarations
 
 
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
@@ -13,10 +14,6 @@
 
 
  **********************************************************************}
  **********************************************************************}
 
 
-{**********************************************************************
-          Declarations for SetJmp/LongJmp
- **********************************************************************}
-
 Type
 Type
   jmp_buf = record
   jmp_buf = record
     ebx,esi,edi : Longint;
     ebx,esi,edi : Longint;
@@ -26,3 +23,10 @@ Type
 
 
 Function Setjmp (Var S : Jmp_buf) : longint;
 Function Setjmp (Var S : Jmp_buf) : longint;
 Procedure longjmp (Var S : Jmp_buf; value : longint);
 Procedure longjmp (Var S : Jmp_buf; value : longint);
+
+{
+  $Log$
+  Revision 1.2  1998-08-11 00:04:53  peter
+    * $ifdef ver0_99_5 updates
+
+}  

+ 11 - 8
rtl/inc/mathh.inc

@@ -15,7 +15,7 @@
 
 
    { declarations of the math routines }
    { declarations of the math routines }
 
 
-{$ifdef i386}
+{$ifdef SUPPORT_EXTENDED}
     function abs(d : extended) : extended;
     function abs(d : extended) : extended;
     function arctan(d : extended) : extended;
     function arctan(d : extended) : extended;
     function cos(d : extended) : extended;
     function cos(d : extended) : extended;
@@ -30,8 +30,7 @@
     function sqrt(d : extended) : extended;
     function sqrt(d : extended) : extended;
     function trunc(d : extended) : longint;
     function trunc(d : extended) : longint;
     function power(bas,expo : extended) : extended;
     function power(bas,expo : extended) : extended;
-    function power(bas,expo : longint) : longint;
-{$else i386}
+{$else SUPPORT_EXTENDED}
     function abs(d : real) : real;
     function abs(d : real) : real;
     function arctan(d : real) : real;
     function arctan(d : real) : real;
     function cos(d : real) : real;
     function cos(d : real) : real;
@@ -44,12 +43,13 @@
     function sqr(d : real) : real;
     function sqr(d : real) : real;
     function sqrt(d : real) : real;
     function sqrt(d : real) : real;
     function trunc(d : real) : longint;
     function trunc(d : real) : longint;
-    function power(bas,expo : longint) : longint;
     function power(bas,expo : real) : real;
     function power(bas,expo : real) : real;
     function pi : real;
     function pi : real;
-{$endif i386}
+{$endif SUPPORT_EXTENDED}
 
 
-{$ifdef FIXED}
+    function power(bas,expo : longint) : longint;
+    
+{$ifdef _SUPPORT_FIXED}
     function sqrt(d : fixed) : fixed;
     function sqrt(d : fixed) : fixed;
     function Round(x: fixed): longint;
     function Round(x: fixed): longint;
     function sqr(d : fixed) : fixed;
     function sqr(d : fixed) : fixed;
@@ -57,11 +57,14 @@
     function frac(d : fixed) : fixed;
     function frac(d : fixed) : fixed;
     function trunc(d : fixed) : longint;
     function trunc(d : fixed) : longint;
     function int(d : fixed) : fixed;
     function int(d : fixed) : fixed;
-{$endif FIXED}
+{$endif SUPPORT_FIXED}
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-08-08 12:28:11  florian
+  Revision 1.4  1998-08-11 00:05:24  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.3  1998/08/08 12:28:11  florian
     * a lot small fixes to the extended data type work
     * a lot small fixes to the extended data type work
 
 
   Revision 1.2  1998/05/12 10:42:45  peter
   Revision 1.2  1998/05/12 10:42:45  peter

+ 9 - 6
rtl/inc/real2str.inc

@@ -19,11 +19,11 @@ type
   { corresponding to real    single     fixed   extended and comp for i386 }
   { corresponding to real    single     fixed   extended and comp for i386 }
 
 
 {$ifdef i386}
 {$ifdef i386}
-{$ifdef VER0_99_5}
-  bestreal = double;
-{$else VER0_99_5}
-  bestreal = extended; 
-{$endif VER0_99_5}
+  {$ifdef SUPPORT_EXTENDED}
+    bestreal = extended; 
+  {$else}
+    bestreal = double;
+  {$endif SUPPORT_EXTENDED}
 {$else i386}
 {$else i386}
   bestreal = single;
   bestreal = single;
 {$endif i386}
 {$endif i386}
@@ -201,7 +201,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  1998-08-10 15:56:30  peter
+  Revision 1.9  1998-08-11 00:05:25  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.8  1998/08/10 15:56:30  peter
     * fixed 0_9_5 typo
     * fixed 0_9_5 typo
 
 
   Revision 1.7  1998/08/08 12:28:12  florian
   Revision 1.7  1998/08/08 12:28:12  florian

+ 23 - 19
rtl/inc/system.inc

@@ -71,7 +71,7 @@ Function  lo(l : Longint) : Word;  [INTERNPROC: In_lo_long];
 Function  hi(i : Integer) : byte;  [INTERNPROC: In_hi_Word];
 Function  hi(i : Integer) : byte;  [INTERNPROC: In_hi_Word];
 Function  hi(w : Word) : byte;     [INTERNPROC: In_hi_Word];
 Function  hi(w : Word) : byte;     [INTERNPROC: In_hi_Word];
 Function  hi(l : Longint) : Word;  [INTERNPROC: In_hi_long];
 Function  hi(l : Longint) : Word;  [INTERNPROC: In_hi_long];
-{$ifndef INTERN_INC}
+{$ifdef VER0_99_5}
 Procedure Inc(var i : Cardinal);   [INTERNPROC: In_Inc_DWord];
 Procedure Inc(var i : Cardinal);   [INTERNPROC: In_Inc_DWord];
 Procedure Inc(var i : Longint);    [INTERNPROC: In_Inc_DWord];
 Procedure Inc(var i : Longint);    [INTERNPROC: In_Inc_DWord];
 Procedure Inc(var i : Integer);    [INTERNPROC: In_Inc_Word];
 Procedure Inc(var i : Integer);    [INTERNPROC: In_Inc_Word];
@@ -88,7 +88,7 @@ Procedure Dec(var i : shortint);   [INTERNPROC: In_Dec_byte];
 Procedure Dec(var i : byte);       [INTERNPROC: In_Dec_byte];
 Procedure Dec(var i : byte);       [INTERNPROC: In_Dec_byte];
 Procedure Dec(var c : Char);       [INTERNPROC: In_Dec_byte];
 Procedure Dec(var c : Char);       [INTERNPROC: In_Dec_byte];
 Procedure Dec(var p : PChar);      [INTERNPROC: In_Dec_DWord];
 Procedure Dec(var p : PChar);      [INTERNPROC: In_Dec_DWord];
-{$endif INTERN_INC}
+{$endif VER0_99_5}
 
 
 Function chr(b : byte) : Char;      [INTERNPROC: In_chr_byte];
 Function chr(b : byte) : Char;      [INTERNPROC: In_chr_byte];
 Function Length(s : string) : byte; [INTERNPROC: In_Length_string];
 Function Length(s : string) : byte; [INTERNPROC: In_Length_string];
@@ -139,7 +139,7 @@ Procedure incr_ansi_ref (P : pointer);[Alias : 'INCR_ANSI_REF'];
 ****************************************************************************}
 ****************************************************************************}
 
 
 {$ifndef VER0_99_5}
 {$ifndef VER0_99_5}
-{$i rtti.inc}
+  {$i rtti.inc}
 {$endif  VER0_99_5}
 {$endif  VER0_99_5}
 
 
 {****************************************************************************
 {****************************************************************************
@@ -158,7 +158,7 @@ begin
    Lo := b and $0f
    Lo := b and $0f
 end;
 end;
 
 
-{$ifndef INTERN_INC}
+{$ifdef VER0_99_5}
 
 
 Procedure Inc(var i : Cardinal;a: Longint);
 Procedure Inc(var i : Cardinal;a: Longint);
 Begin
 Begin
@@ -240,7 +240,7 @@ Begin
   longint(p):=longint(p)+a;
   longint(p):=longint(p)+a;
 End;
 End;
 
 
-{$endif INTERN_INC}
+{$endif VER0_99_5}
 
 
 Function swap (X : Word) : Word;
 Function swap (X : Word) : Word;
 Begin
 Begin
@@ -262,11 +262,11 @@ Begin
   Swap:=Swap(Longint(X));
   Swap:=Swap(Longint(X));
 End;
 End;
 
 
-
 {$endif RTLLITE}
 {$endif RTLLITE}
-{****************************************************************************
-                              Random function routines
 
 
+{****************************************************************************
+                          Random function routines
+			      
 	This implements a very long cycle random number generator by combining
 	This implements a very long cycle random number generator by combining
    three independant generators.  The technique was described in the March
    three independant generators.  The technique was described in the March
    1987 issue of Byte.
    1987 issue of Byte.
@@ -337,12 +337,11 @@ begin
 end;
 end;
 
 
 
 
-
 { Include processor specific routines }
 { Include processor specific routines }
 {$I math.inc}
 {$I math.inc}
 
 
 {****************************************************************************
 {****************************************************************************
-                                                         Memory Management
+                            Memory Management
 ****************************************************************************}
 ****************************************************************************}
 
 
 {$ifndef RTLLITE}
 {$ifndef RTLLITE}
@@ -376,7 +375,7 @@ End;
 {$endif RTLLITE}
 {$endif RTLLITE}
 
 
 {*****************************************************************************
 {*****************************************************************************
-                                                         Miscellaneous
+                             Miscellaneous
 *****************************************************************************}
 *****************************************************************************}
 
 
 
 
@@ -415,9 +414,9 @@ Procedure dump_stack(bp : Longint);
   Begin
   Begin
   {To be used by symify}
   {To be used by symify}
     Writeln(stderr,'  0x',HexStr(addr,8));
     Writeln(stderr,'  0x',HexStr(addr,8));
-{$IFNDEF NEW_READWRITE}
+{$ifdef VER0_99_5}
     Flush(stderr);
     Flush(stderr);
-{$ENDIF NEW_READWRITE}
+{$endif VER0_99_5}
   End;
   End;
 
 
 var
 var
@@ -456,9 +455,9 @@ Begin
      Writeln('Run time error  ',Errorcode,' at 0x',hexstr(Longint(Erroraddr),8));
      Writeln('Run time error  ',Errorcode,' at 0x',hexstr(Longint(Erroraddr),8));
      dump_stack(ErrorBase);
      dump_stack(ErrorBase);
    End;
    End;
-{$IFNDEF NEW_READWRITE}
+{$ifdef VER0_99_5}
   Flush(stderr);
   Flush(stderr);
-{$ENDIF NEW_READWRITE}
+{$endif VER0_99_5}
 End;
 End;
 
 
 
 
@@ -503,7 +502,6 @@ End;
 *****************************************************************************}
 *****************************************************************************}
 
 
 Procedure do_assert (Const Name,Msg : string; LineNo : Longint); [Public,Alias : 'FPC_DO_ASSERT'];
 Procedure do_assert (Const Name,Msg : string; LineNo : Longint); [Public,Alias : 'FPC_DO_ASSERT'];
-
 begin
 begin
   If msg='' then
   If msg='' then
     write (stderr,'Assertion failed. ')
     write (stderr,'Assertion failed. ')
@@ -514,22 +512,28 @@ begin
   HandleError (227);
   HandleError (227);
 end;
 end;
 
 
+
 {*****************************************************************************
 {*****************************************************************************
       SetJmp/LongJmp support.
       SetJmp/LongJmp support.
 *****************************************************************************}
 *****************************************************************************}
 
 
 {$i setjump.inc}
 {$i setjump.inc}
 
 
+
 {*****************************************************************************
 {*****************************************************************************
       Exception support.
       Exception support.
 *****************************************************************************}
 *****************************************************************************}
 
 
-// No go, because objpas needed :( (MVC)
-{  $i except.inc}
+{ No go, because objpas needed :( (MVC) }
+{ $i except.inc}
+
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.25  1998-07-30 13:26:18  michael
+  Revision 1.26  1998-08-11 00:05:26  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.25  1998/07/30 13:26:18  michael
   + Added support for ErrorProc variable. All internal functions are required
   + Added support for ErrorProc variable. All internal functions are required
     to call HandleError instead of runerror from now on.
     to call HandleError instead of runerror from now on.
     This is necessary for exception support.
     This is necessary for exception support.

+ 22 - 8
rtl/inc/systemh.inc

@@ -14,8 +14,14 @@
 
 
 {*****************************************************************************
 {*****************************************************************************
    This File contains the OS independent declarations of the system unit
    This File contains the OS independent declarations of the system unit
+
+   Possible defines:
+   -----------------
+   RTLLITE         Create a somewhat smaller RTL
+   
 *****************************************************************************}
 *****************************************************************************}
 
 
+
 {****************************************************************************
 {****************************************************************************
                    Support for multiple compiler versions
                    Support for multiple compiler versions
 ****************************************************************************}
 ****************************************************************************}
@@ -35,12 +41,18 @@ Type
 
 
 { at least declare Turbo Pascal real types }
 { at least declare Turbo Pascal real types }
 {$ifdef i386}
 {$ifdef i386}
-  Double = real;
-  ValReal = Extended;
-  {$define SUPPORT_EXTENDED}
+  {$ifndef VER0_99_5}
+    {$define SUPPORT_EXTENDED}
+  {$endif}  
   {$define SUPPORT_COMP}
   {$define SUPPORT_COMP}
   {$define SUPPORT_SINGLE}
   {$define SUPPORT_SINGLE}
   {$define SUPPORT_FIXED}
   {$define SUPPORT_FIXED}
+  Double = real;
+  {$ifdef SUPPORT_EXTENDED}
+    ValReal = Extended;
+  {$else}    
+    ValReal = Double;
+  {$endif}  
 {$endif}
 {$endif}
 
 
 {$ifdef m68k}
 {$ifdef m68k}
@@ -140,7 +152,7 @@ Function  Swap (X:Integer):Integer;
 Function  Swap (X:Cardinal):Cardinal;
 Function  Swap (X:Cardinal):Cardinal;
 Function  Swap (X:Longint):Longint;
 Function  Swap (X:Longint):Longint;
 
 
-{$ifndef INTERN_INC}
+{$ifdef VER0_99_5}
 Procedure Inc(Var i:cardinal);
 Procedure Inc(Var i:cardinal);
 Procedure Inc(Var i:Longint);
 Procedure Inc(Var i:Longint);
 Procedure Inc(Var i:Integer);
 Procedure Inc(Var i:Integer);
@@ -173,7 +185,7 @@ Procedure Dec(Var c:Char;a:Longint);
 Procedure Inc(Var c:Char;a:Longint);
 Procedure Inc(Var c:Char;a:Longint);
 Procedure Dec(Var p:PChar;a:Longint);
 Procedure Dec(Var p:PChar;a:Longint);
 Procedure Inc(Var p:PChar;a:Longint);
 Procedure Inc(Var p:PChar;a:Longint);
-{$endif INTERN_INC}
+{$endif VER0_99_5}
 
 
 {$endif RTLLITE}
 {$endif RTLLITE}
 Function Chr(b:byte):Char;
 Function Chr(b:byte):Char;
@@ -254,8 +266,7 @@ Procedure Val(const s:string;Var d:single);
 {$endif SUPPORT_SINGLE}
 {$endif SUPPORT_SINGLE}
 {$ifdef SUPPORT_EXTENDED}
 {$ifdef SUPPORT_EXTENDED}
 { if extended is supported, valreal is an extended, so we
 { if extended is supported, valreal is an extended, so we
-  have to define the real routines
-}
+  have to define the real routines }
 Procedure Val(const s:string;Var d:Real;Var code:Word);
 Procedure Val(const s:string;Var d:Real;Var code:Word);
 Procedure Val(const s:string;Var d:Real;Var code:Integer);
 Procedure Val(const s:string;Var d:Real;Var code:Integer);
 Procedure Val(const s:string;Var d:Real);
 Procedure Val(const s:string;Var d:Real);
@@ -415,7 +426,10 @@ Procedure halt;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.22  1998-08-08 12:28:14  florian
+  Revision 1.23  1998-08-11 00:05:27  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.22  1998/08/08 12:28:14  florian
     * a lot small fixes to the extended data type work
     * a lot small fixes to the extended data type work
 
 
   Revision 1.21  1998/07/30 13:26:17  michael
   Revision 1.21  1998/07/30 13:26:17  michael

+ 17 - 10
rtl/inc/text.inc

@@ -590,7 +590,7 @@ Begin
 End;
 End;
 
 
 
 
-{$IFNDEF NEW_READWRITE}
+{$ifdef VER0_99_5}
 Procedure w(var t : TextRec);[Public,Alias: 'WRITELN_TEXT'];
 Procedure w(var t : TextRec);[Public,Alias: 'WRITELN_TEXT'];
 var
 var
   hs : String;
   hs : String;
@@ -603,7 +603,7 @@ Begin
   {$ENDIF}
   {$ENDIF}
   Write_Str(0,t,hs);
   Write_Str(0,t,hs);
 End;
 End;
-{$ENDIF NEW_READWRITE}
+{$endif VER0_99_5}
 
 
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -729,7 +729,8 @@ Begin
    FileFunc(f.FlushFunc)(f);
    FileFunc(f.FlushFunc)(f);
 End;
 End;
 
 
-{$ifndef MAXLENREADSTRING}
+
+{$ifdef VER0_99_5}
 Procedure Read_String(var f : TextRec;var s : String);[Public,Alias: 'READ_TEXT_STRING'];
 Procedure Read_String(var f : TextRec;var s : String);[Public,Alias: 'READ_TEXT_STRING'];
 var
 var
   Temp,sPos : Word;
   Temp,sPos : Word;
@@ -771,7 +772,9 @@ Begin
    End;
    End;
   s[0]:=chr(sPos-1);
   s[0]:=chr(sPos-1);
 End;
 End;
-{$ELSE}
+
+{$else VER0_99_5}
+
 Procedure Read_String(Maxlen : Longint;var f : TextRec;var s : String);[Public,Alias:'READ_TEXT_STRING'];
 Procedure Read_String(Maxlen : Longint;var f : TextRec;var s : String);[Public,Alias:'READ_TEXT_STRING'];
 var
 var
   Temp,sPos,nrread : Word;
   Temp,sPos,nrread : Word;
@@ -817,7 +820,8 @@ Begin
    End;
    End;
   s[0]:=chr(sPos-1);
   s[0]:=chr(sPos-1);
 End;
 End;
-{$ENDIF MAXLENREADSTRING}
+{$endif VER0_99_5}
+
 
 
 Procedure Read_Char(var f : TextRec;var c : Char);[Public,Alias: 'READ_TEXT_CHAR'];
 Procedure Read_Char(var f : TextRec;var c : Char);[Public,Alias: 'READ_TEXT_CHAR'];
 Begin
 Begin
@@ -900,14 +904,13 @@ Begin
   p^:=#0;
   p^:=#0;
 End;
 End;
 
 
+
 {$ifdef useansistrings}
 {$ifdef useansistrings}
 Procedure Read_String(Maxlen : Longint;var f : TextRec;var s : AnsiString);[Public,Alias: 'READ_TEXT_ANSISTRING'];
 Procedure Read_String(Maxlen : Longint;var f : TextRec;var s : AnsiString);[Public,Alias: 'READ_TEXT_ANSISTRING'];
-
 var
 var
   p    : PChar;
   p    : PChar;
   Temp : byte;
   Temp : byte;
   len  : Longint;
   len  : Longint;
-
 Begin
 Begin
 { Delete the string }
 { Delete the string }
   Decr_ansi_ref (S);
   Decr_ansi_ref (S);
@@ -942,6 +945,7 @@ Begin
 End;
 End;
 {$endif}
 {$endif}
 
 
+
 Procedure Read_Longint(var f : TextRec;var l : Longint);[Public,Alias: 'READ_TEXT_LONGINT'];
 Procedure Read_Longint(var f : TextRec;var l : Longint);[Public,Alias: 'READ_TEXT_LONGINT'];
 var
 var
   hs   : String;
   hs   : String;
@@ -1150,7 +1154,7 @@ End;
 {$endif SUPPORT_COMP}
 {$endif SUPPORT_COMP}
 
 
 
 
-{$IFNDEF NEW_READWRITE}
+{$ifdef VER0_99_5}
 Procedure r(var f : TextRec);[Public,Alias: 'READLN_TEXT'];
 Procedure r(var f : TextRec);[Public,Alias: 'READLN_TEXT'];
 Begin
 Begin
   If InOutRes <> 0 then exit;
   If InOutRes <> 0 then exit;
@@ -1165,7 +1169,7 @@ Begin
       FileFunc(f.InOutFunc)(f);
       FileFunc(f.InOutFunc)(f);
    end;
    end;
 End;
 End;
-{$ENDIF NEW_READWRITE}
+{$endif VER0_99_5}
 
 
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -1192,7 +1196,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1998-07-30 13:26:16  michael
+  Revision 1.20  1998-08-11 00:05:28  peter
+    * $ifdef ver0_99_5 updates
+
+  Revision 1.19  1998/07/30 13:26:16  michael
   + Added support for ErrorProc variable. All internal functions are required
   + Added support for ErrorProc variable. All internal functions are required
     to call HandleError instead of runerror from now on.
     to call HandleError instead of runerror from now on.
     This is necessary for exception support.
     This is necessary for exception support.