debugapi.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2017 Vinnie Falco
  3. *
  4. * Distributed under the Boost Software License, Version 1.0.
  5. * See http://www.boost.org/LICENSE_1_0.txt
  6. */
  7. #ifndef BOOST_WINAPI_DEBUGAPI_HPP_INCLUDED_
  8. #define BOOST_WINAPI_DEBUGAPI_HPP_INCLUDED_
  9. #include <boost/winapi/basic_types.hpp>
  10. #include <boost/winapi/config.hpp>
  11. #include <boost/winapi/detail/header.hpp>
  12. #ifdef BOOST_HAS_PRAGMA_ONCE
  13. #pragma once
  14. #endif
  15. #if !defined( BOOST_USE_WINDOWS_H )
  16. extern "C" {
  17. #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4)
  18. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  19. IsDebuggerPresent(BOOST_WINAPI_DETAIL_VOID);
  20. #endif
  21. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  22. OutputDebugStringA(boost::winapi::LPCSTR_);
  23. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  24. OutputDebugStringW(boost::winapi::LPCWSTR_);
  25. } // extern "C"
  26. #endif
  27. namespace boost {
  28. namespace winapi {
  29. #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4)
  30. using ::IsDebuggerPresent;
  31. #endif
  32. using ::OutputDebugStringA;
  33. using ::OutputDebugStringW;
  34. BOOST_FORCEINLINE void output_debug_string(char const* s)
  35. {
  36. ::OutputDebugStringA(s);
  37. }
  38. BOOST_FORCEINLINE void output_debug_string(wchar_t const* s)
  39. {
  40. ::OutputDebugStringW(s);
  41. }
  42. }
  43. }
  44. #include <boost/winapi/detail/footer.hpp>
  45. #endif // BOOST_WINAPI_DEBUGAPI_HPP_INCLUDED_