fix breakage with mavericks' clang 5

support clang and later versions of gcc