1 //  GetCurrentThread.hpp  --------------------------------------------------------------//
2 
3 //  Copyright 2010 Vicente J. Botet Escriba
4 
5 //  Distributed under the Boost Software License, Version 1.0.
6 //  See http://www.boost.org/LICENSE_1_0.txt
7 
8 
9 #ifndef BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
10 #define BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
11 
12 #include <boost/detail/winapi/basic_types.hpp>
13 
14 #ifdef BOOST_HAS_PRAGMA_ONCE
15 #pragma once
16 #endif
17 
18 namespace boost {
19 namespace detail {
20 namespace winapi {
21 #if defined( UNDER_CE )
22 // Windows CE define GetCurrentThread as an inline function in kfuncs.h
GetCurrentThread()23 inline HANDLE_ GetCurrentThread()
24 {
25   return ::GetCurrentThread();
26 }
27 #else
28 #if defined( BOOST_USE_WINDOWS_H )
29     using ::GetCurrentThread;
30 #else
31     extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread();
32 #endif
33 #endif
34 }
35 }
36 }
37 
38 #endif // BOOST_DETAIL_WINAPI_GETCURRENTTHREAD_HPP
39