Skip to content
Snippets Groups Projects
Commit 9c2530f1 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Olivier Stasse
Browse files

Add __null_stream function to avoid compilation error

parent 98d6ad56
No related branches found
No related tags found
No related merge requests found
...@@ -188,13 +188,13 @@ inline bool dgTDEBUG_ENABLE (const int & level) ...@@ -188,13 +188,13 @@ inline bool dgTDEBUG_ENABLE (const int & level)
if (1) \ if (1) \
; \ ; \
else \ else \
std::ostream(NULL) ::dynamicgraph::__null_stream()
# define dgDEBUGMUTE (level) \ # define dgDEBUGMUTE (level) \
if (1) \ if (1) \
; \ ; \
else \ else \
std::ostream(NULL) ::dynamicgraph::__null_stream()
# define dgERROR \ # define dgERROR \
dgERRORFLOW.outputbuffer << dgPREERROR dgERRORFLOW.outputbuffer << dgPREERROR
...@@ -219,12 +219,23 @@ inline void dgERRORF (const char*, ...) ...@@ -219,12 +219,23 @@ inline void dgERRORF (const char*, ...)
return; return;
} }
namespace dynamicgraph
{
inline std::ostream& __null_stream ()
{
// This function should never be called. With -O3,
// it should not appear in the generated binary.
static std::ostream os (NULL); return os;
}
}
// TEMPLATE // TEMPLATE
# define dgTDEBUG(level) \ # define dgTDEBUG(level) \
if (1) \ if (1) \
; \ ; \
else \ else \
std::ostream(NULL) ::dynamicgraph::__null_stream()
inline void dgTDEBUGF (const int, const char*, ...) inline void dgTDEBUGF (const int, const char*, ...)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment