compiler.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Compiler-specific macros and other items
00021  */
00022 
00023 #ifndef _ASTERISK_COMPILER_H
00024 #define _ASTERISK_COMPILER_H
00025 
00026 #ifdef HAVE_ATTRIBUTE_always_inline
00027 #define force_inline __attribute__((always_inline)) inline
00028 #else
00029 #define force_inline inline
00030 #endif
00031 
00032 #ifdef HAVE_ATTRIBUTE_pure
00033 #define attribute_pure __attribute__((pure))
00034 #else
00035 #define attribute_pure
00036 #endif
00037 
00038 #ifdef HAVE_ATTRIBUTE_const
00039 #define attribute_const __attribute__((const))
00040 #else
00041 #define attribute_const
00042 #endif
00043 
00044 #ifdef HAVE_ATTRIBUTE_deprecated
00045 #define attribute_deprecated __attribute__((deprecated))
00046 #else
00047 #define attribute_deprecated
00048 #endif
00049 
00050 #ifdef HAVE_ATTRIBUTE_unused
00051 #define attribute_unused __attribute__((unused))
00052 #else
00053 #define attribute_unused
00054 #endif
00055 
00056 #ifdef HAVE_ATTRIBUTE_malloc
00057 #define attribute_malloc __attribute__((malloc))
00058 #else
00059 #define attribute_malloc
00060 #endif
00061 
00062 #ifdef HAVE_ATTRIBUTE_sentinel
00063 #define attribute_sentinel __attribute__((sentinel))
00064 #else
00065 #define attribute_sentinel
00066 #endif
00067 
00068 #ifdef HAVE_ATTRIBUTE_warn_unused_result
00069 #define attribute_warn_unused_result __attribute__((warn_unused_result))
00070 #else
00071 #define attribute_warn_unused_result
00072 #endif
00073 
00074 #ifdef HAVE_ATTRIBUTE_may_alias
00075 #define attribute_may_alias __attribute__((may_alias))
00076 #else
00077 #define attribute_may_alias
00078 #endif
00079 
00080 /* Some older version of GNU gcc (3.3.5 on OpenBSD 4.3 for example) dont like 'NULL' as sentinel */
00081 #define SENTINEL ((char *)NULL)
00082 
00083 #endif /* _ASTERISK_COMPILER_H */

Generated on Thu Apr 16 06:27:30 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6