Include langinfo.h if needed.
Use locale_charset only if USE_INCLUDED_LIBINTL;
if not, use nl_langinfo (CODESET) if available.
# include <config.h>
#endif
+#include <stddef.h>
+
#if HAVE_ICONV
# include <iconv.h>
+# if ! USE_INCLUDED_LIBINTL && HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# endif
+
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
if (! (outcharset && *outcharset))
{
+#if USE_INCLUDED_LIBINTL
extern char const *locale_charset (void);
outcharset = locale_charset ();
+#else
+# if HAVE_LANGINFO_CODESET
+ outcharset = nl_langinfo (CODESET);
+# endif
+#endif
}
if (*outcharset)