Browse Source

Adapt sources to FPC_DOTTEDUNITS

Pierre Muller 2 years ago
parent
commit
e16364b567
4 changed files with 31 additions and 31 deletions
  1. 2 2
      rtl/wince/dos.pp
  2. 11 11
      rtl/wince/sysutils.pp
  3. 1 1
      rtl/wince/wininc/cemiss.inc
  4. 17 17
      rtl/wince/wininc/messages.inc

+ 2 - 2
rtl/wince/dos.pp

@@ -274,7 +274,7 @@ begin
           Inc(i);
         end;
       until (i > 24) or not FindNextFile(h, fd);
-      Windows.FindClose(h);
+      {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.FindClose(h);
     end;
   end;
   GetDriveName:=DriveNames[drive - 2];
@@ -405,7 +405,7 @@ end;
 Procedure FindClose(Var f: SearchRec);
 begin
   If F.FindHandle <> Invalid_Handle_value then
-    Windows.FindClose(F.FindHandle);
+    {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.FindClose(F.FindHandle);
 end;
 
 

+ 11 - 11
rtl/wince/sysutils.pp

@@ -56,7 +56,7 @@ uses
 {$i sysutilh.inc}
 
 type
-  TSystemTime = Windows.TSystemTime;
+  TSystemTime = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TSystemTime;
 
   EWinCEError = class(Exception)
   public
@@ -257,13 +257,13 @@ end;
 
 Function DosToWinTime (DTime:longint; out Wtime : TFileTime):longbool;
 begin
-  DosToWinTime:=dos.DosToWinTime(DTime, Wtime);
+  DosToWinTime:={$ifdef FPC_DOTTEDUNITS}TP.{$endif}dos.DosToWinTime(DTime, Wtime);
 end;
 
 
 Function WinToDosTime (Const Wtime : TFileTime; out DTime:longint):longbool;
 begin
-  WinToDosTime:=dos.WinToDosTime(Wtime, DTime);
+  WinToDosTime:={$ifdef FPC_DOTTEDUNITS}TP.{$endif}dos.WinToDosTime(Wtime, DTime);
 end;
 
 
@@ -276,7 +276,7 @@ begin
   Handle := FindFirstFile(PWideChar(FileName), FindData);
   if Handle <> INVALID_HANDLE_VALUE then
     begin
-      Windows.FindClose(Handle);
+      {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.FindClose(Handle);
       if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
         If WinToDosTime(FindData.ftLastWriteTime,tmpdtime) then
           begin
@@ -390,7 +390,7 @@ end;
 Procedure InternalFindClose (var Handle: THandle; var FindData: TFindData);
 begin
    if Handle <> INVALID_HANDLE_VALUE then
-     Windows.FindClose(Handle);
+     {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.FindClose(Handle);
 end;
 
 
@@ -441,7 +441,7 @@ end;
 
 Function DeleteFile (Const FileName : UnicodeString) : Boolean;
 begin
-  DeleteFile:=Windows.DeleteFile(PWideChar(FileName));
+  DeleteFile:={$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.DeleteFile(PWideChar(FileName));
 end;
 
 
@@ -457,13 +457,13 @@ end;
 
 function diskfree(drive : byte) : int64;
 begin
-  Result := Dos.diskfree(drive);
+  Result := {$ifdef FPC_DOTTEDUNITS}TP.{$endif}Dos.diskfree(drive);
 end;
 
 
 function disksize(drive : byte) : int64;
 begin
-  Result := Dos.disksize(drive);
+  Result := {$ifdef FPC_DOTTEDUNITS}TP.{$endif}Dos.disksize(drive);
 end;
 
 
@@ -474,12 +474,12 @@ end;
 
 Procedure GetLocalTime(var SystemTime: TSystemTime);
 begin
-  windows.Getlocaltime(SystemTime);
+  {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}windows.Getlocaltime(SystemTime);
 end;
 
 function GetUniversalTime(var SystemTime: TSystemTime): Boolean;
 begin
-  windows.GetSystemTime(SystemTime);
+  {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}windows.GetSystemTime(SystemTime);
   Result:=True;
 end;
 
@@ -754,7 +754,7 @@ end;
 Procedure Sleep(Milliseconds : Cardinal);
 
 begin
-  Windows.Sleep(MilliSeconds)
+  {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.Sleep(MilliSeconds)
 end;
 
 Function GetLastOSError : Integer;

+ 1 - 1
rtl/wince/wininc/cemiss.inc

@@ -42,7 +42,7 @@ function LoadLibraryA(lpLibFileName:LPCSTR):HINST;
 var  ws: PWideChar;
 begin
   ws:=PCharToPWideChar(lpLibFileName);
-  Result:=Windows.LoadLibrary(ws);
+  Result:={$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.LoadLibrary(ws);
   FreeMem(ws);
 end;
 

+ 17 - 17
rtl/wince/wininc/messages.inc

@@ -1186,23 +1186,23 @@ const
 Type
 {$ifdef MESSAGESUNIT}
 
-    MSG                 = Windows.MSG;
-    TMessage            = Windows.TMessage;
-    TWMSize             = Windows.TWMSize;
-    TWMNoParams         = Windows.TWMNoParams;
-    TWMScroll           = Windows.TWMScroll;
-    TWMGetText          = Windows.TWMGetText;
-    TWMKillFocus        = Windows.TWMKillFocus;
-    TWMSetCursor        = Windows.TWMSetCursor;
-    TWMSetFocus         = Windows.TWMSetFocus;
-    TWMSetFont          = Windows.TWMSetFont;
-    TWMShowWindow       = Windows.TWMShowWindow;
-    TWMEraseBkgnd       = Windows.TWMEraseBkgnd;
-    LPMSG               = ^Windows.MSG;
-    tagMSG              = Windows.tagMSG;
-    TMSG                = Windows.TMSG;
-    PMSG                = Windows.PMSG;
-    PMessage            = Windows.PMessage;
+    MSG                 = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.MSG;
+    TMessage            = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TMessage;
+    TWMSize             = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMSize;
+    TWMNoParams         = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMNoParams;
+    TWMScroll           = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMScroll;
+    TWMGetText          = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMGetText;
+    TWMKillFocus        = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMKillFocus;
+    TWMSetCursor        = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMSetCursor;
+    TWMSetFocus         = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMSetFocus;
+    TWMSetFont          = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMSetFont;
+    TWMShowWindow       = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMShowWindow;
+    TWMEraseBkgnd       = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TWMEraseBkgnd;
+    LPMSG               = ^{$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.MSG;
+    tagMSG              = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.tagMSG;
+    TMSG                = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.TMSG;
+    PMSG                = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.PMSG;
+    PMessage            = {$ifdef FPC_DOTTEDUNITS}WinApi.{$endif}Windows.PMessage;
     TWMGetDlgCode       = TWMNoParams;
     TWMFontChange       = TWMNoParams;
     TWMGetFont          = TWMNoParams;