File: trace.cpp

package info (click to toggle)
audacity 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 44,240 kB
  • sloc: cpp: 182,841; ansic: 120,375; sh: 26,421; lisp: 7,495; makefile: 1,606; python: 240; xml: 104; perl: 31
file content (25 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// trace.cpp -- debugging print function
//
// (I think this was created to provide a generic print function
// for use in non-command-line Windows applications where printf
// does not work. Currently, it is not used, but kept around for
// possible debugging needs. -RBD)

#include "stdarg.h"
#include "stdio.h"
#include "crtdbg.h"


void trace(char *format, ...)
{
    char msg[256];
    va_list args;
    va_start(args, format);
    _vsnprintf_s(msg, 256, _TRUNCATE, format, args);
    va_end(args);
#ifdef _DEBUG
    _CrtDbgReport(_CRT_WARN, NULL, NULL, NULL, msg);
#else
    printf(msg);
#endif
}