[FFmpeg-devel] [PATCH 08/10] Add a check for __attribute__((used)) in GCC.

Måns Rullgård mans
Fri Oct 3 15:34:24 CEST 2008


Diego 'Flameeyes' Petten? wrote:
> This is needed to tell GCC to emit definitions even when it thinks
> they are not going to be used. Without this some static constant
> definitions will be removed when they are only used by ASM code.
> ---
>
>  libavutil/common.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index 01ead54..8650c2f 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -101,6 +101,14 @@
>  #endif
>  #endif
>
> +#ifndef av_used
> +#if defined(__GNUC__)
> +#    define av_used __attribute__((used))
> +#else
> +#    define av_used
> +#endif
> +#endif

There's already one of those in libavutil/internal.h.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list