~ubuntu-branches/ubuntu/precise/csound/precise

« back to all changes in this revision

Viewing changes to frontends/CsoundAC/trace.cpp

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2012-04-19 09:26:46 UTC
  • mfrom: (3.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20120419092646-96xbj1n6atuqosk2
Tags: 1:5.17.6~dfsg-1
* New upstream release
 - Do not build the wiimote opcodes (we need wiiuse).
* Add new API function to symbols file
* Disable lua opcodes, they were broken. Requires OpenMP to be enabled.
* Backport fixes from upstream:
  - Link dssi4cs with dl. Backport
  - Fix building of CsoundAC

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// trace.cpp -- debugging print function
 
2
//
 
3
// (I think this was created to provide a generic print function
 
4
// for use in non-command-line Windows applications where printf
 
5
// does not work. Currently, it is not used, but kept around for
 
6
// possible debugging needs. -RBD)
 
7
 
 
8
#include "stdarg.h"
 
9
#include "stdio.h"
 
10
#if defined(MSVC)
 
11
#include "crtdbg.h"
 
12
#endif
 
13
 
 
14
 
 
15
void trace(char *format, ...)
 
16
{
 
17
    char msg[256];
 
18
    va_list args;
 
19
    va_start(args, format);
 
20
#if defined(MSVC)
 
21
    _vsnprintf_s(msg, 256, _TRUNCATE, format, args);
 
22
#else
 
23
    vsnprintf(msg, 256, format, args);
 
24
#endif
 
25
    va_end(args);
 
26
#if (defined(MSVC) && defined(_DEBUG))
 
27
    _CrtDbgReport(_CRT_WARN, NULL, NULL, NULL, msg);
 
28
#else
 
29
    printf(msg);
 
30
#endif
 
31
}