[vala] ccode: Fix and disable deprecating EnumValue



commit 9eebc7c324ad8554b68faa8277cafb37844d0d3e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Nov 11 21:59:05 2016 +0100

    ccode: Fix and disable deprecating EnumValue
    
    This still requires GCC 6.0 and later to work.
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043

 ccode/valaccodeenumvalue.vala     |    8 +++++---
 tests/annotations/deprecated.vala |    4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/ccode/valaccodeenumvalue.vala b/ccode/valaccodeenumvalue.vala
index e952f4b..2fa4085 100644
--- a/ccode/valaccodeenumvalue.vala
+++ b/ccode/valaccodeenumvalue.vala
@@ -43,12 +43,14 @@ public class Vala.CCodeEnumValue : CCodeNode {
 
        public override void write (CCodeWriter writer) {
                writer.write_string (name);
+               if (CCodeModifiers.DEPRECATED in modifiers) {
+                       // FIXME Requires GCC 6.0 to work at this place
+                       // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043
+                       //writer.write_string (" G_GNUC_DEPRECATED");
+               }
                if (value != null) {
                        writer.write_string (" = ");
                        value.write (writer);
                }
-               if (CCodeModifiers.DEPRECATED in modifiers) {
-                       writer.write_string (" G_GNUC_DEPRECATED");
-               }
        }
 }
diff --git a/tests/annotations/deprecated.vala b/tests/annotations/deprecated.vala
index 91ed21e..0968b15 100644
--- a/tests/annotations/deprecated.vala
+++ b/tests/annotations/deprecated.vala
@@ -32,7 +32,9 @@ void test_class_property () {
 [Version (deprecated = true)]
 enum FooEnum {
        [Version (deprecated = true)]
-       BAR,
+       BAR = 0,
+       [Version (deprecated = true)]
+       FOO,
        BAZ;
 }
 


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