diff --git a/include/boost/system/detail/error_code.ipp b/include/boost/system/detail/error_code.ipp index 37d0a63..71c60f6 100644 --- a/include/boost/system/detail/error_code.ipp +++ b/include/boost/system/detail/error_code.ipp @@ -21,9 +21,7 @@ #include // for strerror/strerror_r # if defined( BOOST_WINDOWS_API ) -# include -# include -# include +# include # if !BOOST_PLAT_WINDOWS_RUNTIME # include # endif @@ -374,12 +372,12 @@ namespace std::wstring buf(128, wchar_t()); for (;;) { - boost::detail::winapi::DWORD_ retval = boost::detail::winapi::FormatMessageW( - boost::detail::winapi::FORMAT_MESSAGE_FROM_SYSTEM_ | - boost::detail::winapi::FORMAT_MESSAGE_IGNORE_INSERTS_, + DWORD retval = ::FormatMessageW( + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, - boost::detail::winapi::MAKELANGID_(boost::detail::winapi::LANG_NEUTRAL_, boost::detail::winapi::SUBLANG_DEFAULT_), // Default language + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language &buf[0], buf.size(), NULL @@ -390,7 +388,7 @@ namespace buf.resize(retval); break; } - else if (boost::detail::winapi::GetLastError() != ERROR_INSUFFICIENT_BUFFER) + else if ( ::GetLastError() != ERROR_INSUFFICIENT_BUFFER ) { return std::string("Unknown error"); } @@ -401,23 +399,23 @@ namespace } int num_chars = (buf.size() + 1) * 2; - boost::detail::winapi::LPSTR_ narrow_buffer = (boost::detail::winapi::LPSTR_)_alloca(num_chars); - if (boost::detail::winapi::WideCharToMultiByte(boost::detail::winapi::CP_ACP_, 0, buf.c_str(), -1, narrow_buffer, num_chars, NULL, NULL) == 0) + LPSTR narrow_buffer = (LPSTR)_alloca( num_chars ); + if (::WideCharToMultiByte(CP_ACP, 0, buf.c_str(), -1, narrow_buffer, num_chars, NULL, NULL) == 0) { return std::string("Unknown error"); } std::string str( narrow_buffer ); #else - boost::detail::winapi::LPVOID_ lpMsgBuf = 0; - boost::detail::winapi::DWORD_ retval = boost::detail::winapi::FormatMessageA( - boost::detail::winapi::FORMAT_MESSAGE_ALLOCATE_BUFFER_ | - boost::detail::winapi::FORMAT_MESSAGE_FROM_SYSTEM_ | - boost::detail::winapi::FORMAT_MESSAGE_IGNORE_INSERTS_, + LPVOID lpMsgBuf = 0; + DWORD retval = ::FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ev, - boost::detail::winapi::MAKELANGID_(boost::detail::winapi::LANG_NEUTRAL_, boost::detail::winapi::SUBLANG_DEFAULT_), // Default language - (boost::detail::winapi::LPSTR_) &lpMsgBuf, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPSTR) &lpMsgBuf, 0, NULL ); @@ -425,7 +423,7 @@ namespace if (retval == 0) return std::string("Unknown error"); - std::string str(static_cast(lpMsgBuf)); + std::string str( static_cast(lpMsgBuf) ); # endif while ( str.size() && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) diff --git a/include/boost/system/detail/local_free_on_destruction.hpp b/include/boost/system/detail/local_free_on_destruction.hpp index 25f879b..110024f 100644 --- a/include/boost/system/detail/local_free_on_destruction.hpp +++ b/include/boost/system/detail/local_free_on_destruction.hpp @@ -12,8 +12,6 @@ #ifndef BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP #define BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP -#include - namespace boost { namespace system { namespace detail { @@ -26,7 +24,7 @@ public: ~local_free_on_destruction() { - boost::detail::winapi::LocalFree(p_); + ::LocalFree(p_); } private: