Imlib.h: Add version macros

This commit is contained in:
Kim Woelders 2021-09-26 17:25:58 +02:00
parent ab52c354fe
commit 1f7ef0225e
2 changed files with 15 additions and 0 deletions

View File

@ -373,12 +373,20 @@ EC_C_WARNINGS()
EC_C_VISIBILITY(yes)
EC_C_ASAN()
VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'`
VERSION_MINOR=`echo $VERSION | awk -F. '{print $2}'`
VERSION_MICRO=`echo $VERSION | awk -F. '{print $3}'`
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_MICRO)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
imlib2.pc
src/Makefile
src/lib/Makefile
src/lib/Imlib2.h
src/bin/Makefile
src/modules/Makefile
src/modules/filters/Makefile

View File

@ -1,6 +1,13 @@
#ifndef __IMLIB_API_H
#define __IMLIB_API_H 1
#define IMLIB2_VERSION_MAJOR @VERSION_MAJOR@
#define IMLIB2_VERSION_MINOR @VERSION_MINOR@
#define IMLIB2_VERSION_MICRO @VERSION_MICRO@
#define IMLIB2_VERSION_(maj, min, mic) (10000 * (maj) + 100 * (min) + (mic))
#define IMLIB2_VERSION IMLIB2_VERSION_(IMLIB2_VERSION_MAJOR, IMLIB2_VERSION_MINOR, IMLIB2_VERSION_MICRO)
#ifdef EAPI
#undef EAPI
#endif