Xenomai  3.0.2
trank.h
1 /*
2  * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13 
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #ifndef _XENOMAI_TRANK_TRANK_H
19 #define _XENOMAI_TRANK_TRANK_H
20 
21 #ifdef __XENO_COMPAT__
22 
23 void warning(const char *fmt, ...);
24 
25 #define trank_warning(__fmt, __args...) \
26  warning("%s: " __fmt, __func__, ##__args)
27 
28 #define __CURRENT(call) __current_ ## call
29 
30 #define COMPAT_DECL(T, P) __typeof__(T) P
31 #define CURRENT_DECL(T, P) __typeof__(T) __CURRENT(P)
32 
33 #else /* !__XENO_COMPAT__ */
34 
35 #include <boilerplate/compiler.h>
36 
37 #define __CURRENT(call) call
38 
39 #define COMPAT_DECL(T, P)
40 #define CURRENT_DECL(T, P) __typeof__(T) P; \
41  __typeof__(T) __current_ ## P
42 
43 #define CURRENT_IMPL(T, I, A) \
44 __typeof__(T) I A __attribute__((alias("__current_" __stringify(I)), weak)); \
45 __typeof__(T) __current_ ## I A
46 
47 #endif /* !__XENO_COMPAT__ */
48 
49 #endif /* _XENOMAI_TRANK_TRANK_H */