[vala/tintou/glib-version-message] vala: Trigger understandable errors with GLib target version
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/tintou/glib-version-message] vala: Trigger understandable errors with GLib target version
- Date: Mon, 3 Dec 2018 10:39:27 +0000 (UTC)
commit a9b05fa9008e4cc6d60d8e86d2a0af2244d7282f
Author: Corentin Noël <corentin elementary io>
Date: Mon Dec 3 11:38:07 2018 +0100
vala: Trigger understandable errors with GLib target version
vala/valacodecontext.vala | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 815899cee..9b835e13c 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -555,9 +555,12 @@ public class Vala.CodeContext {
int glib_major = target_glib_major;
int glib_minor = target_glib_minor;
- if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2
- || glib_minor % 2 != 0) {
- Report.error (null, "Invalid format or version for target GLib");
+ if (target_glib != null && target_glib.scanf ("%d.%d", out glib_major, out glib_minor) != 2) {
+ Report.error (null, "Invalid format for target GLib, it should be MAJOR.MINOR");
+ }
+
+ if (glib_minor % 2 != 0) {
+ Report.error (null, "Invalid version for target GLib, only stable versions (with even
minor number) are supported");
}
if (glib_major != 2) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]