소스 검색

* 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}
 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;