39 #ifdef MSQ_ENABLE_DEBUG
42 const unsigned flag_array[] = { MSQ_ENABLE_DEBUG, 0 };
43 size_t length =
sizeof(flag_array) /
sizeof(
unsigned) - 1;
63 if (flag >=
flags.size())
71 if (flag <
flags.size())
86 return msq_stdio::cout;
93 size_t old_size =
streams.size();
95 for (
unsigned i = old_size;
i < flag; ++
i)
109 #if defined(HAVE_VSNPRINTF)
111 va_start( args, format );
112 vsnprintf( buffer,
sizeof(buffer), format, args );
114 #elif defined(HAVE__VSNPRINTF)
116 va_start( args, format );
117 _vsnprintf( buffer,
sizeof(buffer), format, args );
119 #elif defined(HAVE_VSPRINTF)
121 va_start( args, format );
122 vsprintf( buffer, format, args );
125 strncpy( buffer,
sizeof(buffer), format );
126 buffer[
sizeof(buffer)-1] =
'\0';
static msq_std::vector< msq_stdio::ostream * > streams
static bool get(unsigned flag)
Check a debug flag.
static msq_stdio::ostream & get_stream(unsigned flag)
Get the output stream to be used for a given debug flag.
double length(Vector3D *const v, int n)
static msq_std::vector< bool > flags
static void set(unsigned flag, bool state)
Set a debug flag.
static InitializeFlags init
static void set_stream(unsigned flag, msq_stdio::ostream &stream)
Set the output stream to be used for a given debug flag.
static void disable_all()
Disable all debug streams.