[SF 2700566] std::cout and std::cerr debug macros

This commit is contained in:
Aleksandar Fabijanic
2009-03-21 20:26:07 +00:00
parent 706dee777d
commit 764bbf2e1d

View File

@@ -42,6 +42,9 @@
#include "Poco/Foundation.h"
#include <string>
#if defined(_DEBUG)
# include <iostream>
#endif
namespace Poco {
@@ -93,10 +96,10 @@ protected:
// useful macros (these automatically supply line number and file name)
//
#if defined(_DEBUG)
#define poco_assert_dbg(cond) \
# define poco_assert_dbg(cond) \
if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0
#else
#define poco_assert_dbg(cond)
# define poco_assert_dbg(cond)
#endif
@@ -124,6 +127,22 @@ protected:
Poco::Bugcheck::debugger(msg, __FILE__, __LINE__)
#if defined(_DEBUG)
# define poco_stdout_dbg(outstr) \
std::cout << __FILE__ << '(' << __LINE__ << "):" << outstr << std::endl;
#else
# define poco_stdout_dbg(outstr)
#endif
#if defined(_DEBUG)
# define poco_stderr_dbg(outstr) \
std::cerr << __FILE__ << '(' << __LINE__ << "):" << outstr << std::endl;
#else
# define poco_stderr_dbg(outstr)
#endif
//
// poco_static_assert
//