فهرست منبع

* Fix bug #33204

git-svn-id: trunk@38327 -
michael 7 سال پیش
والد
کامیت
77caa28bab
2فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 1 0
      rtl/objpas/sysutils/osutilsh.inc
  2. 7 0
      rtl/objpas/sysutils/sysutils.inc

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

@@ -21,6 +21,7 @@ Function GetLastOSError : Integer;
 {$endif}
 {$endif}
 Procedure RaiseLastOSError;overload;
 Procedure RaiseLastOSError;overload;
 Procedure RaiseLastOSError(LastError: Integer);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 : AnsiString) : AnsiString;
 Function GetEnvironmentVariable(Const EnvVar : UnicodeString) : UnicodeString;
 Function GetEnvironmentVariable(Const EnvVar : UnicodeString) : UnicodeString;

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

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