OSDN Git Service

check for nl_langinfo()
authorIvailo Monev <xakepa10@gmail.com>
Sun, 8 Nov 2020 23:12:38 +0000 (01:12 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 8 Nov 2020 23:12:52 +0000 (01:12 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
CMakeLists.txt
src/core/codecs/qtextcodec.cpp

index ef9622f..c32584d 100644 (file)
@@ -181,6 +181,7 @@ check_type_size(size_t QT_POINTER_SIZE)
 katie_check_function(getpwnam_r "pwd.h")
 katie_check_function(getpwuid_r "pwd.h")
 katie_check_function(getgrgid_r "grp.h")
+katie_check_function(nl_langinfo "langinfo.h")
 # XSI/POSIX.1-2001
 katie_check_function(strerror_r "string.h")
 # SUSv2
index ad0759a..5aa416b 100644 (file)
@@ -56,7 +56,8 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <locale.h>
-#if defined(_XOPEN_UNIX)
+
+#if defined(QT_HAVE_NL_LANGINFO)
 #include <langinfo.h>
 #endif
 
@@ -191,9 +192,9 @@ static void setupLocaleMapper()
 
     }
 
-#if defined(_XOPEN_UNIX)
+#if defined(QT_HAVE_NL_LANGINFO)
     if (!localeMapper) {
-        const char *charset = nl_langinfo(CODESET);
+        const char *charset = ::nl_langinfo(CODESET);
         if (charset)
             localeMapper = QTextCodec::codecForName(charset);
     }