2
0
Эх сурвалжийг харах

* Fix bug #33204

git-svn-id: trunk@38327 -
michael 7 жил өмнө
parent
commit
77caa28bab

+ 1 - 0
rtl/objpas/sysutils/osutilsh.inc

@@ -21,6 +21,7 @@ Function GetLastOSError : Integer;
 {$endif}
 Procedure RaiseLastOSError;overload;
 Procedure RaiseLastOSError(LastError: Integer);overload;
+procedure CheckOSError(LastError: Integer);platform;{$ifdef SYSTEMINLINE}inline;{$endif}
 
 Function GetEnvironmentVariable(Const EnvVar : AnsiString) : AnsiString;
 Function GetEnvironmentVariable(Const EnvVar : UnicodeString) : UnicodeString;

+ 7 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -471,6 +471,13 @@ begin
 end;
 
 {$endif}
+
+procedure CheckOSError(LastError: Integer);
+begin
+  if LastError <> 0 then
+    RaiseLastOSError(LastError);
+end;
+
 Procedure AssertErrorHandler (Const Msg,FN : ShortString;LineNo:longint; TheAddr : pointer);
 Var
   S : String;