[vlc-devel] [PATCH] configure: Add a new test for <locale.h>
Kamil Rytarowski
n54 at gmx.com
Fri Feb 23 09:25:14 CET 2018
Don't simply assume that the uselocale() check is equivalent for the check of
detecting the <locale.h> POSIX header.
The NetBSD system ships with POSIX <locale.h>, however without the uselocale()
function.
Include <locale.h> in src/config/file.c for systems with detected <locale.h>
instead of just for systems with detected uselocale() and not being __APPLE__.
---
configure.ac | 3 +++
src/config/file.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 225bcae987..cb282b4732 100644
--- a/configure.ac
+++ b/configure.ac
@@ -852,6 +852,9 @@ AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h linux/magic.h mntent.h sys/ev
dnl MacOS
AC_CHECK_HEADERS([xlocale.h])
+dnl POSIX
+AC_CHECK_HEADERS([locale.h])
+
dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
AC_CHECK_TYPE(ssize_t,, [
diff --git a/src/config/file.c b/src/config/file.c
index 6270a6bc9d..16b9d55377 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -32,7 +32,7 @@
#include <sys/stat.h>
#ifdef __APPLE__
# include <xlocale.h>
-#elif defined(HAVE_USELOCALE)
+#elif defined(HAVE_LOCALE_H)
#include <locale.h>
#endif
#include <unistd.h>
--
2.16.1
More information about the vlc-devel
mailing list