]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: Allow metadata files to set PrintfFormat
authorEvan Nemerson <evan@coeus-group.com>
Wed, 25 Mar 2009 20:46:10 +0000 (13:46 -0700)
committerJürg Billeter <j@bitron.ch>
Sun, 29 Mar 2009 14:39:03 +0000 (16:39 +0200)
Fixes bug 576765.

vala/valacodewriter.vala
vapigen/valagidlparser.vala

index 9e72baab2c8c889426287abbbe54b905ad9aa3d8..d44a77d86e2750da2cdcc6e36c91071326bae54c 100644 (file)
@@ -851,6 +851,10 @@ public class Vala.CodeWriter : CodeVisitor {
                        write_indent ();
                        write_string ("[ReturnsModifiedPointer]");
                }
+               if (m.printf_format) {
+                       write_indent ();
+                       write_string ("[PrintfFormat]");
+               }
 
                var ccode_params = new StringBuilder ();
                var separator = "";
index c5a27a6d0d169e247e5123496034af984e2fc7da..33805539ec04192776d17fefe9145052a4167a6a 100644 (file)
@@ -1393,6 +1393,10 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                add_ellipsis = true;
                                        }
+                               } else if (nv[0] == "printf_format") {
+                                       if (eval (nv[1]) == "1") {
+                                               m.printf_format = true;
+                                       }
                                } else if (nv[0] == "transfer_ownership") {
                                        if (eval (nv[1]) == "1") {
                                                return_type.value_owned = true;
@@ -1450,7 +1454,6 @@ public class Vala.GIdlParser : CodeVisitor {
                                } else if (nv[0] == "vfunc_name") {
                                        m.vfunc_name = eval (nv[1]);
                                }
-
                        }
                }