source: trunk/include/sh_trace.h@ 531

Last change on this file since 531 was 481, checked in by katerina, 9 years ago

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File size: 792 bytes
Line 
1#ifndef SH_TRACE_H
2#define SH_TRACE_H
3
4
5/* This file should be included via samhain.h only.
6 */
7
8#ifdef SL_DEBUG
9#define ASSERT(expr, expr1) \
10 if (!(expr)) \
11 { \
12 fprintf(stderr, \
13 SDG_AERRO, \
14 FIL__, __LINE__, expr1 ); \
15 abort(); \
16 }
17
18
19#define ASSERT_RET(expr, expr1, rr) \
20 if (!(expr)) \
21 { \
22 fprintf(stderr, \
23 SDG_AERRO, \
24 FIL__, __LINE__, expr1 ); \
25 TPT(( (-1), FIL__, __LINE__, SDG_0RETU)) \
26 return (rr); \
27 }
28#else
29#define ASSERT(expr, expr1)
30
31#define ASSERT_RET(expr, expr1, rr) \
32 if (!(expr)) return (rr);
33#endif
34
35
36#ifdef SL_DEBUG
37#define TX1(expr1) \
38 fprintf(stderr, \
39 SDG_TERRO, \
40 FIL__, __LINE__, expr1 );
41#else
42#define TX1(expr1)
43#endif
44
45/* #ifndef SH_TRACE_H */
46#endif
47
Note: See TracBrowser for help on using the repository browser.