浏览代码

* avoid need of GetLastOSError under OS/2

git-svn-id: trunk@22983 -
Tomas Hajny 12 年之前
父节点
当前提交
688c0a6f3c
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      packages/fcl-base/src/syncobjs.pp

+ 13 - 0
packages/fcl-base/src/syncobjs.pp

@@ -83,6 +83,15 @@ implementation
     Real syncobjs implementation
     Real syncobjs implementation
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
+{$IFDEF OS2}
+type
+  TBasicEventState = record
+                      FHandle: THandle;
+                      FLastError: longint;
+                     end;
+  PLocalEventRec = ^TBasicEventState;
+{$ENDIF OS2}
+
 procedure TSynchroObject.Acquire;
 procedure TSynchroObject.Acquire;
 begin
 begin
 end;
 end;
@@ -168,7 +177,11 @@ function TEventObject.WaitFor(Timeout : Cardinal) : TWaitResult;
 begin
 begin
   Result := TWaitResult(basiceventWaitFor(Timeout, Handle));
   Result := TWaitResult(basiceventWaitFor(Timeout, Handle));
   if Result = wrError then
   if Result = wrError then
+{$IFDEF OS2}
+    FLastError := PLocalEventRec (Handle)^.FLastError;
+{$ELSE OS2}
     FLastError := GetLastOSError;
     FLastError := GetLastOSError;
+{$ENDIF OS2}
 end;
 end;
 
 
 constructor TSimpleEvent.Create;
 constructor TSimpleEvent.Create;