hacks to work on osx with clang