summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/convey.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1c33272e..89df9610 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -44,6 +44,7 @@ endif()
if (NNG_TESTS)
+ nng_check_sym(nl_langinfo langinfo.h NNG_HAVE_LANGINFO)
if (NOT NNG_SANITIZER STREQUAL "none")
set(TIMEOUT_FACTOR 2)
else()
diff --git a/tests/convey.c b/tests/convey.c
index c676ecaa..deb88f18 100644
--- a/tests/convey.c
+++ b/tests/convey.c
@@ -42,8 +42,11 @@
#else
+#if NNG_HAVE_LANGINFO
#include <langinfo.h>
#include <locale.h>
+#endif
+
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
@@ -860,6 +863,8 @@ convey_init_term(void)
#ifndef _WIN32
/* Windows console doesn't do Unicode (consistently). */
+
+#if NNG_HAVE_LANGINFO
const char *codeset;
(void) setlocale(LC_ALL, "");
@@ -869,6 +874,7 @@ convey_init_term(void)
convey_sym_fail = "✘";
convey_sym_skip = "⚠";
}
+#endif
term = getenv("TERM");
if (!isatty(fileno(stdin))) {
term = NULL;