GST_CHECK_VERSION: Fix unexpected "git = next version" assumption
authorPhilippe Normand <philn@igalia.com>
Thu, 26 May 2022 14:26:40 +0000 (15:26 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 28 Jul 2022 08:52:13 +0000 (08:52 +0000)
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>

subprojects/gstreamer/gst/gstversion.h.in

index a74c2d1..b3a48c0 100644 (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