fix build error for various platforms