2008-02-08 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define. * mingwex/gdtoa/mingw_snprintf.c: [USE_LOCALE] Include locale.h. (x_sprintf): [USE_LOCALE] Use *localeconv()->decimal_point.
This commit is contained in:
parent
197dffcbd6
commit
b6f8240fa0
|
@ -1,3 +1,8 @@
|
||||||
|
2008-02-08 Danny Smith <dannysmith@users.sourceforge.net>
|
||||||
|
* mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define.
|
||||||
|
* mingwex/gdtoa/mingw_snprintf.c: [USE_LOCALE] Include locale.h.
|
||||||
|
(x_sprintf): [USE_LOCALE] Use *localeconv()->decimal_point.
|
||||||
|
|
||||||
2008-02-28 Joseph Myers <joseph@codesourcery.com>
|
2008-02-28 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* include/complex.h: Don't condition contents on C99 or not
|
* include/complex.h: Don't condition contents on C99 or not
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The author of this software is David M. Gay.
|
The author of this software is David M. Gay.
|
||||||
|
|
||||||
Copyright (C) 1998-2000 by Lucent Technologies
|
Copyright (C) 1998-2008 by Lucent Technologies
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and
|
Permission to use, copy, modify, and distribute this software and
|
||||||
|
@ -172,6 +172,7 @@ THIS SOFTWARE.
|
||||||
|
|
||||||
#define INFNAN_CHECK 1
|
#define INFNAN_CHECK 1
|
||||||
#define MULTIPLE_THREADS 1
|
#define MULTIPLE_THREADS 1
|
||||||
|
#define USE_LOCALE 1
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -91,8 +91,10 @@ THIS SOFTWARE.
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "gdtoa.h"
|
#include "gdtoaimp.h"
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
#include "locale.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For a MinGW build, we provide the implementation dependent entries
|
* For a MinGW build, we provide the implementation dependent entries
|
||||||
|
@ -381,6 +383,12 @@ x_sprintf
|
||||||
static char hex[] = "0123456789abcdef";
|
static char hex[] = "0123456789abcdef";
|
||||||
static char Hex[] = "0123456789ABCDEF";
|
static char Hex[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
|
#ifdef USE_LOCALE
|
||||||
|
char decimalpoint = *localeconv()->decimal_point;
|
||||||
|
#else
|
||||||
|
static const char decimalpoint = '.';
|
||||||
|
#endif
|
||||||
|
|
||||||
ob0 = outbuf = f->ob0;
|
ob0 = outbuf = f->ob0;
|
||||||
rv = 0;
|
rv = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
@ -751,7 +759,7 @@ x_sprintf
|
||||||
if (decpt <= 0) {
|
if (decpt <= 0) {
|
||||||
put('0')
|
put('0')
|
||||||
if (prec > 0 || alt)
|
if (prec > 0 || alt)
|
||||||
put('.')
|
put(decimalpoint)
|
||||||
while(decpt < 0) {
|
while(decpt < 0) {
|
||||||
put('0')
|
put('0')
|
||||||
prec--;
|
prec--;
|
||||||
|
@ -768,7 +776,7 @@ x_sprintf
|
||||||
}
|
}
|
||||||
while(--decpt > 0);
|
while(--decpt > 0);
|
||||||
if (prec > 0 || alt)
|
if (prec > 0 || alt)
|
||||||
put('.')
|
put(decimalpoint)
|
||||||
}
|
}
|
||||||
while(--prec >= 0) {
|
while(--prec >= 0) {
|
||||||
if ((c = *s))
|
if ((c = *s))
|
||||||
|
@ -868,7 +876,7 @@ x_sprintf
|
||||||
put(sign)
|
put(sign)
|
||||||
put(*s++)
|
put(*s++)
|
||||||
if (prec || alt)
|
if (prec || alt)
|
||||||
put('.')
|
put(decimalpoint)
|
||||||
while(--prec >= 0) {
|
while(--prec >= 0) {
|
||||||
if ((c = *s))
|
if ((c = *s))
|
||||||
s++;
|
s++;
|
||||||
|
|
Loading…
Reference in New Issue