Fix build against recent versions of Clang. Based on patch by Alastair Donaldson!