Fix compilation on Apple platforms