forked from boostorg/beast
Use Boost.Config
This commit is contained in:
1 parent
f65a611b85
commit
0324dc371f
9 files changed
+34
-31
No files matched your search
@@ -8,28 +8,22 @@
|
||||
#ifndef BEAST_UNIT_TEST_DSTREAM_HPP
|
||||
#define BEAST_UNIT_TEST_DSTREAM_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <ios>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <streambuf>
|
||||
#include <string>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX 1
|
||||
# endif
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# undef NOMINMAX
|
||||
#ifdef BOOST_WINDOWS
|
||||
#include <boost/detail/winapi/basic_types.hpp>
|
||||
#include <boost/detail/winapi/debugapi.hpp>
|
||||
#endif
|
||||
|
||||
namespace beast {
|
||||
namespace unit_test {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef BOOST_WINDOWS
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -48,14 +42,14 @@ class dstream_buf
|
||||
void write(char const* s)
|
||||
{
|
||||
if(dbg_)
|
||||
OutputDebugStringA(s);
|
||||
boost::detail::winapi::OutputDebugStringA(s);
|
||||
os_ << s;
|
||||
}
|
||||
|
||||
void write(wchar_t const* s)
|
||||
{
|
||||
if(dbg_)
|
||||
OutputDebugStringW(s);
|
||||
boost::detail::winapi::OutputDebugStringW(s);
|
||||
os_ << s;
|
||||
}
|
||||
|
||||
@@ -63,7 +57,7 @@ public:
|
||||
explicit
|
||||
dstream_buf(ostream& os)
|
||||
: os_(os)
|
||||
, dbg_(IsDebuggerPresent() != FALSE)
|
||||
, dbg_(boost::detail::winapi::IsDebuggerPresent() != 0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
#include <beast/unit_test/match.hpp>
|
||||
#include <beast/unit_test/reporter.hpp>
|
||||
#include <beast/unit_test/suite.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef BOOST_MSVC
|
||||
# ifndef WIN32_LEAN_AND_MEAN // VC_EXTRALEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
@@ -78,7 +79,7 @@ int main(int ac, char const* av[])
|
||||
using namespace std;
|
||||
using namespace beast::unit_test;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if BOOST_MSVC
|
||||
{
|
||||
int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
||||
flags |= _CRTDBG_LEAK_CHECK_DF;
|
||||
|
||||
Reference in new issue
Block a user