Selaa lähdekoodia

* SetTextLineEnding implemented, FileRec.Name position alignment for CPU64

Tomas Hajny 21 vuotta sitten
vanhempi
commit
85320d6787
4 muutettua tiedostoa jossa 37 lisäystä ja 14 poistoa
  1. 7 4
      compiler/symdef.pas
  2. 5 2
      rtl/inc/filerec.inc
  3. 11 5
      rtl/inc/text.inc
  4. 14 3
      rtl/inc/textrec.inc

+ 7 - 4
compiler/symdef.pas

@@ -2237,15 +2237,15 @@ implementation
 {$ifdef cpu64bit}
         case filetyp of
           ft_text :
-            savesize:=608;
+            savesize:=612;
           ft_typed,
           ft_untyped :
-            savesize:=320;
+            savesize:=352;
         end;
 {$else cpu64bit}
         case filetyp of
           ft_text :
-            savesize:=572;
+            savesize:=576;
           ft_typed,
           ft_untyped :
             savesize:=316;
@@ -6184,7 +6184,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.255  2004-09-21 17:25:12  peter
+  Revision 1.256  2004-09-21 23:36:51  hajny
+    * SetTextLineEnding implemented, FileRec.Name position alignment for CPU64
+
+  Revision 1.255  2004/09/21 17:25:12  peter
     * paraloc branch merged
 
   Revision 1.254  2004/09/14 16:33:17  peter

+ 5 - 2
rtl/inc/filerec.inc

@@ -28,14 +28,17 @@ type
     Handle    : THandle;
     Mode      : longint;
     RecSize   : SizeInt;
-    _private  : array[1..32] of byte;
+    _private  : array[1..3 * SizeOf(SizeInt) + 5 * SizeOf (pointer)] of byte;
     UserData  : array[1..16] of byte;
     name      : array[0..filerecnamelength] of char;
   End;
 
 {
   $Log$
-  Revision 1.5  2004-02-05 01:16:12  florian
+  Revision 1.6  2004-09-21 23:36:51  hajny
+    * SetTextLineEnding implemented, FileRec.Name position alignment for CPU64
+
+  Revision 1.5  2004/02/05 01:16:12  florian
     + completed x86-64/linux system unit
 
   Revision 1.4  2003/11/03 09:42:27  marco

+ 11 - 5
rtl/inc/text.inc

@@ -87,6 +87,7 @@ Begin
   TextRec(t).BufSize:=TextRecBufSize;
   TextRec(t).Bufptr:=@TextRec(t).Buffer;
   TextRec(t).OpenFunc:=@FileOpenFunc;
+  TextRec(t).LineEnd:=LineEnding;
   Move(s[1],TextRec(t).Name,Length(s));
 End;
 
@@ -435,6 +436,11 @@ Begin
   TextRec(f).BufEnd:=0;
 End;
 
+Procedure SetTextLineEnding(Var f:Text; Ending:string);
+Begin
+  TextRec(F).LineEnd:=Ending;
+End;
+
 
 {*****************************************************************************
                                Write(Ln)
@@ -489,16 +495,13 @@ end;
 
 
 Procedure fpc_Writeln_End(var f:Text);[Public,Alias:'FPC_WRITELN_END']; iocheck; {$ifdef hascompilerproc} compilerproc; {$endif}
-var
-  eol : array[0..3] of char;
 begin
   If InOutRes <> 0 then exit;
   case TextRec(f).mode of
     fmOutput { fmAppend gets changed to fmOutPut in do_open (JM) }:
       begin
-        eol:=sLineBreak;
         { Write EOL }
-        fpc_WriteBuffer(f,eol,length(sLineBreak));
+        fpc_WriteBuffer(f,TextRec(f).LineEnd[1],length(TextRec(f).LineEnd));
         { Flush }
         if TextRec(f).FlushFunc<>nil then
           FileFunc(TextRec(f).FlushFunc)(TextRec(f));
@@ -1274,7 +1277,10 @@ end;
 
 {
   $Log$
-  Revision 1.25  2004-08-20 10:04:39  olle
+  Revision 1.26  2004-09-21 23:36:51  hajny
+    * SetTextLineEnding implemented, FileRec.Name position alignment for CPU64
+
+  Revision 1.25  2004/08/20 10:04:39  olle
   * prefixed write[buffer|blanks] with fpc_ and made them externally visible
 
   Revision 1.24  2004/06/21 18:48:48  olle

+ 14 - 3
rtl/inc/textrec.inc

@@ -25,12 +25,17 @@ const
   TextRecNameLength = 256;
   TextRecBufSize    = 256;
 type
+  TLineEndStr = string [3];
   TextBuf = array[0..TextRecBufSize-1] of char;
   TextRec = Packed Record
     Handle    : THandle;
     Mode      : longint;
-    bufsize,
-    _private,
+    bufsize   : SizeInt;
+{$IFDEF FPC_LINEEND_IN_TEXTREC}
+    _private  : SizeInt;
+{$ELSE FPC_LINEEND_IN_TEXTREC}
+    LineEnd   : TLineEndStr;
+{$ENDIF FPC_LINEEND_IN_TEXTREC}
     bufpos,
     bufend    : SizeInt;
     bufptr    : ^textbuf;
@@ -40,12 +45,18 @@ type
     closefunc : pointer;
     UserData  : array[1..16] of byte;
     name      : array[0..textrecnamelength-1] of char;
+{$IFDEF FPC_LINEEND_IN_TEXTREC}
+    LineEnd   : TLineEndStr;
+{$ENDIF FPC_LINEEND_IN_TEXTREC}
     buffer    : textbuf;
   End;
 
 {
   $Log$
-  Revision 1.6  2004-05-18 20:16:23  peter
+  Revision 1.7  2004-09-21 23:36:51  hajny
+    * SetTextLineEnding implemented, FileRec.Name position alignment for CPU64
+
+  Revision 1.6  2004/05/18 20:16:23  peter
     * unix thandle is always 32bit
     * textrec fixed for 64bit