comparison src/gpf2/inc/alert.h @ 1:864b8cc0cf63

src/gpf2: preened GPF goo from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:38:58 +0000
parents
children
comparison
equal deleted inserted replaced
0:945cf7f506b2 1:864b8cc0cf63
1 /*
2 +------------------------------------------------------------------------------
3 | File: alert.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : definitions for the ALERT macro.
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef ALERT_H
21 #define ALERT_H
22
23 #undef ALERT
24 #undef E_ALERT
25
26 #ifndef ALERT_OFF
27 #include "typedefs.h"
28 #include "vsi.h"
29
30 extern BOOL _Alert(char *, T_HANDLE, ULONG);
31 extern BOOL alert_info(char *, ...);
32 #define NO_ALERT_INFO alert_info("")
33
34 #define _STR(x) _VAL(x)
35 #define _VAL(x) #x
36 /*
37 * The && FALSE in the end is just to notify the reader that
38 * FALSE is always returned if the predicate evaluates to false.
39 */
40 #define ALERT(expression, alertclass, function) ((expression) ? ((void) 0) : \
41 (void) (_Alert(__FILE__ "(" _STR(__LINE__) ") \"" #expression "\"", VSI_CALLER TC_ALERT_##alertclass) && (function)))
42
43 #define E_ALERT(expression, alertclass, function) ((expression) ? (TRUE) : \
44 (BOOL) (_Alert(__FILE__ "(" _STR(__LINE__) ") \"" #expression "\"", VSI_CALLER TC_ALERT_##alertclass) && (function) && FALSE))
45
46 #else /* ALERT_OFF */
47 #define NO_ALERT_INFO (0)
48 #define ALERT(expression, alertclass, function) ((void) 0)
49 #define E_ALERT(expression, alertclass, function) (expression)
50 #endif /* ALERT_OFF */
51
52 #endif /* ALERT_H */
53