FreeCalypso > hg > tcs211-fcmodem
comparison gpf/INC/alert.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
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 |