aboutsummaryrefslogtreecommitdiff
path: root/src/espik_debug.h
diff options
context:
space:
mode:
authorbeber <beber>2005-12-07 14:48:53 +0000
committerbeber <beber>2005-12-07 14:48:53 +0000
commit2035bb64f7775c24f865bf29be1f458e8dfae932 (patch)
treeb79d426dcff309bee32f568dd23ff3ce8a77e7e0 /src/espik_debug.h
parentdon't use valgrind (diff)
downloadespik-2035bb64f7775c24f865bf29be1f458e8dfae932.tar.xz
use espik_debug_print everywhere
more ignore corect debug macro when there is no arguments some indent some // -> /* */ add a macro for fd output (stderr, stdout) include debug and so ..
Diffstat (limited to '')
-rw-r--r--src/espik_debug.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/espik_debug.h b/src/espik_debug.h
index a3ad93c..22d7c7b 100644
--- a/src/espik_debug.h
+++ b/src/espik_debug.h
@@ -3,18 +3,26 @@
#include "espik_global.h"
+#define DEBUG_FILENO stderr
+
+#ifdef _ESPIK_DEBUG_
#ifdef __GNUC__
#define espik_debug_print(fmt, ...) \
{ \
- fprintf (stdout, "%s+%i @%s: '", __FILE__, __LINE__, __func__); \
- fprintf (stdout, fmt, __VA_ARGS__); \
- fprintf (stdout, "'\n"); \
+ fprintf (DEBUG_FILENO, "%s+%i @%s: '", __FILE__, __LINE__, __func__); \
+ fprintf (DEBUG_FILENO, fmt, ##__VA_ARGS__); \
+ fprintf (DEBUG_FILENO, "'\n"); \
+}
+#else /* __GNUC__ */
+#define espik_debug_print(fmt, ...) \
+{ \
}
-#else
+#endif /* __GNUC__ */
+#else /* _ESPIK_DEBUG_ */
#define espik_debug_print(fmt, ...) \
{ \
}
-#endif /* __GNUC__ */
+#endif /* _ESPIK_DEBUG_ */
inline void espik_bt (void);
void espik_debug_init();