update avl implementation from packetbb
[project/libubox.git] / uapi.h
1 /**
2  *   uapi - Common API macros
3  *   Copyright (C) 2010 Steven Barth <steven@midlink.org>
4  *   Copyright (C) 2010 John Crispin <blogic@openwrt.org>
5  *
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation; either version 2 of the License, or
9  *   (at your option) any later version.
10  *
11  *   This program is distributed in the hope that it will be useful,
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *   GNU General Public License for more details.
15  *
16  *   You should have received a copy of the GNU General Public License
17  *   along with this program; if not, write to the Free Software
18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19  *
20  */
21
22 #ifndef UAPI_H_
23 #define UAPI_H_
24
25 #define API_CTOR                        __attribute__((constructor))
26 #define API_DTOR                        __attribute__((destructor))
27 #define API_HIDDEN                      __attribute__((visibility("hidden")))
28 #define API_INTERNAL            __attribute__((visibility("internal")))
29 #define API_DEFAULT                     __attribute__((visibility("default")))
30 #define API_ALLOC                       __attribute__((malloc))
31 #define API_NONNULL(...)        __attribute__((nonnull(__VA_ARGS_)))
32 #define API_FORCEINLINE         __attribute__((always_inline)) inline
33
34 #define API_PACKED                      __attribute__((packed))
35 #define API_CLEANUP(gc)         __attribute__((cleanup(gc)))
36 #endif /* UAPI_H_ */