patch to build on MacOSX