summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-01-03 18:55:18 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-01-04 14:38:11 +0100
commit4e3103bfd1928b080df77b68e6015fae609ad351 (patch)
treea30c7ae1f00a24a9b76e4770735dd7e1a4be6d6d /codegen
parent76efeb6f154d2826950b191c978ddd82a5d569dd (diff)
downloadvala-4e3103bfd1928b080df77b68e6015fae609ad351.tar.gz
Move writing of G_GNUC_DEPRECATED down to CCodeDeclarator implementations
Doing so in CCodeDeclaration is error-prone. CCodeVariableDeclarator still requires special handling which isn't done here.
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valaccodemethodmodule.vala8
-rw-r--r--codegen/valagtypemodule.vala4
2 files changed, 12 insertions, 0 deletions
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 35de6deda..1f47af9c8 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -1072,6 +1072,10 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
} else if (m.scanf_format) {
func.modifiers |= CCodeModifiers.SCANF;
}
+
+ if (m.version.deprecated) {
+ func.modifiers |= CCodeModifiers.DEPRECATED;
+ }
}
public void generate_vfunc (Method m, DataType return_type, Map<int,CCodeParameter> cparam_map, Map<int,CCodeExpression> carg_map, string suffix = "", int direction = 3) {
@@ -1147,6 +1151,10 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
vfunc.modifiers |= CCodeModifiers.SCANF;
}
+ if (m.version.deprecated) {
+ vfunc.modifiers |= CCodeModifiers.DEPRECATED;
+ }
+
cfile.add_function (vfunc);
pop_context ();
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 654383fae..7e5639f60 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -393,6 +393,10 @@ public class Vala.GTypeModule : GErrorModule {
vdeclarator.modifiers |= CCodeModifiers.SCANF;
}
+ if (m.version.deprecated) {
+ vdeclarator.modifiers |= CCodeModifiers.DEPRECATED;
+ }
+
generate_cparameters (m, decl_space, cparam_map, new CCodeFunction ("fake"), vdeclarator);
var vdecl = new CCodeDeclaration (get_ccode_name (creturn_type));