GST_CHECK_VERSION: Fix unexpected "git = next version" assumption

1.21.0.1 should not satisfy a check for 1.22.0.

If someone needs more control they should do a feature check for
the symbol in the headers or lib.

Based on a similar patch by Tim-Philipp Müller for libnice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2501>
This commit is contained in:
Philippe Normand 2022-05-26 15:26:40 +01:00 committed by GStreamer Marge Bot
parent 8e6872a36e
commit 53800b308b

View file

@ -77,14 +77,17 @@ G_BEGIN_DECLS
*
* Check whether a GStreamer version equal to or greater than
* major.minor.micro is present.
*
* Note: Since version 1.22 this macro can no longer be used to check that
* current git version maps to the next version. So for instance,
* GST_CHECK_VERSION(1, 22, 0) on a git checkout of the 1.21 development version
* will expand to `FALSE`.
*/
#define GST_CHECK_VERSION(major,minor,micro) \
(GST_VERSION_MAJOR > (major) || \
(GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR > (minor)) || \
(GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR == (minor) && \
GST_VERSION_MICRO >= (micro)) || \
(GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR == (minor) && \
GST_VERSION_MICRO + 1 == (micro) && GST_VERSION_NANO > 0))
GST_VERSION_MICRO >= (micro)))
G_END_DECLS