diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-28 18:06:33 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-31 00:08:42 +0100 |
commit | b616be1649f9a32411a3c5b62afe1d73f5a71ed0 (patch) | |
tree | e1434a061ae47a433e45d7a028720f5f8ce42509 /libavcodec/version.c | |
parent | 2d38141ea610ef7d52ced09166b4f2b967a88a3e (diff) | |
download | ffmpeg-b616be1649f9a32411a3c5b62afe1d73f5a71ed0.tar.gz |
lib*/version: Use static_assert for static asserts
Also update the checks that guard against inserting
a new enum entry in the middle of a range.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/version.c')
-rw-r--r-- | libavcodec/version.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/version.c b/libavcodec/version.c index d7966b2015..27f94323b8 100644 --- a/libavcodec/version.c +++ b/libavcodec/version.c @@ -18,9 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <assert.h> + #include "config.h" -#include "libavutil/avassert.h" #include "avcodec.h" #include "codec_id.h" #include "version.h" @@ -30,10 +31,15 @@ const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION; unsigned avcodec_version(void) { - av_assert0(AV_CODEC_ID_PCM_S8_PLANAR==65563); - av_assert0(AV_CODEC_ID_ADPCM_G722==69660); - av_assert0(AV_CODEC_ID_SRT==94216); - av_assert0(LIBAVCODEC_VERSION_MICRO >= 100); + static_assert(AV_CODEC_ID_LEAD == 269 && + AV_CODEC_ID_PCM_SGA == 65572 && + AV_CODEC_ID_ADPCM_XMD == 69683 && + AV_CODEC_ID_CBD2_DPCM == 81928 && + AV_CODEC_ID_QOA == 86121 && + AV_CODEC_ID_ARIB_CAPTION == 94233 && + AV_CODEC_ID_SMPTE_2038 == 98315, + "Don't insert new codec ids in the middle of a list"); + static_assert(LIBAVCODEC_VERSION_MICRO >= 100, "micro version starts at 100"); return LIBAVCODEC_VERSION_INT; } |