Fix gringo compilation under Mountain Lion as well as later versions

This patch is from @dbuenzli and is a followup to the problems
reported in #25823.