diff options
Diffstat (limited to 'libavutil/attributes.h')
-rw-r--r-- | libavutil/attributes.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/attributes.h b/libavutil/attributes.h index d93f460..65a9249 100644 --- a/libavutil/attributes.h +++ b/libavutil/attributes.h @@ -96,6 +96,19 @@ #endif #endif +/** + * Mark a variable as used and prevent the compiler from optimizing it + * away. This is useful for variables accessed only from inline + * assembler without the compiler being aware. + */ +#ifndef av_used +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_used __attribute__((used)) +#else +# define av_used +#endif +#endif + #ifndef av_alias #if (!defined(__ICC) || __ICC > 1200) && AV_GCC_VERSION_AT_LEAST(3,3) # define av_alias __attribute__((may_alias)) |