Fix compilation for APPLE platform. Thanks to @rperrot @ORNis.