changes for compiling with clang++ on OS X