/* valaccodefunction.vala
*
- * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
public string return_type { get; set; }
+ public string attributes { get; set; }
+
/**
* The function body.
*/
public CCodeFunction copy () {
var func = new CCodeFunction (name, return_type);
func.modifiers = modifiers;
+ func.attributes = attributes;
/* no deep copy for lists available yet
* func.parameters = parameters.copy ();
}
writer.write_string (")");
+
if (block == null) {
+ if (attributes != null) {
+ writer.write_string (" ");
+ writer.write_string (attributes);
+ }
+
writer.write_string (";");
} else {
block.write (writer);
if (en.access == SymbolAccessibility.PRIVATE) {
regfun.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ regfun.attributes = "G_GNUC_UNUSED";
}
decl_space.add_type_member_declaration (regfun);
if (cl.access == SymbolAccessibility.PRIVATE) {
function.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ function.attributes = "G_GNUC_UNUSED";
}
decl_space.add_type_member_declaration (function);
if (cl.access == SymbolAccessibility.PRIVATE) {
function.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ function.attributes = "G_GNUC_UNUSED";
}
decl_space.add_type_member_declaration (function);
if (cl.access == SymbolAccessibility.PRIVATE) {
function.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ function.attributes = "G_GNUC_UNUSED";
}
decl_space.add_type_member_declaration (function);
/* valatyperegisterfunction.vala
*
- * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/* Function will not be prototyped anyway */
if (get_accessibility () == SymbolAccessibility.PRIVATE) {
fun.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ fun.attributes = "G_GNUC_UNUSED";
}
} else {
fun = new CCodeFunction ("%s_register_type".printf (get_type_declaration ().get_lower_case_cname (null)), "GType");
var get_fun = new CCodeFunction ("%s_get_type".printf (get_type_declaration ().get_lower_case_cname (null)), "GType");
if (get_accessibility () == SymbolAccessibility.PRIVATE) {
fun.modifiers = CCodeModifiers.STATIC;
+ // avoid C warning as this function is not always used
+ fun.attributes = "G_GNUC_UNUSED";
}
declaration_fragment.append (get_fun.copy ());