mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
Handle newlib C library's langinfo constant names
The newlib C library (used in Cygwin) has alternative names for nl_langinfo GNU extensions * configure.ac (_NL_NUMERIC_GROUPING): new test * libguile/i18n.c (INT_CURR_SYMBOL, MON_DECIMAL_POINT, MON_THOUSANDS_SEP) (MON_GROUPING, POSITIVE_SIGN, NEGATIVE_SIGN, GROUPING, INT_FRAC_DIGITS) (FRAC_DIGITS, P_CS_PRECEDES, P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE) (P_SIGN_POSN, N_SIGN_POSN, INT_P_CS_PRECEDES, INT_P_SEP_BY_SPACE) (INT_N_CS_PRECEDES, INT_N_SEP_BY_SPACE, INT_P_SIGN_POSN, INT_N_SIGN_POSN) [HAVE_DECL__NL_NUMERIC_GROUPING]: map to newlib C constants, when present
This commit is contained in:
parent
f169f64004
commit
69bc964d7b
2 changed files with 29 additions and 1 deletions
|
@ -492,6 +492,9 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
|
||||||
strcoll strcoll_l strtod_l strtol_l newlocale uselocale utimensat \
|
strcoll strcoll_l strtod_l strtol_l newlocale uselocale utimensat \
|
||||||
sched_getaffinity sched_setaffinity sendfile])
|
sched_getaffinity sched_setaffinity sendfile])
|
||||||
|
|
||||||
|
# The newlib C library uses _NL_ prefixed locale langinfo constants.
|
||||||
|
AC_CHECK_DECLS([_NL_NUMERIC_GROUPING], [], [], [[#include <langinfo.h>]])
|
||||||
|
|
||||||
# Reasons for testing:
|
# Reasons for testing:
|
||||||
# netdb.h - not in mingw
|
# netdb.h - not in mingw
|
||||||
# sys/param.h - not in mingw
|
# sys/param.h - not in mingw
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2006-2014,2017-2018
|
/* Copyright 2006-2014,2017-2019
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -80,6 +80,31 @@ setlocale (int category, const char *name)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The newlib C library has alternative names for locale constants. */
|
||||||
|
#if HAVE_DECL__NL_NUMERIC_GROUPING
|
||||||
|
#define INT_CURR_SYMBOL _NL_MONETARY_INT_CURR_SYMBOL
|
||||||
|
#define MON_DECIMAL_POINT _NL_MONETARY_MON_DECIMAL_POINT
|
||||||
|
#define MON_THOUSANDS_SEP _NL_MONETARY_MON_THOUSANDS_SEP
|
||||||
|
#define MON_GROUPING _NL_MONETARY_MON_GROUPING
|
||||||
|
#define POSITIVE_SIGN _NL_MONETARY_POSITIVE_SIGN
|
||||||
|
#define NEGATIVE_SIGN _NL_MONETARY_NEGATIVE_SIGN
|
||||||
|
#define GROUPING _NL_NUMERIC_GROUPING
|
||||||
|
#define INT_FRAC_DIGITS _NL_MONETARY_INT_FRAC_DIGITS
|
||||||
|
#define FRAC_DIGITS _NL_MONETARY_FRAC_DIGITS
|
||||||
|
#define P_CS_PRECEDES _NL_MONETARY_P_CS_PRECEDES
|
||||||
|
#define P_SEP_BY_SPACE _NL_MONETARY_P_SEP_BY_SPACE
|
||||||
|
#define N_CS_PRECEDES _NL_MONETARY_N_CS_PRECEDES
|
||||||
|
#define N_SEP_BY_SPACE _NL_MONETARY_N_SEP_BY_SPACE
|
||||||
|
#define P_SIGN_POSN _NL_MONETARY_P_SIGN_POSN
|
||||||
|
#define N_SIGN_POSN _NL_MONETARY_N_SIGN_POSN
|
||||||
|
#define INT_P_CS_PRECEDES _NL_MONETARY_INT_P_CS_PRECEDES
|
||||||
|
#define INT_P_SEP_BY_SPACE _NL_MONETARY_INT_P_SEP_BY_SPACE
|
||||||
|
#define INT_N_CS_PRECEDES _NL_MONETARY_INT_N_CS_PRECEDES
|
||||||
|
#define INT_N_SEP_BY_SPACE _NL_MONETARY_INT_N_SEP_BY_SPACE
|
||||||
|
#define INT_P_SIGN_POSN _NL_MONETARY_INT_P_SIGN_POSN
|
||||||
|
#define INT_N_SIGN_POSN _NL_MONETARY_INT_N_SIGN_POSN
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Helper stringification macro. */
|
/* Helper stringification macro. */
|
||||||
#define SCM_I18N_STRINGIFY(_name) # _name
|
#define SCM_I18N_STRINGIFY(_name) # _name
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue