file: exception_errno.h
1
/*
2
* Copyright (C) 2008-2009 by Emmanuel Azencot under the GNU LGPL
3
* license version 2.0 or 2.1. You should have received a copy of the
4
* LGPL license along with this library if you did not you can find it
5
* at http://www.gnu.org/.
6
*/
7
#include <stdio.h>
8
#include <errno.h>
9
10
#ifdef raise
11
#undef raise
12
#endif
13
#define /*X*/ raise(action, error_no, fmt, args...) { \
14
if ( (error_no) ) { \
15
errno = (EXCP_MOD) | (error_no); \
16
action; \
17
} }
18
19
#ifdef relay
20
#undef relay
21
#endif
22
#define /*X*/ relay(action, fmt, args...) { \
23
if ( errno ) { \
24
action; \
25
} }
26
#ifdef excp_assert
27
#undef excp_assert
28
#endif
29
#define /*X*/ excp_assert(action, error_no, expression) { \
30
if ( !(expression) ) { \
31
(errno = (EXCP_MOD) | (error_no));\
32
action; \
33
} \
34
}
35
C to HTML Conversion by ctoohtml