netbsd: Improve handling of <locale> and <xlocale.h> headers
authorKamil Rytarowski <n54@gmx.com>
Sat, 28 Nov 2015 09:01:05 +0000 (10:01 +0100)
committerDavid Henningsson <david.henningsson@canonical.com>
Mon, 7 Dec 2015 08:01:21 +0000 (09:01 +0100)
NetBSD ships with strtod_l(3) in <stdlib.h>.
Having strtol_l(3) doesn't imply to have <xlocale.h>.
Generalize inclusion of <locale.h> and <xlocale.h>.

configure.ac
src/pulsecore/core-util.c

index abfb8d9..640be09 100644 (file)
@@ -447,6 +447,7 @@ AC_CHECK_HEADERS_ONCE([sys/eventfd.h])
 AC_CHECK_HEADERS_ONCE([execinfo.h])
 AC_CHECK_HEADERS_ONCE([langinfo.h])
 AC_CHECK_HEADERS_ONCE([regex.h pcreposix.h])
+AC_CHECK_HEADERS_ONCE([locale.h xlocale.h])
 
 AM_CONDITIONAL(HAVE_SYS_EVENTFD_H, test "x$ac_cv_header_sys_eventfd_h" = "xyes")
 
index b5ddd3d..3d36993 100644 (file)
 #endif
 
 #ifdef HAVE_STRTOD_L
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
+#endif
+#ifdef HAVE_XLOCALE_H
 #include <xlocale.h>
 #endif
+#endif
 
 #ifdef HAVE_SCHED_H
 #include <sched.h>
 #endif
 
 #ifdef __APPLE__
-#include <xlocale.h>
 #include <mach/mach_init.h>
 #include <mach/thread_act.h>
 #include <mach/thread_policy.h>