20140605 upstream

This patch set allow building on Mac 10.9 with clang and c++11 compiler flags.