summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2007-03-27 08:03:33 +0000
committerLudovic Courtès <ludo@gnu.org>2007-03-27 08:03:33 +0000
commitafb49959b0952c257770f88bc87ca40ae0305c45 (patch)
tree84762bb0d224c6191a8fcf43fabe70059c7fb677
parent29d8c12436a70f8b8d27344457465b90de7ae83a (diff)
downloadguile-afb49959b0952c257770f88bc87ca40ae0305c45.tar.gz
Changes from arch/CVS synchronization
-rw-r--r--libguile/ChangeLog6
-rw-r--r--libguile/i18n.c52
2 files changed, 38 insertions, 20 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index caed3a463..19339a97d 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-12 Ludovic Courtès <ludovic.courtes@laas.fr>
+
+ * i18n.c (scm_nl_langinfo): `#ifdef'd uses of `GROUPING',
+ `FRAC_DIGITS', etc., which are GNU extensions. Reported by
+ Steven Wu.
+
2007-03-08 Kevin Ryde <user42@zip.com.au>
* struct.c, struct.h (scm_make_vtable): New function, providing
diff --git a/libguile/i18n.c b/libguile/i18n.c
index e23f79072..2a778eb91 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -1442,35 +1442,40 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
result = SCM_BOOL_F;
else
{
- char *p;
-
switch (c_item)
{
+#if (defined GROUPING) && (defined MON_GROUPING)
case GROUPING:
case MON_GROUPING:
- /* In this cases, the result is to be interpreted as a list of
- numbers. If the last item is `CHARS_MAX', it has the special
- meaning "no more grouping". */
- result = SCM_EOL;
- for (p = c_result; (*p != '\0') && (*p != CHAR_MAX); p++)
- result = scm_cons (SCM_I_MAKINUM ((int) *p), result);
-
{
- SCM last_pair = result;
+ char *p;
- result = scm_reverse_x (result, SCM_EOL);
+ /* In this cases, the result is to be interpreted as a list of
+ numbers. If the last item is `CHARS_MAX', it has the special
+ meaning "no more grouping". */
+ result = SCM_EOL;
+ for (p = c_result; (*p != '\0') && (*p != CHAR_MAX); p++)
+ result = scm_cons (SCM_I_MAKINUM ((int) *p), result);
- if (*p != CHAR_MAX)
- {
- /* Cyclic grouping information. */
- if (last_pair != SCM_EOL)
- SCM_SETCDR (last_pair, result);
- }
- }
+ {
+ SCM last_pair = result;
- free (c_result);
- break;
+ result = scm_reverse_x (result, SCM_EOL);
+
+ if (*p != CHAR_MAX)
+ {
+ /* Cyclic grouping information. */
+ if (last_pair != SCM_EOL)
+ SCM_SETCDR (last_pair, result);
+ }
+ }
+ free (c_result);
+ break;
+ }
+#endif
+
+#if (defined FRAC_DIGITS) && (defined INT_FRAC_DIGITS)
case FRAC_DIGITS:
case INT_FRAC_DIGITS:
/* This is to be interpreted as a single integer. */
@@ -1482,19 +1487,25 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
free (c_result);
break;
+#endif
+#if (defined P_CS_PRECEDES) && (defined INT_N_CS_PRECEDES)
case P_CS_PRECEDES:
case N_CS_PRECEDES:
case INT_P_CS_PRECEDES:
case INT_N_CS_PRECEDES:
+#if (defined P_SEP_BY_SPACE) && (defined N_SEP_BY_SPACE)
case P_SEP_BY_SPACE:
case N_SEP_BY_SPACE:
+#endif
/* This is to be interpreted as a boolean. */
result = scm_from_bool (*c_result);
free (c_result);
break;
+#endif
+#if (defined P_SIGN_POSN) && (defined INT_N_SIGN_POSN)
case P_SIGN_POSN:
case N_SIGN_POSN:
case INT_P_SIGN_POSN:
@@ -1527,6 +1538,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
result = scm_from_locale_symbol ("unspecified");
}
break;
+#endif
default:
/* FIXME: `locale_string ()' is not appropriate here because of