mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 04:17:53 +01:00
+ Implemented RaiseLastOSError
This commit is contained in:
parent
71f7e0928b
commit
e31cf3e728
@ -15,6 +15,10 @@
|
||||
|
||||
{ OS handling utilities }
|
||||
|
||||
{$ifdef HAS_OSERROR}
|
||||
Function GetLastOSError : Integer;
|
||||
{$endif}
|
||||
Procedure RaiseLastOSError;
|
||||
Function GetEnvironmentVariable(Const EnvVar : String) : String;
|
||||
{$IFDEF HAS_SLEEP}
|
||||
procedure Sleep(milliseconds: Cardinal);
|
||||
@ -23,7 +27,10 @@ function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integ
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.4 2004-01-10 17:34:36 michael
|
||||
Revision 1.5 2004-02-08 11:02:40 michael
|
||||
+ Implemented RaiseLastOSError
|
||||
|
||||
Revision 1.4 2004/01/10 17:34:36 michael
|
||||
+ Implemented sleep() on Unix.
|
||||
|
||||
Revision 1.3 2004/01/05 22:37:24 florian
|
||||
|
||||
@ -248,7 +248,29 @@ begin
|
||||
{$endif VER1_0}
|
||||
end;
|
||||
|
||||
{$IFDEF HAS_OSERROR}
|
||||
Procedure RaiseLastOSError;
|
||||
|
||||
var
|
||||
ECode: Cardinal;
|
||||
E : EOSError;
|
||||
|
||||
begin
|
||||
ECode := GetLastOSError;
|
||||
If (ECode<>0) then
|
||||
E:=EOSError.CreateFmt(SOSError, [ECode, SysErrorMessage(ECode)])
|
||||
else
|
||||
E:=EOSError.Create(SUnkOSError);
|
||||
E.ErrorCode:=ECode;
|
||||
Raise E;
|
||||
end;
|
||||
{$else}
|
||||
Procedure RaiseLastOSError;
|
||||
|
||||
begin
|
||||
Raise Exception.Create('RaiseLastOSError not implemented on this platform.');
|
||||
end;
|
||||
{$endif}
|
||||
Procedure AssertErrorHandler (Const Msg,FN : ShortString;LineNo:longint; TheAddr : pointer);
|
||||
Var
|
||||
S : String;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user