GetCurrentThread.hpp 887 B

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