comparison gpf/inc/alert.h @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
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 #include "gpfconf.h"
24
25 #undef ALERT
26 #undef E_ALERT
27
28 #ifndef ALERT_OFF
29 #include "typedefs.h"
30 #include "vsi.h"
31
32 extern BOOL _Alert(char *, T_HANDLE, ULONG);
33 extern BOOL alert_info(char *, ...);
34 #define NO_ALERT_INFO alert_info("")
35
36 #define _STR(x) _VAL(x)
37 #define _VAL(x) #x
38 /*
39 * The && FALSE in the end is just to notify the reader that
40 * FALSE is always returned if the predicate evaluates to false.
41 */
42 #define ALERT(expression, alertclass, function) ((expression) ? ((void) 0) : \
43 (void) (_Alert(__FILE__ "(" _STR(__LINE__) ") \"" #expression "\"", VSI_CALLER TC_ALERT_##alertclass) && (function)))
44
45 #define E_ALERT(expression, alertclass, function) ((expression) ? (TRUE) : \
46 (BOOL) (_Alert(__FILE__ "(" _STR(__LINE__) ") \"" #expression "\"", VSI_CALLER TC_ALERT_##alertclass) && (function) && FALSE))
47
48 #else /* ALERT_OFF */
49 #define NO_ALERT_INFO (0)
50 #define ALERT(expression, alertclass, function) ((void) 0)
51 #define E_ALERT(expression, alertclass, function) (expression)
52 #endif /* ALERT_OFF */
53
54 #endif /* ALERT_H */
55