summaryrefslogtreecommitdiff
path: root/boost/detail/winapi/timers.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/detail/winapi/timers.hpp')
-rw-r--r--boost/detail/winapi/timers.hpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/boost/detail/winapi/timers.hpp b/boost/detail/winapi/timers.hpp
index 04c6dfbc41..c3bf826100 100644
--- a/boost/detail/winapi/timers.hpp
+++ b/boost/detail/winapi/timers.hpp
@@ -1,6 +1,7 @@
// timers.hpp --------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
+// Copyright 2015 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -15,28 +16,31 @@
#pragma once
#endif
-namespace boost
-{
-namespace detail
+#if !defined( BOOST_USE_WINDOWS_H )
+extern "C" {
+BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
+QueryPerformanceCounter(::_LARGE_INTEGER* lpPerformanceCount);
+
+BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
+QueryPerformanceFrequency(::_LARGE_INTEGER* lpFrequency);
+}
+#endif
+
+
+namespace boost {
+namespace detail {
+namespace winapi {
+
+BOOST_FORCEINLINE BOOL_ QueryPerformanceCounter(LARGE_INTEGER_* lpPerformanceCount)
{
-namespace winapi
+ return ::QueryPerformanceCounter(reinterpret_cast< ::_LARGE_INTEGER* >(lpPerformanceCount));
+}
+
+BOOST_FORCEINLINE BOOL_ QueryPerformanceFrequency(LARGE_INTEGER_* lpFrequency)
{
-#if defined( BOOST_USE_WINDOWS_H )
- using ::QueryPerformanceCounter;
- using ::QueryPerformanceFrequency;
-#else
-extern "C" {
- __declspec(dllimport) BOOL_ WINAPI
- QueryPerformanceCounter(
- LARGE_INTEGER_ *lpPerformanceCount
- );
-
- __declspec(dllimport) BOOL_ WINAPI
- QueryPerformanceFrequency(
- LARGE_INTEGER_ *lpFrequency
- );
+ return ::QueryPerformanceFrequency(reinterpret_cast< ::_LARGE_INTEGER* >(lpFrequency));
}
-#endif
+
}
}
}