summaryrefslogtreecommitdiff
path: root/codegen/valaccodeattribute.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-03-13 08:40:04 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-10-06 17:57:44 +0200
commit96ae8699bda464243bb0226eb180d7f5d0797cb8 (patch)
treeda75902962f1762662c8ad3b7adf1279cc97c416 /codegen/valaccodeattribute.vala
parentd9c368ae608060be76b3838aa38e3ede945fcb5b (diff)
downloadvala-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.vala4
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;