Further improve compatibility when compiling on OS X