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

Tested build on OS X with Apple LLVM version 5.1 (clang-503.0.40).

Needs validation on Windows / Linux.