summaryrefslogtreecommitdiff
path: root/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/chrono/detail/inlined/win/process_cpu_clocks.hpp')
-rw-r--r--boost/chrono/detail/inlined/win/process_cpu_clocks.hpp53
1 files changed, 29 insertions, 24 deletions
diff --git a/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp b/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
index 1b7e67a120..e97bfe590c 100644
--- a/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
+++ b/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
@@ -2,6 +2,7 @@
// Copyright Beman Dawes 1994, 2006, 2008
// Copyright 2009-2010 Vicente J. Botet Escriba
+// Copyright (c) Microsoft Corporation 2014
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -18,9 +19,11 @@
#include <cassert>
#include <time.h>
-#include <boost/detail/win/GetLastError.hpp>
-#include <boost/detail/win/GetCurrentProcess.hpp>
-#include <boost/detail/win/GetProcessTimes.hpp>
+#include <boost/detail/winapi/GetLastError.hpp>
+#include <boost/detail/winapi/GetCurrentProcess.hpp>
+#if BOOST_PLAT_WINDOWS_DESKTOP
+#include <boost/detail/winapi/GetProcessTimes.hpp>
+#endif
namespace boost
{
@@ -64,14 +67,15 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
}
#endif
+#if BOOST_PLAT_WINDOWS_DESKTOP
process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
return time_point(duration(
@@ -93,10 +97,10 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
@@ -110,7 +114,7 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
}
else
{
- boost::detail::win32::DWORD_ cause = boost::detail::win32::GetLastError();
+ boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
@@ -133,10 +137,10 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_NOEXC
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
return time_point(duration(
@@ -158,10 +162,10 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
@@ -175,7 +179,7 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
}
else
{
- boost::detail::win32::DWORD_ cause = boost::detail::win32::GetLastError();
+ boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
@@ -198,10 +202,10 @@ process_cpu_clock::time_point process_cpu_clock::now() BOOST_NOEXCEPT
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
time_point::rep r(process_real_cpu_clock::now().time_since_epoch().count()
@@ -229,10 +233,10 @@ process_cpu_clock::time_point process_cpu_clock::now(
{
// note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::winapi::FILETIME_ creation, exit, user_time, system_time;
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::winapi::GetProcessTimes(
+ boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
@@ -252,7 +256,7 @@ process_cpu_clock::time_point process_cpu_clock::now(
}
else
{
- boost::detail::win32::DWORD_ cause = boost::detail::win32::GetLastError();
+ boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
{
boost::throw_exception(
@@ -270,6 +274,7 @@ process_cpu_clock::time_point process_cpu_clock::now(
}
#endif
+#endif
} // namespace chrono
} // namespace boost