b8df362e1d6d33951696f8ee859ff3e8ac720100
[asterisk/asterisk.git] / include / asterisk / compiler.h
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2005, Digium, Inc.
5  *
6  * Mark Spencer <markster@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18
19 /*! \file
20  * \brief Compiler-specific macros and other items
21  */
22
23 #ifndef _ASTERISK_COMPILER_H
24 #define _ASTERISK_COMPILER_H
25
26 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
27 #define __builtin_expect(exp, c) (exp)
28 #define force_inline inline
29 #else
30 #define force_inline inline __attribute__((always_inline))
31 #endif
32
33 #define attribute_pure __attribute__((pure))
34
35 #define attribute_const __attribute__((const))
36
37 #endif /* _ASTERISK_COMPILER_H */