debugapi.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #ifdef BOOST_HAS_PRAGMA_ONCE
  12. #pragma once
  13. #endif
  14. #if !defined( BOOST_USE_WINDOWS_H )
  15. extern "C" {
  16. #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4)
  17. BOOST_SYMBOL_IMPORT boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  18. IsDebuggerPresent(BOOST_WINAPI_DETAIL_VOID);
  19. #endif
  20. BOOST_SYMBOL_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  21. OutputDebugStringA(boost::winapi::LPCSTR_);
  22. BOOST_SYMBOL_IMPORT boost::winapi::VOID_ BOOST_WINAPI_WINAPI_CC
  23. OutputDebugStringW(boost::winapi::LPCWSTR_);
  24. } // extern "C"
  25. #endif
  26. namespace boost {
  27. namespace winapi {
  28. #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_NT4)
  29. using ::IsDebuggerPresent;
  30. #endif
  31. using ::OutputDebugStringA;
  32. using ::OutputDebugStringW;
  33. BOOST_FORCEINLINE void output_debug_string(char const* s)
  34. {
  35. ::OutputDebugStringA(s);
  36. }
  37. BOOST_FORCEINLINE void output_debug_string(wchar_t const* s)
  38. {
  39. ::OutputDebugStringW(s);
  40. }
  41. }
  42. }
  43. #endif // BOOST_WINAPI_DEBUGAPI_HPP_INCLUDED_