Created originally on Bitbucket by gmarkall (Graham Markall)
Was already merged in Bitbucket before import, marked as merged by the import user
This commit adds a check to the performance hack in CFuncPtr._wrap_result that doesn't use the hack when the return type is bool, because a new bool object needs to be created.
A test of a C function with a bool restype is added.
This is my first attempt to contribute to PyPy - please let me know if anything further is required. I'm happy to receive feedback :-)