]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add another unfortunate CCode ctype alias for type
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 12 May 2013 19:06:04 +0000 (21:06 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 12 May 2013 19:06:04 +0000 (21:06 +0200)
codegen/valaccodeattribute.vala
codegen/valaccodebasemodule.vala

index a4a1614f9f64652ecb4036da6ae1ceac41d2618d..d11021beefb56176c2eebd8166c343f3d5d484da 100644 (file)
@@ -255,6 +255,21 @@ public class Vala.CCodeAttribute : AttributeCache {
                }
        }
 
+       public string ctype {
+               get {
+                       if (!ctype_set) {
+                               if (ccode != null) {
+                                       _ctype = ccode.get_string ("type");
+                                       if (_ctype == null) {
+                                               _ctype = ccode.get_string ("ctype");
+                                       }
+                               }
+                               ctype_set = true;
+                       }
+                       return _ctype;
+               }
+       }
+
        public string type_id {
                get {
                        if (_type_id == null) {
@@ -409,9 +424,9 @@ public class Vala.CCodeAttribute : AttributeCache {
                        if (_finish_name == null) {
                                if (ccode != null) {
                                        _finish_name = ccode.get_string ("finish_name");
-                               }
-                               if (_finish_name == null) {
-                                       _finish_name = ccode.get_string ("finish_function");
+                                       if (_finish_name == null) {
+                                               _finish_name = ccode.get_string ("finish_function");
+                                       }
                                }
                                if (_finish_name == null) {
                                        _finish_name = get_finish_name_for_basename (name);
@@ -495,6 +510,8 @@ public class Vala.CCodeAttribute : AttributeCache {
        private string _finish_real_name;
        private string _real_name;
        private string _delegate_target_name;
+       private string _ctype;
+       private bool ctype_set = false;
 
        private static int dynamic_method_id;
 
index 0f96e3d5189439fd0376a23e240b88241b3f8686..78bfde2b97324f1a54900c37bca8e59c2b713cfd 100644 (file)
@@ -6187,7 +6187,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        }
 
        public static string? get_ccode_type (CodeNode node) {
-               return node.get_attribute_string ("CCode", "type");
+               return get_ccode_attribute(node).ctype;
        }
 
        public static bool get_ccode_simple_generics (Method m) {