]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Better support of "cprefix" argument in metadata
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 26 Aug 2017 10:48:38 +0000 (12:48 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 26 Aug 2017 10:48:38 +0000 (12:48 +0200)
vala/valagirparser.vala

index ff2e3d3d71fdf71a994682d0d3ffd77ccb7768da..f030c08cae7f3710f7529ba34683e3206f8160ba 100644 (file)
@@ -715,7 +715,12 @@ public class Vala.GirParser : CodeVisitor {
                        if (name == null) {
                                return "";
                        }
-                       var prefix = symbol.get_attribute_string ("CCode", "cprefix");
+                       string prefix;
+                       if (metadata.has_argument (ArgumentType.CPREFIX)) {
+                               prefix = metadata.get_string (ArgumentType.CPREFIX);
+                       } else {
+                               prefix = symbol.get_attribute_string ("CCode", "cprefix");
+                       }
                        if (prefix == null && girdata != null && girdata["c:identifier-prefixes"] != null) {
                                prefix = girdata["c:identifier-prefixes"];
                                int idx = prefix.index_of (",");