replace a couple of #if __MAC_OS_X_VERSION_MAX_ALLOWED > 1060 with #if __clang__
some modifications for compiling on Xcode5/clang