aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-28 18:06:33 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-31 00:08:42 +0100
commitb616be1649f9a32411a3c5b62afe1d73f5a71ed0 (patch)
treee1434a061ae47a433e45d7a028720f5f8ce42509 /libavutil
parent2d38141ea610ef7d52ced09166b4f2b967a88a3e (diff)
downloadffmpeg-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 'libavutil')
-rw-r--r--libavutil/version.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavutil/version.c b/libavutil/version.c
index baead7c4a0..afab190336 100644
--- a/libavutil/version.c
+++ b/libavutil/version.c
@@ -18,8 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <assert.h>
+
#include "config.h"
-#include "avassert.h"
#include "avutil.h"
#include "samplefmt.h"
#include "version.h"
@@ -34,10 +35,11 @@ const char *av_version_info(void)
unsigned avutil_version(void)
{
- av_assert0(AV_SAMPLE_FMT_DBLP == 9);
- av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
- av_assert0(AV_PICTURE_TYPE_BI == 7);
- av_assert0(LIBAVUTIL_VERSION_MICRO >= 100);
+ static_assert(AV_SAMPLE_FMT_S64P == 11 &&
+ AVMEDIA_TYPE_ATTACHMENT == 4 &&
+ AV_PICTURE_TYPE_BI == 7,
+ "Don't insert new sample/media/picture types in the middle of the list");
+ static_assert(LIBAVUTIL_VERSION_MICRO >= 100, "micro version starts at 100");
return LIBAVUTIL_VERSION_INT;
}