Fix bsdcompat.h for some platforms