diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2025-08-08 00:57:18 +0200 |
---|---|---|
committer | Leo Izen <leo.izen@gmail.com> | 2025-08-14 19:42:13 +0000 |
commit | 47c6af7d299c96b2e65f5f10526e0f34e00b23c8 (patch) | |
tree | d63fd62c2cd8e6900846a385dedef226391c1df6 | |
parent | 3ab9eebba7e73fbf7f4cff0f5b8c3a0d1b8ac884 (diff) | |
download | ffmpeg-47c6af7d299c96b2e65f5f10526e0f34e00b23c8.tar.gz |
avutil/avassert: always implement av_assume with av_unreachable
One of the design goals of this macro is the ability to support static
inline predicate functions. Which is emitting warning in clang that a
function may have side-effects and the condition will be ignored. MSVC
doesn't emit warning, but also ignore predicate in such cases.
Instead of using assume builtins, implement it using unreachable. Which
solves this case for MSVC and Clang.
This reverts ea56fe60acc139a4dc7c531f2cb9f5319cef7a09, but also extends
it to MSVC, which is affected in the similar way.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
-rw-r--r-- | libavutil/avassert.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/libavutil/avassert.h b/libavutil/avassert.h index f4f039dfb0..209c0d9d17 100644 --- a/libavutil/avassert.h +++ b/libavutil/avassert.h @@ -108,16 +108,10 @@ do { \ #define av_unreachable(msg) ((void)0) #endif -#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(); \ } while (0) #endif -#endif #endif /* AVUTIL_AVASSERT_H */ |