]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check for wchar.h and langinfo.h
authorDarren Tucker <dtucker@zip.com.au>
Mon, 11 Jul 2016 07:23:38 +0000 (17:23 +1000)
committerDarren Tucker <dtucker@zip.com.au>
Mon, 11 Jul 2016 07:26:49 +0000 (17:26 +1000)
Wrap includes in the appropriate #ifdefs.

configure.ac
utf8.c

index 9da2b036428188a9e7c12f5f2ffe4cfd2a89bf6d..2bb5a63c8f518c2e39e25ff3ec7673e4d327572a 100644 (file)
@@ -381,6 +381,7 @@ AC_CHECK_HEADERS([ \
        ia.h \
        iaf.h \
        inttypes.h \
+       langinfo.h \
        limits.h \
        locale.h \
        login.h \
@@ -433,6 +434,7 @@ AC_CHECK_HEADERS([ \
        utmp.h \
        utmpx.h \
        vis.h \
+       wchar.h \
 ])
 
 # lastlog.h requires sys/time.h to be included first on Solaris
diff --git a/utf8.c b/utf8.c
index 6445b3766b615a24bbf721857cbd268ebe7c0050..f563d3738e8687262ffccd03f7cf5e34ba5847a6 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -23,7 +23,9 @@
 #include "includes.h"
 
 #include <sys/types.h>
-#include <langinfo.h>
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
 #include <limits.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -32,7 +34,9 @@
 #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS)
 # include <vis.h>
 #endif
-#include <wchar.h>
+#ifdef HAVE_WCHAR_H
+# include <wchar.h>
+#endif
 
 #include "utf8.h"