From Valeriy Dubov, fix for Android build under OSX