@@ -310,10 +310,19 @@ # string (TCL_DYNAMIC char*) # dstring (TCL_DYNAMIC char*) # vstring (TCL_VOLATILE char*) # default (Tcl_Obj*) # wide + switch -- $rtype { + void - ok - int - long - float - double - wide {} + default { + append cbody " if (rv == NULL) {\n" + append cbody " return(TCL_ERROR);\n" + append cbody " }\n" + } + } + switch -- $rtype { void { } ok { append cbody " return rv;" "\n" } int { append cbody " Tcl_SetIntObj(Tcl_GetObjResult(ip), rv);" "\n" } long { append cbody " Tcl_SetLongObj(Tcl_GetObjResult(ip), rv);" "\n" }