1 |
#ifndef _DSHOW_DEBUG_ |
#ifndef _DSHOW_DEBUG_ |
2 |
#define _DSHOW_DEBUG_ |
#define _DSHOW_DEBUG_ |
3 |
|
|
4 |
#ifdef _DEBUG |
#include <stdio.h> |
5 |
#include <stdio.h> /* vsprintf */ |
|
6 |
#define DPRINTF_BUF_SZ 1024 |
#ifdef __cplusplus |
7 |
static __inline void |
extern "C" { |
8 |
DPRINTF(char *fmt, ...) |
#endif |
9 |
|
|
10 |
|
static __inline void OutputDebugStringf(char *fmt, ...) |
11 |
{ |
{ |
12 |
va_list args; |
va_list args; |
13 |
char buf[DPRINTF_BUF_SZ]; |
char buf[256]; |
14 |
|
|
15 |
va_start(args, fmt); |
va_start(args, fmt); |
16 |
vsprintf(buf, fmt, args); |
vsprintf(buf, fmt, args); |
17 |
|
strcat(buf, "\n"); |
18 |
OutputDebugString(buf); |
OutputDebugString(buf); |
19 |
|
va_end(args); |
20 |
} |
} |
21 |
|
|
22 |
|
#ifdef _DEBUG |
23 |
|
#define DPRINTF OutputDebugStringf |
24 |
#else |
#else |
25 |
static __inline void |
static __inline void |
26 |
DPRINTF(char *fmt, ...) { } |
DPRINTF(char *fmt, ...) { } |
27 |
#endif |
#endif |
28 |
|
|
29 |
|
#ifdef __cplusplus |
30 |
|
} |
31 |
|
#endif |
32 |
|
|
33 |
#endif /* _DSHOW_DEBUG */ |
#endif /* _DSHOW_DEBUG */ |