[vala/staging: 2/2] codegen: Emit initializer for enum-value into wanted declaration space
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/2] codegen: Emit initializer for enum-value into wanted declaration space
- Date: Fri, 30 Nov 2018 17:52:44 +0000 (UTC)
commit b5d3e0f3fdafaf85689896b2ee64e707f1fbc0fe
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Fri Nov 30 16:43:42 2018 +0100
codegen: Emit initializer for enum-value into wanted declaration space
Fixes https://gitlab.gnome.org/GNOME/vala/issues/167
codegen/valaccodebasemodule.vala | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index d25c85f3a..879d4fb23 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -825,6 +825,9 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
cenum.modifiers |= (en.version.deprecated ? CCodeModifiers.DEPRECATED : 0);
+ var current_cfile = cfile;
+ cfile = decl_space;
+
int flag_shift = 0;
foreach (EnumValue ev in en.get_values ()) {
CCodeEnumValue c_ev;
@@ -842,6 +845,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
cenum.add_value (c_ev);
}
+ cfile = current_cfile;
+
decl_space.add_type_definition (cenum);
decl_space.add_type_definition (new CCodeNewline ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]