diff libavutil/attributes.h @ 2:897f711a7157

rearrange to work with autoconf
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 25 Sep 2012 15:55:33 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libavutil/attributes.h	Tue Sep 25 15:55:33 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +/*
     1.5 + * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
     1.6 + *
     1.7 + * This file is part of FFmpeg.
     1.8 + *
     1.9 + * FFmpeg is free software; you can redistribute it and/or
    1.10 + * modify it under the terms of the GNU Lesser General Public
    1.11 + * License as published by the Free Software Foundation; either
    1.12 + * version 2.1 of the License, or (at your option) any later version.
    1.13 + *
    1.14 + * FFmpeg is distributed in the hope that it will be useful,
    1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 + * Lesser General Public License for more details.
    1.18 + *
    1.19 + * You should have received a copy of the GNU Lesser General Public
    1.20 + * License along with FFmpeg; if not, write to the Free Software
    1.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    1.22 + */
    1.23 +
    1.24 +/**
    1.25 + * @file
    1.26 + * Macro definitions for various function/variable attributes
    1.27 + */
    1.28 +
    1.29 +#ifndef AVUTIL_ATTRIBUTES_H
    1.30 +#define AVUTIL_ATTRIBUTES_H
    1.31 +
    1.32 +#ifdef __GNUC__
    1.33 +#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
    1.34 +#else
    1.35 +#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
    1.36 +#endif
    1.37 +
    1.38 +#ifndef av_always_inline
    1.39 +#if AV_GCC_VERSION_AT_LEAST(3,1)
    1.40 +#    define av_always_inline __attribute__((always_inline)) inline
    1.41 +#else
    1.42 +#    define av_always_inline inline
    1.43 +#endif
    1.44 +#endif
    1.45 +
    1.46 +#ifndef av_noinline
    1.47 +#if AV_GCC_VERSION_AT_LEAST(3,1)
    1.48 +#    define av_noinline __attribute__((noinline))
    1.49 +#else
    1.50 +#    define av_noinline
    1.51 +#endif
    1.52 +#endif
    1.53 +
    1.54 +#ifndef av_pure
    1.55 +#if AV_GCC_VERSION_AT_LEAST(3,1)
    1.56 +#    define av_pure __attribute__((pure))
    1.57 +#else
    1.58 +#    define av_pure
    1.59 +#endif
    1.60 +#endif
    1.61 +
    1.62 +#ifndef av_const
    1.63 +#if AV_GCC_VERSION_AT_LEAST(2,6)
    1.64 +#    define av_const __attribute__((const))
    1.65 +#else
    1.66 +#    define av_const
    1.67 +#endif
    1.68 +#endif
    1.69 +
    1.70 +#ifndef av_cold
    1.71 +#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
    1.72 +#    define av_cold __attribute__((cold))
    1.73 +#else
    1.74 +#    define av_cold
    1.75 +#endif
    1.76 +#endif
    1.77 +
    1.78 +#ifndef av_flatten
    1.79 +#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
    1.80 +#    define av_flatten __attribute__((flatten))
    1.81 +#else
    1.82 +#    define av_flatten
    1.83 +#endif
    1.84 +#endif
    1.85 +
    1.86 +#ifndef attribute_deprecated
    1.87 +#if AV_GCC_VERSION_AT_LEAST(3,1)
    1.88 +#    define attribute_deprecated __attribute__((deprecated))
    1.89 +#else
    1.90 +#    define attribute_deprecated
    1.91 +#endif
    1.92 +#endif
    1.93 +
    1.94 +#ifndef av_unused
    1.95 +#if defined(__GNUC__)
    1.96 +#    define av_unused __attribute__((unused))
    1.97 +#else
    1.98 +#    define av_unused
    1.99 +#endif
   1.100 +#endif
   1.101 +
   1.102 +#ifndef av_uninit
   1.103 +#if defined(__GNUC__) && !defined(__ICC)
   1.104 +#    define av_uninit(x) x=x
   1.105 +#else
   1.106 +#    define av_uninit(x) x
   1.107 +#endif
   1.108 +#endif
   1.109 +
   1.110 +#ifdef __GNUC__
   1.111 +#    define av_builtin_constant_p __builtin_constant_p
   1.112 +#else
   1.113 +#    define av_builtin_constant_p(x) 0
   1.114 +#endif
   1.115 +
   1.116 +#endif /* AVUTIL_ATTRIBUTES_H */