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)
This commit is contained in:
Thomas G. Lockhart 1997-10-03 13:10:06 +00:00
parent d663f1c839
commit 8b028b5c2d
1 changed files with 19 additions and 20 deletions

View File

@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by * workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * 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> #include <stdio.h>
@ -33,8 +33,7 @@ static const char *num_word(Cash value);
#define LAST_DIGIT (LAST_PAREN - 1) #define LAST_DIGIT (LAST_PAREN - 1)
#ifdef USE_LOCALE #ifdef USE_LOCALE
static struct lconv *lconv = NULL; static struct lconv *lconvert = NULL;
#endif #endif
/* cash_in() /* cash_in()
@ -65,18 +64,18 @@ cash_in(const char *str)
csymbol; csymbol;
#ifdef USE_LOCALE #ifdef USE_LOCALE
if (lconv == NULL) if (lconvert == NULL)
lconv = localeconv(); lconvert = localeconv();
/* frac_digits in the C locale seems to return CHAR_MAX */ /* frac_digits in the C locale seems to return CHAR_MAX */
/* best guess is 2 in this case I think */ /* 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; dsymbol = *lconvert->mon_decimal_point;
ssymbol = *lconv->mon_thousands_sep; ssymbol = *lconvert->mon_thousands_sep;
csymbol = *lconv->currency_symbol; csymbol = *lconvert->currency_symbol;
psymbol = *lconv->positive_sign; psymbol = *lconvert->positive_sign;
nsymbol = *lconv->negative_sign; nsymbol = *lconvert->negative_sign;
#else #else
fpoint = 2; fpoint = 2;
dsymbol = '.'; dsymbol = '.';
@ -183,18 +182,18 @@ cash_out(Cash *in_value)
char convention; char convention;
#ifdef USE_LOCALE #ifdef USE_LOCALE
if (lconv == NULL) if (lconvert == NULL)
lconv = localeconv(); lconvert = localeconv();
mon_group = *lconv->mon_grouping; mon_group = *lconvert->mon_grouping;
comma = *lconv->mon_thousands_sep; comma = *lconvert->mon_thousands_sep;
csymbol = *lconv->currency_symbol; csymbol = *lconvert->currency_symbol;
dsymbol = *lconv->mon_decimal_point; dsymbol = *lconvert->mon_decimal_point;
nsymbol = lconv->negative_sign; nsymbol = lconvert->negative_sign;
/* frac_digits in the C locale seems to return CHAR_MAX */ /* frac_digits in the C locale seems to return CHAR_MAX */
/* best guess is 2 in this case I think */ /* best guess is 2 in this case I think */
points = ((lconv->frac_digits != CHAR_MAX) ? lconv->frac_digits : 2); /* int_frac_digits? */ points = ((lconvert->frac_digits != CHAR_MAX) ? lconvert->frac_digits : 2); /* int_frac_digits? */
convention = lconv->n_sign_posn; convention = lconvert->n_sign_posn;
#else #else
mon_group = 3; mon_group = 3;
comma = ','; comma = ',';