]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support custom sentinels for constructors
authorJürg Billeter <j@bitron.ch>
Sat, 25 Oct 2008 21:38:22 +0000 (21:38 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 25 Oct 2008 21:38:22 +0000 (21:38 +0000)
2008-10-25  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala:

Support custom sentinels for constructors

svn path=/trunk/; revision=1929

ChangeLog
gobject/valaccodegenerator.vala

index 89a747ff16e1f98ce17747f97af3031caec24773..3cfbdd9230cb633e440d4b51e8c4ca52dfc8e774 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-25  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodegenerator.vala:
+
+       Support custom sentinels for constructors
+
 2008-10-25  Jürg Billeter  <j@bitron.ch>
 
        * vala/valadelegate.vala:
index ad1774dc84df4ca6897ab3183ed5a2f5442061ef..5847996367ab33fa7f1d73a6fca68e9e7826d312 100644 (file)
@@ -3303,8 +3303,11 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        }
 
                        if (ellipsis) {
-                               // ensure variable argument list ends with NULL
-                               creation_call.add_argument (new CCodeConstant ("NULL"));
+                               /* ensure variable argument list ends with NULL
+                                * except when using printf-style arguments */
+                               if (!m.printf_format && m.sentinel != "") {
+                                       creation_call.add_argument (new CCodeConstant (m.sentinel));
+                               }
                        }
 
                        creation_expr = creation_call;