Fix build error on some platforms (issue #555, solution by guo7805 on GitHub)