• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavutil/attributes.h

Go to the documentation of this file.
00001 /*
00002  * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
00003  *
00004  * This file is part of Libav.
00005  *
00006  * Libav is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * Libav is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with Libav; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00019  */
00020 
00026 #ifndef AVUTIL_ATTRIBUTES_H
00027 #define AVUTIL_ATTRIBUTES_H
00028 
00029 #ifdef __GNUC__
00030 #    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
00031 #else
00032 #    define AV_GCC_VERSION_AT_LEAST(x,y) 0
00033 #endif
00034 
00035 #ifndef av_always_inline
00036 #if AV_GCC_VERSION_AT_LEAST(3,1)
00037 #    define av_always_inline __attribute__((always_inline)) inline
00038 #else
00039 #    define av_always_inline inline
00040 #endif
00041 #endif
00042 
00043 #ifndef av_noinline
00044 #if AV_GCC_VERSION_AT_LEAST(3,1)
00045 #    define av_noinline __attribute__((noinline))
00046 #else
00047 #    define av_noinline
00048 #endif
00049 #endif
00050 
00051 #ifndef av_pure
00052 #if AV_GCC_VERSION_AT_LEAST(3,1)
00053 #    define av_pure __attribute__((pure))
00054 #else
00055 #    define av_pure
00056 #endif
00057 #endif
00058 
00059 #ifndef av_const
00060 #if AV_GCC_VERSION_AT_LEAST(2,6)
00061 #    define av_const __attribute__((const))
00062 #else
00063 #    define av_const
00064 #endif
00065 #endif
00066 
00067 #ifndef av_cold
00068 #if AV_GCC_VERSION_AT_LEAST(4,3)
00069 #    define av_cold __attribute__((cold))
00070 #else
00071 #    define av_cold
00072 #endif
00073 #endif
00074 
00075 #ifndef av_flatten
00076 #if AV_GCC_VERSION_AT_LEAST(4,1)
00077 #    define av_flatten __attribute__((flatten))
00078 #else
00079 #    define av_flatten
00080 #endif
00081 #endif
00082 
00083 #ifndef attribute_deprecated
00084 #if AV_GCC_VERSION_AT_LEAST(3,1)
00085 #    define attribute_deprecated __attribute__((deprecated))
00086 #else
00087 #    define attribute_deprecated
00088 #endif
00089 #endif
00090 
00091 #ifndef av_unused
00092 #if defined(__GNUC__)
00093 #    define av_unused __attribute__((unused))
00094 #else
00095 #    define av_unused
00096 #endif
00097 #endif
00098 
00104 #ifndef av_used
00105 #if AV_GCC_VERSION_AT_LEAST(3,1)
00106 #    define av_used __attribute__((used))
00107 #else
00108 #    define av_used
00109 #endif
00110 #endif
00111 
00112 #ifndef av_alias
00113 #if AV_GCC_VERSION_AT_LEAST(3,3)
00114 #   define av_alias __attribute__((may_alias))
00115 #else
00116 #   define av_alias
00117 #endif
00118 #endif
00119 
00120 #ifndef av_uninit
00121 #if defined(__GNUC__) && !defined(__ICC)
00122 #    define av_uninit(x) x=x
00123 #else
00124 #    define av_uninit(x) x
00125 #endif
00126 #endif
00127 
00128 #ifdef __GNUC__
00129 #    define av_builtin_constant_p __builtin_constant_p
00130 #    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
00131 #else
00132 #    define av_builtin_constant_p(x) 0
00133 #    define av_printf_format(fmtpos, attrpos)
00134 #endif
00135 
00136 #endif /* AVUTIL_ATTRIBUTES_H */
Generated on Thu Jan 24 2013 17:08:56 for Libav by doxygen 1.7.1