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>
This commit is contained in:
Andreas Rheinhardt
2024-03-28 18:06:33 +01:00
parent 2d38141ea6
commit b616be1649
8 changed files with 36 additions and 22 deletions

View File

@@ -18,8 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <assert.h>
#include "config.h"
#include "libavutil/avassert.h"
#include "swresample.h"
#include "version.h"
@@ -28,7 +29,7 @@ const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
unsigned swresample_version(void)
{
av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
static_assert(LIBSWRESAMPLE_VERSION_MICRO >= 100, "micro version starts at 100");
return LIBSWRESAMPLE_VERSION_INT;
}