[vala/wip/error-gtype: 6/11] codegen: Default to "has_type_id = false" for external error-domains




commit e42aec343a04bb50ee2c62fad271e3415b6d24ab
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Oct 3 16:50:16 2019 +0200

    codegen: Default to "has_type_id = false" for external error-domains

 codegen/valaccode.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/codegen/valaccode.vala b/codegen/valaccode.vala
index 9b1da33f7..80e0f1c0f 100644
--- a/codegen/valaccode.vala
+++ b/codegen/valaccode.vala
@@ -445,7 +445,11 @@ namespace Vala {
        }
 
        public static bool get_ccode_has_type_id (TypeSymbol sym) {
-               return sym.get_attribute_bool ("CCode", "has_type_id", true);
+               if (sym is ErrorDomain && sym.external_package) {
+                       return sym.get_attribute_bool ("CCode", "has_type_id", false);
+               } else {
+                       return sym.get_attribute_bool ("CCode", "has_type_id", true);
+               }
        }
 
        public static bool get_ccode_has_new_function (Method m) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]