summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-11-10 19:18:26 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-11-10 19:18:26 -0500
commite4be785c6c53d57e9199462bbccd8e344ee55e86 (patch)
tree7b93646158b393ee3482b1cbc3b7937393ae33b6
parent18779b9d67eb9b64203d7456098bf917243f468c (diff)
downloadgtk+-e4be785c6c53d57e9199462bbccd8e344ee55e86.tar.gz
builder: Be a bit more strict about requires
Check that the major version matches (without this, the requires check is really toothless), but allow 3.99 to match 4.0.
-rw-r--r--gtk/gtkbuilderparser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index c8e096aacb..b714a8e869 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -2016,13 +2016,16 @@ end_element (GtkBuildableParseContext *context,
*/
if (!strcmp (req_info->library, "gtk"))
{
- if (!GTK_CHECK_VERSION (req_info->major, req_info->minor, 0))
+ if (req_info->major == 4 && req_info->minor == 0)
+ {
+ /* We allow 3.99.x to pass as 4.0 */
+ }
+ else if (gtk_check_version (req_info->major, req_info->minor, 0) != NULL)
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_VERSION_MISMATCH,
- "Required %s version %d.%d, current version is %d.%d",
- req_info->library,
+ "Required GTK version %d.%d, current version is %d.%d",
req_info->major, req_info->minor,
GTK_MAJOR_VERSION, GTK_MINOR_VERSION);
_gtk_builder_prefix_error (data->builder, context, error);