From 61bc1f55533328e1251bcc636879526ddf7040b5 Mon Sep 17 00:00:00 2001 From: Stefan Salewski Date: Mon, 18 Sep 2017 09:52:38 +0200 Subject: [PATCH] added support for possible nil value of user-alloc objects --- tests/gen.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gen.nim b/tests/gen.nim index cf1abc7..5b05d0b 100644 --- a/tests/gen.nim +++ b/tests/gen.nim @@ -428,6 +428,11 @@ proc genP(info: GICallableInfo; genProxy = false; binfo: GIBaseInfo = nil): (str if genProxy and isProxyCandidate(t) and mayBeNil: str.add(" = nil") + # ------------------ + if isFunctionInfo(info) and (gFunctionInfoGetFlags(info).int and GIFunctionInfoFlags.WRAPS_VFUNC.ord) == 0: + if userAlloc and mayBeNil: + str.add(" | ptr " & str & " = nil") + # ------------------ if (sym.startsWith("gdk_events_get_") or sym.startsWith("gdk_event_get_")) and str == "Event": str = "SomeEvent"