Browse Source

* Under win32, standard input and output are not guaranteed to have descriptors 0,1 and 2

michael 25 years ago
parent
commit
b38526bfea
1 changed files with 8 additions and 0 deletions
  1. 8 0
      fcl/inc/iostream.pp

+ 8 - 0
fcl/inc/iostream.pp

@@ -44,7 +44,15 @@ Const
 Constructor TIOStream.Create(IOSType : TiosType);
 
 begin
+{$ifdef win32}
+  Case IOSType of 
+    iosOutput : FType:=Stdoutputhandle;
+    iosInput : FType:=Stdinputhandle;
+    iosError : FType:=StdErrorHandle;
+  end;
+{$else}
   FType:=Ord(IOSType);
+{$endif}  
   Inherited Create(Ftype);
 end;