var cenum = new CCodeEnum (get_ccode_name (en));
- cenum.modifiers |= (en.version.deprecated ? CCodeModifiers.DEPRECATED : 0);
+ if (en.version.deprecated) {
+ if (context.profile == Profile.GOBJECT) {
+ decl_space.add_include ("glib.h");
+ }
+ cenum.modifiers |= CCodeModifiers.DEPRECATED;
+ }
var current_cfile = cfile;
cfile = decl_space;
}
if (prop.version.deprecated) {
+ if (context.profile == Profile.GOBJECT) {
+ decl_space.add_include ("glib.h");
+ }
function.modifiers |= CCodeModifiers.DEPRECATED;
}
}
var ctypedef = new CCodeTypeDefinition (get_ccode_name (creturn_type), cfundecl);
- ctypedef.modifiers |= (d.version.deprecated ? CCodeModifiers.DEPRECATED : 0);
+
+ if (d.version.deprecated) {
+ if (context.profile == Profile.GOBJECT) {
+ decl_space.add_include ("glib.h");
+ }
+ ctypedef.modifiers |= CCodeModifiers.DEPRECATED;
+ }
decl_space.add_type_declaration (ctypedef);
}
}
if (m.version.deprecated) {
+ if (context.profile == Profile.GOBJECT) {
+ decl_space.add_include ("glib.h");
+ }
function.modifiers |= CCodeModifiers.DEPRECATED;
}
}
var instance_struct = new CCodeStruct ("_%s".printf (get_ccode_name (st)));
- instance_struct.modifiers |= (st.version.deprecated ? CCodeModifiers.DEPRECATED : 0);
+
+ if (st.version.deprecated) {
+ if (context.profile == Profile.GOBJECT) {
+ decl_space.add_include ("glib.h");
+ }
+ instance_struct.modifiers |= CCodeModifiers.DEPRECATED;
+ }
foreach (Field f in st.get_fields ()) {
if (f.binding == MemberBinding.INSTANCE) {
gtktemplate/gtkchild-without-gtktemplate.test \
gtktemplate/gtktemplate-gtkwidget-subclass.test \
annotations/deprecated.vala \
+ annotations/deprecated-delegate-minimal.vala \
+ annotations/deprecated-enum-minimal.vala \
+ annotations/deprecated-method-minimal.vala \
+ annotations/deprecated-property-minimal.vala \
+ annotations/deprecated-struct-minimal.vala \
annotations/description.vala \
annotations/noaccessormethod.test \
scanner/comment-not-closed.test \
--- /dev/null
+[Version (deprecated = true)]
+[CCode (has_target = false)]
+delegate void Foo ();
+
+void main () {
+}
--- /dev/null
+[Version (deprecated = true)]
+[CCode (has_type_id = false)]
+enum Foo {
+ BAR
+}
+
+void main () {
+}
--- /dev/null
+[Version (deprecated = true)]
+void foo () {
+}
+
+void main () {
+}
--- /dev/null
+[CCode (has_type_id = false)]
+[SimpleType]
+struct Foo {
+ void* _bar;
+ [Version (deprecated = true)]
+ public void* bar {
+ get { return _bar; }
+ set { _bar = value; }
+ }
+}
+
+void main () {
+}
--- /dev/null
+[Version (deprecated = true)]
+[CCode (has_type_id = false)]
+[SimpleType]
+struct Foo {
+ public void* bar;
+}
+
+void main () {
+}