aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>1997-10-03 13:10:06 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>1997-10-03 13:10:06 +0000
commit8b028b5c2d5e1caebec3fd870344d50f73fa8ec6 (patch)
tree5f48a46ad5378f8e182fe76c11a762e575dfb235
parentd663f1c83944cf8934f549ff879b51364f1a60ad (diff)
downloadpostgresql-8b028b5c2d5e1caebec3fd870344d50f73fa8ec6.tar.gz
postgresql-8b028b5c2d5e1caebec3fd870344d50f73fa8ec6.zip
From JM de Lauwereyns (jmlauwer@icdc.caissedesdepots.fr):
lconv is already taken as a struct identifier defined in a /usr/include file. Only has an effect with USE_LOCALE enabled. (Apparently unique to AIX and/or AIX compiler? thomas)
-rw-r--r--src/backend/utils/adt/cash.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c
index 2de35f6a3b8..7b1a00e9f27 100644
--- a/src/backend/utils/adt/cash.c
+++ b/src/backend/utils/adt/cash.c
@@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.16 1997/09/20 16:15:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.17 1997/10/03 13:10:06 thomas Exp $
*/
#include <stdio.h>
@@ -33,8 +33,7 @@ static const char *num_word(Cash value);
#define LAST_DIGIT (LAST_PAREN - 1)
#ifdef USE_LOCALE
-static struct lconv *lconv = NULL;
-
+static struct lconv *lconvert = NULL;
#endif
/* cash_in()
@@ -65,18 +64,18 @@ cash_in(const char *str)
csymbol;
#ifdef USE_LOCALE
- if (lconv == NULL)
- lconv = localeconv();
+ if (lconvert == NULL)
+ lconvert = localeconv();
/* frac_digits in the C locale seems to return CHAR_MAX */
/* best guess is 2 in this case I think */
- fpoint = ((lconv->frac_digits != CHAR_MAX) ? lconv->frac_digits : 2); /* int_frac_digits? */
+ fpoint = ((lconvert->frac_digits != CHAR_MAX) ? lconvert->frac_digits : 2); /* int_frac_digits? */
- dsymbol = *lconv->mon_decimal_point;
- ssymbol = *lconv->mon_thousands_sep;
- csymbol = *lconv->currency_symbol;
- psymbol = *lconv->positive_sign;
- nsymbol = *lconv->negative_sign;
+ dsymbol = *lconvert->mon_decimal_point;
+ ssymbol = *lconvert->mon_thousands_sep;
+ csymbol = *lconvert->currency_symbol;
+ psymbol = *lconvert->positive_sign;
+ nsymbol = *lconvert->negative_sign;
#else
fpoint = 2;
dsymbol = '.';
@@ -183,18 +182,18 @@ cash_out(Cash *in_value)
char convention;
#ifdef USE_LOCALE
- if (lconv == NULL)
- lconv = localeconv();
-
- mon_group = *lconv->mon_grouping;
- comma = *lconv->mon_thousands_sep;
- csymbol = *lconv->currency_symbol;
- dsymbol = *lconv->mon_decimal_point;
- nsymbol = lconv->negative_sign;
+ if (lconvert == NULL)
+ lconvert = localeconv();
+
+ mon_group = *lconvert->mon_grouping;
+ comma = *lconvert->mon_thousands_sep;
+ csymbol = *lconvert->currency_symbol;
+ dsymbol = *lconvert->mon_decimal_point;
+ nsymbol = lconvert->negative_sign;
/* frac_digits in the C locale seems to return CHAR_MAX */
/* best guess is 2 in this case I think */
- points = ((lconv->frac_digits != CHAR_MAX) ? lconv->frac_digits : 2); /* int_frac_digits? */
- convention = lconv->n_sign_posn;
+ points = ((lconvert->frac_digits != CHAR_MAX) ? lconvert->frac_digits : 2); /* int_frac_digits? */
+ convention = lconvert->n_sign_posn;
#else
mon_group = 3;
comma = ',';