diff --git a/configure.ac b/configure.ac index 7b4d06a..b17701c 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,7 @@ dnl ## HEADERS ######################################################### dnl ############# AC_CHECK_HEADERS([ \ - sys/time.h signal.h langinfo.h libgen.h locale.h paths.h \ + sys/time.h libgen.h paths.h \ ], [], [], [ #ifdef HAVE_SYS_TYPES_H @@ -210,11 +210,9 @@ dnl ####################### AC_CHECK_FUNCS([ \ arc4random \ basename \ - nl_langinfo \ pclose \ popen \ random \ - setlocale \ srandomdev \ ]) diff --git a/src/util.c b/src/util.c index 44e579c..c71ee9c 100644 --- a/src/util.c +++ b/src/util.c @@ -26,13 +26,9 @@ #include #include -#ifdef HAVE_LANGINFO_H -# include -#endif +#include #include -#ifdef HAVE_LOCALE_H -# include -#endif +#include #include #include @@ -90,13 +86,9 @@ CHARtoUTF8(const char *in_str, int mode) { char *codeset; -#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET) setlocale(LC_CTYPE, ""); codeset = nl_langinfo((nl_item)CODESET); setlocale(LC_CTYPE, "C"); -#else - codeset = (char *)""; -#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */ return (iconvert(in_str, codeset, "UTF-8", mode)); } @@ -106,13 +98,9 @@ UTF8toCHAR(const char *in_str, int mode) { char *codeset; -#if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET) setlocale(LC_CTYPE, ""); codeset = nl_langinfo((nl_item)CODESET); setlocale(LC_CTYPE, "C"); -#else - codeset = (char *)""; -#endif /* HAVE_NL_LANGINFO && HAVE_SETLOCALE && CODESET */ return (iconvert(in_str, "UTF-8", codeset, mode)); }