1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avutil/avassert: use __builtin_assume if available

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2025-08-07 04:00:48 +02:00
parent fa458c7243
commit ea56fe60ac

View File

@@ -101,7 +101,6 @@ do { \
#define av_unreachable(msg) __builtin_unreachable()
#elif defined(_MSC_VER)
#define av_unreachable(msg) __assume(0)
#define av_assume(cond) __assume(cond)
#elif __STDC_VERSION__ >= 202311L
#include <stddef.h>
#define av_unreachable(msg) unreachable()
@@ -109,7 +108,11 @@ do { \
#define av_unreachable(msg) ((void)0)
#endif
#ifndef av_assume
#if AV_HAS_BUILTIN(__builtin_assume)
#define av_assume(cond) __builtin_assume(cond)
#elif defined(_MSC_VER)
#define av_assume(cond) __assume(cond)
#else
#define av_assume(cond) do { \
if (!(cond)) \
av_unreachable(); \