diff options
Diffstat (limited to 'boost/detail/winapi/GetThreadTimes.hpp')
-rw-r--r-- | boost/detail/winapi/GetThreadTimes.hpp | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/boost/detail/winapi/GetThreadTimes.hpp b/boost/detail/winapi/GetThreadTimes.hpp index 3428edad22..2e1eb8f45c 100644 --- a/boost/detail/winapi/GetThreadTimes.hpp +++ b/boost/detail/winapi/GetThreadTimes.hpp @@ -1,6 +1,7 @@ // GetThreadTimes.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 @@ -9,27 +10,44 @@ #ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP #define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP +#include <boost/detail/winapi/basic_types.hpp> #include <boost/detail/winapi/time.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif +#if !defined( BOOST_USE_WINDOWS_H ) +extern "C" { +BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI +GetThreadTimes( + boost::detail::winapi::HANDLE_ hThread, + ::_FILETIME* lpCreationTime, + ::_FILETIME* lpExitTime, + ::_FILETIME* lpKernelTime, + ::_FILETIME* lpUserTime); +} +#endif + namespace boost { namespace detail { namespace winapi { -#if defined( BOOST_USE_WINDOWS_H ) - using ::GetThreadTimes; -#else - extern "C" __declspec(dllimport) BOOL_ WINAPI - GetThreadTimes( - HANDLE_ hThread, - LPFILETIME_ lpCreationTime, - LPFILETIME_ lpExitTime, - LPFILETIME_ lpKernelTime, - LPFILETIME_ lpUserTime - ); -#endif + +BOOST_FORCEINLINE BOOL_ GetThreadTimes( + HANDLE_ hThread, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime) +{ + return ::GetThreadTimes( + hThread, + reinterpret_cast< ::_FILETIME* >(lpCreationTime), + reinterpret_cast< ::_FILETIME* >(lpExitTime), + reinterpret_cast< ::_FILETIME* >(lpKernelTime), + reinterpret_cast< ::_FILETIME* >(lpUserTime)); +} + } } } |