wl(' %s ret;', ret.ctype)
wl(' if(!orig)')
wl(' orig = glsym("%s");', func.name)
wl(' %s ret;', ret.ctype)
wl(' if(!orig)')
wl(' orig = glsym("%s");', func.name)
wl(' orig(%s);', ", ".join([p.name for p in params]))
if not func.name.startswith("glX"):
wl(' check_error();')
wl(' orig(%s);', ", ".join([p.name for p in params]))
if not func.name.startswith("glX"):
wl(' check_error();')