Browse Source

o patch by Sven Barth, resolves #17827
* text.inc used Std*Handle without checking if the feature CONSOLEIO is present, fixed
* OpenStdIO should use the type THandle for the hdl parameter, fixed

git-svn-id: trunk@16309 -

florian 14 years ago
parent
commit
18011b99cc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rtl/inc/text.inc

+ 3 - 1
rtl/inc/text.inc

@@ -115,10 +115,12 @@ Begin
         { Write pending buffer }
         { Write pending buffer }
         If Textrec(t).Mode=fmoutput then
         If Textrec(t).Mode=fmoutput then
           FileFunc(TextRec(t).InOutFunc)(TextRec(t));
           FileFunc(TextRec(t).InOutFunc)(TextRec(t));
+{$ifdef FPC_HAS_FEATURE_CONSOLEIO}
         { Only close functions not connected to stdout.}
         { Only close functions not connected to stdout.}
         If ((TextRec(t).Handle<>StdInputHandle) and
         If ((TextRec(t).Handle<>StdInputHandle) and
             (TextRec(t).Handle<>StdOutputHandle) and
             (TextRec(t).Handle<>StdOutputHandle) and
             (TextRec(t).Handle<>StdErrorHandle)) Then
             (TextRec(t).Handle<>StdErrorHandle)) Then
+{$endif FPC_HAS_FEATURE_CONSOLEIO}
           FileFunc(TextRec(t).CloseFunc)(TextRec(t));
           FileFunc(TextRec(t).CloseFunc)(TextRec(t));
         TextRec(t).mode := fmClosed;
         TextRec(t).mode := fmClosed;
         { Reset buffer for safety }
         { Reset buffer for safety }
@@ -1774,7 +1776,7 @@ end;
                                Initializing
                                Initializing
 *****************************************************************************}
 *****************************************************************************}
 
 
-procedure OpenStdIO(var f:text;mode,hdl:longint);
+procedure OpenStdIO(var f:text;mode:longint;hdl:thandle);
 begin
 begin
   Assign(f,'');
   Assign(f,'');
   TextRec(f).Handle:=hdl;
   TextRec(f).Handle:=hdl;