Fix #524: OS X build fixes for XCode 5 / libc++

PR for #524: OS X build fixes for XCode 5 / libc++

Tested on OS X with Apple LLVM version 5.1 (clang-503.0.40).

Needs validation on Windows / Linux.