make trailing ';' mandatory with NS_DEBUG macros. fix all invalid uses.

This commit is contained in:
Mathieu Lacage
2007-02-21 20:04:32 +01:00
parent a9d2b13fa1
commit 29b2db3a67
9 changed files with 83 additions and 88 deletions

View File

@@ -93,7 +93,7 @@ private:
* environment variable.
*/
#define NS_DEBUG_COMPONENT_DEFINE(name) \
static ns3::DebugComponent g_debug = ns3::DebugComponent (name);
static ns3::DebugComponent g_debug = ns3::DebugComponent (name)
/**
* \ingroup debugging
@@ -106,10 +106,14 @@ private:
* same file.
*/
#define NS_DEBUG(msg) \
if (g_debug.IsEnabled ()) \
{ \
std::cout << msg << std::endl; \
}
do \
{ \
if (g_debug.IsEnabled ()) \
{ \
std::cout << msg << std::endl; \
} \
} \
while (false)
/**
* \ingroup debugging
@@ -118,8 +122,12 @@ private:
* Generate debugging output unconditionally in all
* debug builds.
*/
#define NS_DEBUG_UNCOND(msg) \
std::cout << msg << std::endl;
#define NS_DEBUG_UNCOND(msg) \
do \
{ \
std::cout << msg << std::endl; \
} \
while (false)
#else /* NS3_DEBUG_ENABLE */