diff --git a/configure.ac b/configure.ac index 35e902c57..939788276 100644 --- a/configure.ac +++ b/configure.ac @@ -671,6 +671,16 @@ sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \ sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \ direct.h langinfo.h nl_types.h machine/fpu.h]) +# Reasons for testing: +# nl_item - lacking on Cygwin +AC_CHECK_TYPES([nl_item], [], [], + [[#ifdef HAVE_LANGINFO_H + # include + #endif + #ifdef HAVE_NL_TYPES_H + # include + #endif]]) + # "complex double" is new in C99, and "complex" is only a keyword if # is included AC_CHECK_TYPES(complex double,,, diff --git a/libguile/i18n.c b/libguile/i18n.c index b381b055c..d8e2c3c8f 100644 --- a/libguile/i18n.c +++ b/libguile/i18n.c @@ -59,10 +59,16 @@ #include "libguile/posix.h" /* for `scm_i_locale_mutex' */ -#if (defined HAVE_LANGINFO_H) && (defined HAVE_NL_TYPES_H) +#ifdef HAVE_LANGINFO_H # include +#endif +#ifdef HAVE_NL_TYPES_H # include #endif +#ifndef HAVE_NL_ITEM +/* Cygwin has but lacks and `nl_item'. */ +typedef int nl_item; +#endif #ifndef HAVE_SETLOCALE static inline char * @@ -1459,7 +1465,10 @@ SCM_DEFINE (scm_locale_string_to_inexact, "locale-string->inexact", setting of the current locale. If nl_langinfo supports CODESET, we can convert the string properly using scm_from_stringn. If CODESET is not supported, we won't be able to make much sense of - the returned string. */ + the returned string. + + Note: We don't use Gnulib's `nl_langinfo' module because it's currently not + as complete as the compatibility hacks in `i18n.scm'. */ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,