pimp_debug.h 581 Bytes
Newer Older
1
2
3
4
5
/* pimp_debug.h -- Debugging helpers
 * Copyright (C) 2005-2006 Jrn Nystad and Erik Faye-Lund
 * For conditions of distribution and use, see copyright notice in LICENSE.TXT
 */

6
7
8
9
10
11
12
13
14
15
16
#ifndef PIMP_DEBUG_H
#define PIMP_DEBUG_H

#ifdef DEBUG_PRINTF_ENABLED
 #define DEBUG_PRINT(X) iprintf X
#else
 #define DEBUG_PRINT(X)
#endif

#ifdef ASSERT_ENABLED
 #include <stdlib.h>
17
 #include <stdio.h>
18
19
20
21
22
23
24
25
26
 #define ASSERT(expr) \
	do { \
		if (!(expr)) iprintf("*** ASSERT FAILED %s AT (%s:%i)\n", #expr, __FILE__, __LINE__); \
	} while(0)
#else
 #define ASSERT(expr)
#endif

#endif /* PIMP_DEBUG_H */