-
Notifications
You must be signed in to change notification settings - Fork 22
/
_xDebug.c
67 lines (48 loc) · 1.37 KB
/
_xDebug.c
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*****************************************************************************/
/**
xDebug.c
uEng - micro cross platform engine
Copyright 2010 by Wes Gale All rights reserved.
Used by permission in VccX
*/
/*****************************************************************************/
#include "xDebug.h"
/*
System headers
*/
//#include <ucontext.h>
//#include <unistd.h>
//#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <Windows.h>
/*****************************************************************************/
int g_bTraceMessageLogging = TRUE;
//int g_bTraceMessageLogFile = FALSE;
/*****************************************************************************/
#if 0
void _xDbgTrace(const void * pFile, const int iLine, const void * pFormat, ...)
{
va_list args;
va_start(args,pFormat);
fprintf(stdout,"%s(%d) : ", (char *)pFile, iLine);
vfprintf(stdout,(char *)pFormat,args);
va_end(args);
fflush(stdout);
}
#else
void _xDbgTrace(const void * pFile, const int iLine, const void * pFormat, ...)
{
va_list args;
char temp[1024];
va_start(args, pFormat);
sprintf(temp, "%s(%d) : ", (char *)pFile, iLine);
OutputDebugString(temp);
vsprintf(temp, (char *)pFormat, args);
OutputDebugString(temp);
va_end(args);
// fflush(stdout);
}
#endif
/*****************************************************************************/