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



commit 4144f10e68840dbc1360b16af864a6f0d971abab
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 7aaba06e7..5fa7c31e5 100644
--- a/codegen/valaccode.vala
+++ b/codegen/valaccode.vala
@@ -436,7 +436,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]