Commited patches to make it compile on freebsd10 with clang