#ifndef errno
extern int errno;
#endif
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+/* Some systems, like SunOS 4, don't have EILSEQ. On these systems,
+ define EILSEQ to some value other than EINVAL, because our invokers
+ may want to distinguish EINVAL from EILSEQ. */
#ifndef EILSEQ
-# define EILSEQ EINVAL
+# define EILSEQ ENOENT
#endif
#ifndef ENOTSUP
# define ENOTSUP EINVAL
#endif
-#if HAVE_ICONV
-# include <iconv.h>
-#endif
-
#if HAVE_LANGINFO_CODESET && ! USE_INCLUDED_LIBINTL
# include <langinfo.h>
#endif