On Thu,  6 Mar 2014 10:42:42 +0100, Luca Barbato <[email protected]>
wrote:
> Some compilers prefer __builtin_unreachable() over a normal abort() to
> mark unreachable branches.
> ---
>  doc/APIchanges         | 3 +++
>  libavutil/attributes.h | 6 ++++++
>  libavutil/version.h    | 2 +-
>  3 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index d6134f9..f5e6da6 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil:     2013-12-xx
>  
>  API changes, most recent first:
>  
> +2014-xx-xx - xxxxxxx - lavu 53.06.0 - attributes.h
> +  Add av_unreachable() for marking unreachable branches.
> +
>  2014-xx-xx - xxxxxxx - lavu 53.05.0 - frame.h
>    Add av_frame_copy() for copying the frame data.
>  
> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> index d7f2bb5..b030f6a 100644
> --- a/libavutil/attributes.h
> +++ b/libavutil/attributes.h
> @@ -123,4 +123,10 @@
>  #    define av_noreturn
>  #endif
>  
> +#if AV_GCC_VERSION_AT_LEAST(4,5)
> +#   define av_unreachable() __builtin_unreachable()
> +#else
> +#   define av_unreachable() abort()
> +#endif

On many platformss, you will get a more useful failure message with
assert(0) than abort() - assuming NDEBUG is not defined of course.

> +
>  #endif /* AVUTIL_ATTRIBUTES_H */
> diff --git a/libavutil/version.h b/libavutil/version.h
> index cd0981c..36070b2 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -54,7 +54,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR 53
> -#define LIBAVUTIL_VERSION_MINOR  5
> +#define LIBAVUTIL_VERSION_MINOR  6
>  #define LIBAVUTIL_VERSION_MICRO  0
>  
>  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR,
\

-- 
Rémi Denis-Courmont
Sent from my collocated server
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to