summaryrefslogtreecommitdiff
path: root/gcc/ada/s-osprim-mingw.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-14 16:23:18 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-14 16:23:18 +0000
commitab2ba306f09948ff09fef49f3592d714c38b2d93 (patch)
treeb12d13d305b3e049e0907c34ad5d505ce04fa415 /gcc/ada/s-osprim-mingw.adb
parenta39fe8c82fd895251538269b679047bd6fc98ac5 (diff)
downloadgcc-ab2ba306f09948ff09fef49f3592d714c38b2d93.tar.gz
2008-04-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r134275 stilly buggy for libgcc muldi3: internal compiler error: in execute_ipa_pass_list, at passes.c:1235 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@134279 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-osprim-mingw.adb')
-rw-r--r--gcc/ada/s-osprim-mingw.adb56
1 files changed, 14 insertions, 42 deletions
diff --git a/gcc/ada/s-osprim-mingw.adb b/gcc/ada/s-osprim-mingw.adb
index ff1c9a31baa..d9712858c39 100644
--- a/gcc/ada/s-osprim-mingw.adb
+++ b/gcc/ada/s-osprim-mingw.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2008, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -33,40 +33,12 @@
-- This is the NT version of this package
-with Interfaces.C;
+with System.Win32.Ext;
package body System.OS_Primitives is
- ---------------------------
- -- Win32 API Definitions --
- ---------------------------
-
- -- These definitions are copied from System.OS_Interface because we do not
- -- want to depend on gnarl here.
-
- type DWORD is new Interfaces.C.unsigned_long;
-
- type LARGE_INTEGER is delta 1.0 range -2.0**63 .. 2.0**63 - 1.0;
-
- type BOOL is new Boolean;
- for BOOL'Size use Interfaces.C.unsigned_long'Size;
-
- procedure GetSystemTimeAsFileTime
- (lpFileTime : not null access Long_Long_Integer);
- pragma Import (Stdcall, GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime");
-
- function QueryPerformanceCounter
- (lpPerformanceCount : not null access LARGE_INTEGER) return BOOL;
- pragma Import
- (Stdcall, QueryPerformanceCounter, "QueryPerformanceCounter");
-
- function QueryPerformanceFrequency
- (lpFrequency : not null access LARGE_INTEGER) return BOOL;
- pragma Import
- (Stdcall, QueryPerformanceFrequency, "QueryPerformanceFrequency");
-
- procedure Sleep (dwMilliseconds : DWORD);
- pragma Import (Stdcall, Sleep, External_Name => "Sleep");
+ use System.Win32;
+ use System.Win32.Ext;
----------------------------------------
-- Data for the high resolution clock --
@@ -144,7 +116,7 @@ package body System.OS_Primitives is
Now : aliased Long_Long_Integer;
begin
- if not QueryPerformanceCounter (Current_Ticks'Access) then
+ if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then
return 0.0;
end if;
@@ -158,10 +130,10 @@ package body System.OS_Primitives is
Duration (Long_Long_Float (Current_Ticks - BTA.all) /
Long_Long_Float (TFA.all));
- -- If we have a shift of more than Max_Shift seconds we resynchonize the
- -- Clock. This is probably due to a manual Clock adjustment, an DST
- -- adjustment or an NTP synchronisation. And we want to adjust the time
- -- for this system (non-monotonic) clock.
+ -- If we have a shift of more than Max_Shift seconds we resynchronize
+ -- the Clock. This is probably due to a manual Clock adjustment, an
+ -- DST adjustment or an NTP synchronisation. And we want to adjust the
+ -- time for this system (non-monotonic) clock.
if abs (Elap_Secs_Sys - Elap_Secs_Tick) > Max_Shift then
Get_Base_Time;
@@ -202,7 +174,7 @@ package body System.OS_Primitives is
loop
GetSystemTimeAsFileTime (Base_Time'Access);
- if not QueryPerformanceCounter (Base_Ticks'Access) then
+ if QueryPerformanceCounter (Base_Ticks'Access) = Win32.FALSE then
pragma Assert
(Standard.False,
"Could not query high performance counter in Clock");
@@ -228,7 +200,7 @@ package body System.OS_Primitives is
Elap_Secs_Tick : Duration;
begin
- if not QueryPerformanceCounter (Current_Ticks'Access) then
+ if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then
return 0.0;
end if;
@@ -313,9 +285,9 @@ package body System.OS_Primitives is
-- Get starting time as base
- if not QueryPerformanceFrequency (Tick_Frequency'Access) then
- raise Program_Error
- with "cannot get high performance counter frequency";
+ if QueryPerformanceFrequency (Tick_Frequency'Access) = Win32.FALSE then
+ raise Program_Error with
+ "cannot get high performance counter frequency";
end if;
Get_Base_Time;