nengel@2: /* nengel@2: * copyright (c) 2006 Michael Niedermayer nengel@2: * nengel@2: * This file is part of FFmpeg. nengel@2: * nengel@2: * FFmpeg is free software; you can redistribute it and/or nengel@2: * modify it under the terms of the GNU Lesser General Public nengel@2: * License as published by the Free Software Foundation; either nengel@2: * version 2.1 of the License, or (at your option) any later version. nengel@2: * nengel@2: * FFmpeg is distributed in the hope that it will be useful, nengel@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of nengel@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU nengel@2: * Lesser General Public License for more details. nengel@2: * nengel@2: * You should have received a copy of the GNU Lesser General Public nengel@2: * License along with FFmpeg; if not, write to the Free Software nengel@2: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA nengel@2: */ nengel@2: nengel@2: /** nengel@2: * @file nengel@2: * Macro definitions for various function/variable attributes nengel@2: */ nengel@2: nengel@2: #ifndef AVUTIL_ATTRIBUTES_H nengel@2: #define AVUTIL_ATTRIBUTES_H nengel@2: nengel@2: #ifdef __GNUC__ nengel@2: # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) nengel@2: #else nengel@2: # define AV_GCC_VERSION_AT_LEAST(x,y) 0 nengel@2: #endif nengel@2: nengel@2: #ifndef av_always_inline nengel@2: #if AV_GCC_VERSION_AT_LEAST(3,1) nengel@2: # define av_always_inline __attribute__((always_inline)) inline nengel@2: #else nengel@2: # define av_always_inline inline nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_noinline nengel@2: #if AV_GCC_VERSION_AT_LEAST(3,1) nengel@2: # define av_noinline __attribute__((noinline)) nengel@2: #else nengel@2: # define av_noinline nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_pure nengel@2: #if AV_GCC_VERSION_AT_LEAST(3,1) nengel@2: # define av_pure __attribute__((pure)) nengel@2: #else nengel@2: # define av_pure nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_const nengel@2: #if AV_GCC_VERSION_AT_LEAST(2,6) nengel@2: # define av_const __attribute__((const)) nengel@2: #else nengel@2: # define av_const nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_cold nengel@2: #if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3) nengel@2: # define av_cold __attribute__((cold)) nengel@2: #else nengel@2: # define av_cold nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_flatten nengel@2: #if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1) nengel@2: # define av_flatten __attribute__((flatten)) nengel@2: #else nengel@2: # define av_flatten nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef attribute_deprecated nengel@2: #if AV_GCC_VERSION_AT_LEAST(3,1) nengel@2: # define attribute_deprecated __attribute__((deprecated)) nengel@2: #else nengel@2: # define attribute_deprecated nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_unused nengel@2: #if defined(__GNUC__) nengel@2: # define av_unused __attribute__((unused)) nengel@2: #else nengel@2: # define av_unused nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifndef av_uninit nengel@2: #if defined(__GNUC__) && !defined(__ICC) nengel@2: # define av_uninit(x) x=x nengel@2: #else nengel@2: # define av_uninit(x) x nengel@2: #endif nengel@2: #endif nengel@2: nengel@2: #ifdef __GNUC__ nengel@2: # define av_builtin_constant_p __builtin_constant_p nengel@2: #else nengel@2: # define av_builtin_constant_p(x) 0 nengel@2: #endif nengel@2: nengel@2: #endif /* AVUTIL_ATTRIBUTES_H */