diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-03-13 08:40:04 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-10-06 17:57:44 +0200 |
commit | 96ae8699bda464243bb0226eb180d7f5d0797cb8 (patch) | |
tree | da75902962f1762662c8ad3b7adf1279cc97c416 /codegen/valaccodeattribute.vala | |
parent | d9c368ae608060be76b3838aa38e3ede945fcb5b (diff) | |
download | vala-96ae8699bda464243bb0226eb180d7f5d0797cb8.tar.gz |
Support `define' expressions in global scope of source fileswip/defines
Fixes https://gitlab.gnome.org/GNOME/vala/issues/765
Diffstat (limited to 'codegen/valaccodeattribute.vala')
-rw-r--r-- | codegen/valaccodeattribute.vala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala index 316570273..5b9f96b8b 100644 --- a/codegen/valaccodeattribute.vala +++ b/codegen/valaccodeattribute.vala @@ -682,7 +682,9 @@ public class Vala.CCodeAttribute : AttributeCache { private string get_default_name () { if (sym != null) { - if (sym is Constant && !(sym is EnumValue)) { + if (sym is Define) { + return sym.name; + } else if (sym is Constant && !(sym is EnumValue)) { if (sym.parent_symbol is Block) { // local constant return sym.name; |