Przeglądaj źródła

* avoid need of GetLastOSError under OS/2

git-svn-id: trunk@22983 -
Tomas Hajny 12 lat temu
rodzic
commit
688c0a6f3c
1 zmienionych plików z 13 dodań i 0 usunięć
  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
   ---------------------------------------------------------------------}
 
+{$IFDEF OS2}
+type
+  TBasicEventState = record
+                      FHandle: THandle;
+                      FLastError: longint;
+                     end;
+  PLocalEventRec = ^TBasicEventState;
+{$ENDIF OS2}
+
 procedure TSynchroObject.Acquire;
 begin
 end;
@@ -168,7 +177,11 @@ function TEventObject.WaitFor(Timeout : Cardinal) : TWaitResult;
 begin
   Result := TWaitResult(basiceventWaitFor(Timeout, Handle));
   if Result = wrError then
+{$IFDEF OS2}
+    FLastError := PLocalEventRec (Handle)^.FLastError;
+{$ELSE OS2}
     FLastError := GetLastOSError;
+{$ENDIF OS2}
 end;
 
 constructor TSimpleEvent.Create;