1 | /*
|
---|
2 | Copyright (C) 2005-2006 Feeling Software Inc.
|
---|
3 | MIT License: http://www.opensource.org/licenses/mit-license.php
|
---|
4 | */
|
---|
5 | |
---|
6 | /** |
---|
7 | @file FUDebug.h |
---|
8 | This file contains macros useful to write debugging output. |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef _FU_DEBUG_H_ |
---|
12 | #define _FU_DEBUG_H_ |
---|
13 | |
---|
14 | /** Outputs a string to the debug monitor. |
---|
15 | @param token The string to output. */ |
---|
16 | #define DEBUG_OUT(token) ::DebugOut(__FILE__, __LINE__, token); |
---|
17 | |
---|
18 | /** Outputs a string to the debug monitor. |
---|
19 | @param token The formatted string to output. |
---|
20 | @param arg1 A first argument. */ |
---|
21 | #define DEBUG_OUT1(token, arg1) ::DebugOut(__FILE__, __LINE__, token, arg1); |
---|
22 | |
---|
23 | /** Outputs a string to the debug monitor. |
---|
24 | @param token The formatted string to output. |
---|
25 | @param arg1 A first argument. |
---|
26 | @param arg2 A second argument. */ |
---|
27 | #define DEBUG_OUT2(token, arg1, arg2) ::DebugOut(__FILE__, __LINE__, token, arg1, arg2); |
---|
28 | |
---|
29 | #ifndef _DEBUG |
---|
30 | |
---|
31 | /** Outputs a string to the debug monitor. |
---|
32 | The formatted message is the first parameter. */ |
---|
33 | inline void DebugOut(const char*, ...) {} |
---|
34 | #ifdef UNICODE |
---|
35 | inline void DebugOut(const fchar*, ...) {} /**< See above. */ |
---|
36 | #endif // UNICODE |
---|
37 | |
---|
38 | /** Outputs a string to the debug monitor. |
---|
39 | The formatted message is the first parameter. |
---|
40 | The second parameter is the variable parmeter list. */ |
---|
41 | inline void DebugOutV(const char*, va_list&) {} |
---|
42 | #ifdef UNICODE |
---|
43 | inline void DebugOutV(const fchar*, va_list&) {} /**< See above. */ |
---|
44 | #endif // UNICODE |
---|
45 | |
---|
46 | /** Outputs a string to the debug monitor. |
---|
47 | The filename and line number are the first two parameters. |
---|
48 | The formatted message is the third parameter. */ |
---|
49 | inline void DebugOut(const char*, uint32, const char*, ...) {} |
---|
50 | #ifdef UNICODE |
---|
51 | inline void DebugOut(const char*, uint32, const fchar*, ...) {} /**< See above. */ |
---|
52 | #endif // UNICODE |
---|
53 | |
---|
54 | /** Outputs a string to the debug monitor. |
---|
55 | The filename and line number are the first two parameters. |
---|
56 | The formatted message is the third parameter. |
---|
57 | The fourth parameter is the variable parameter list. */ |
---|
58 | inline void DebugOutV(const char*, uint32, const char*, va_list&) {} |
---|
59 | #ifdef UNICODE |
---|
60 | inline void DebugOutV(const char*, uint32, const fchar*, va_list&) {} /**< See above. */ |
---|
61 | #endif // UNICODE |
---|
62 | |
---|
63 | #else // _DEBUG |
---|
64 | |
---|
65 | #ifdef UNICODE |
---|
66 | void FCOLLADA_EXPORT DebugOut(const char* filename, uint32 line, const fchar* message, ...); |
---|
67 | void FCOLLADA_EXPORT DebugOut(const fchar* message, ...); |
---|
68 | void FCOLLADA_EXPORT DebugOutV(const char* filename, uint32 line, const fchar* message, va_list& vars); |
---|
69 | void FCOLLADA_EXPORT DebugOutV(const fchar* message, va_list& vars); |
---|
70 | #endif // UNICODE |
---|
71 | void FCOLLADA_EXPORT DebugOut(const char* filename, uint32 line, const char* message, ...); |
---|
72 | void FCOLLADA_EXPORT DebugOut(const char* message, ...); |
---|
73 | void FCOLLADA_EXPORT DebugOutV(const char* filename, uint32 line, const char* message, va_list& vars); |
---|
74 | void FCOLLADA_EXPORT DebugOutV(const char* message, va_list& vars); |
---|
75 | |
---|
76 | #endif // _DEBUG |
---|
77 | |
---|
78 | #endif // _FU_DEBUG_H_ |
---|
79 | |
---|