From: Rico Tzschichholz Date: Fri, 11 Nov 2016 20:59:05 +0000 (+0100) Subject: ccode: Fix and disable deprecating EnumValue X-Git-Tag: 0.35.1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eebc7c324ad8554b68faa8277cafb37844d0d3e;p=thirdparty%2Fvala.git 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 --- diff --git a/ccode/valaccodeenumvalue.vala b/ccode/valaccodeenumvalue.vala index e952f4b90..2fa408587 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 91ed21ee8..0968b1538 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; }