mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
i18n: Define `nl_item' when it's not available (needed for Cygwin).
* configure.ac: Add check for `nl_item'. * libguile/i18n.c: Separate check for `HAVE_LANGINFO_H' and `HAVE_NL_TYPES_H'. [!HAVE_NL_ITEM]: Define `nl_item'.
This commit is contained in:
parent
2b386ab09f
commit
56d288b844
2 changed files with 21 additions and 2 deletions
10
configure.ac
10
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 \
|
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])
|
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 <langinfo.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NL_TYPES_H
|
||||||
|
# include <nl_types.h>
|
||||||
|
#endif]])
|
||||||
|
|
||||||
# "complex double" is new in C99, and "complex" is only a keyword if
|
# "complex double" is new in C99, and "complex" is only a keyword if
|
||||||
# <complex.h> is included
|
# <complex.h> is included
|
||||||
AC_CHECK_TYPES(complex double,,,
|
AC_CHECK_TYPES(complex double,,,
|
||||||
|
|
|
@ -59,10 +59,16 @@
|
||||||
|
|
||||||
#include "libguile/posix.h" /* for `scm_i_locale_mutex' */
|
#include "libguile/posix.h" /* for `scm_i_locale_mutex' */
|
||||||
|
|
||||||
#if (defined HAVE_LANGINFO_H) && (defined HAVE_NL_TYPES_H)
|
#ifdef HAVE_LANGINFO_H
|
||||||
# include <langinfo.h>
|
# include <langinfo.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NL_TYPES_H
|
||||||
# include <nl_types.h>
|
# include <nl_types.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAVE_NL_ITEM
|
||||||
|
/* Cygwin has <langinfo.h> but lacks <nl_types.h> and `nl_item'. */
|
||||||
|
typedef int nl_item;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_SETLOCALE
|
#ifndef HAVE_SETLOCALE
|
||||||
static inline char *
|
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,
|
setting of the current locale. If nl_langinfo supports CODESET,
|
||||||
we can convert the string properly using scm_from_stringn. If
|
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
|
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,
|
SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue