tagging release
[dasher.git] / trunk / Src / Common / Trace.cpp
blob305b79ff119d4ee7f1f3a31bcaa280e25eb14b1d
1 // Trace.cpp
2 //
3 // Copyright (c) 2005 David Ward
5 #include "Common.h"
7 #include "Trace.h"
8 #include "Platform.h"
10 // Track memory leaks on Windows to the line that new'd the memory
11 #ifdef _WIN32
12 #ifdef _DEBUG
13 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
14 #define new DEBUG_NEW
15 #undef THIS_FILE
16 static char THIS_FILE[] = __FILE__;
17 #endif
18 #endif
20 // Customize behaviour of Trace here
22 #ifdef DASHER_WIN32
24 // On Windows, send Trace to the Debug window in DevStudio
25 // The ATL/MFC Trace application also picks up Trace when running
27 #include "Windows.h"
29 void DasherTraceOutputImpl(const char *pszFormat, va_list vargs) {
30 char buffer[2048];
31 #ifndef _WIN32_WCE
32 _vsnprintf(buffer, 2048,pszFormat, vargs);
33 #endif
34 OutputDebugStringA(buffer);
37 #else
39 // Send Trace to stdout
41 void DasherTraceOutputImpl(const char *pszFormat, va_list vargs) {
42 vfprintf(stdout, pszFormat, vargs);
45 #endif