Need to include xlocale.h on Darwin for strtod_l
authorKristian Rietveld <kris@loopnest.org>
Wed, 9 Nov 2011 07:32:33 +0000 (08:32 +0100)
committerKristian Rietveld <kris@loopnest.org>
Wed, 9 Nov 2011 07:32:33 +0000 (08:32 +0100)
This fixes the build of gstrfuncs.c on Darwin.

configure.ac
glib/gstrfuncs.c

index 378a5cf..eeb74e8 100644 (file)
@@ -913,6 +913,8 @@ AC_CHECK_HEADERS([sys/mount.h sys/sysctl.h], [], [],
  #endif
 ])
 
+AC_CHECK_HEADERS([xlocale.h])
+
 # check for structure fields
 AC_CHECK_MEMBERS([struct stat.st_mtimensec, struct stat.st_mtim.tv_nsec, struct stat.st_atimensec, struct stat.st_atim.tv_nsec, struct stat.st_ctimensec, struct stat.st_ctim.tv_nsec])
 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct statfs.f_fstypename, struct statfs.f_bavail],,, [#include <sys/types.h>
index 01ca718..8495697 100644 (file)
 #include <errno.h>
 #include <ctype.h>              /* For tolower() */
 
+#ifdef HAVE_XLOCALE_H
+/* Needed on BSD/OS X for e.g. strtod_l */
+#include <xlocale.h>
+#endif
+
 #ifdef G_OS_WIN32
 #include <windows.h>
 #endif