diff --git a/generator/Signature.cs b/generator/Signature.cs index 9c2683ce7..156480003 100644 --- a/generator/Signature.cs +++ b/generator/Signature.cs @@ -148,8 +148,14 @@ namespace GtkSharp.Generation { foreach (Parameter p in parms) { result [i] = p.PassAs != "" ? p.PassAs + " " : ""; - if (p.IsOptional && p.PassAs == String.Empty) - result [i++] += (p.Generatable is StructGen || p.Generatable is BoxedGen) ? (p.CSType + ".Zero") : "null"; + if (p.IsOptional && p.PassAs == String.Empty) { + if (p.Generatable is StructGen || p.Generatable is BoxedGen) + result [i++] += " .Zero"; + else if (p.CSType == "System.IntPtr") + result [i++] += "System.IntPtr.Zero"; + else + result [i++] += "null"; + } else result [i++] += p.Name; }