fixed the printing issue of a long double value for MINGW32

This commit is contained in:
hyung-hwan 2008-12-10 03:50:40 +00:00
parent 8d174e9ec4
commit 4339b7cf8c
4 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: extio.c 372 2008-09-23 09:51:24Z baconevi $ * $Id: extio.c 466 2008-12-09 09:50:40Z baconevi $
* *
* {License} * {License}
*/ */
@ -394,6 +394,7 @@ int ase_awk_readextio (
return ret; return ret;
} }
#include <ase/utl/stdio.h>
int ase_awk_writeextio_val ( int ase_awk_writeextio_val (
ase_awk_run_t* run, int out_type, ase_awk_run_t* run, int out_type,
const ase_char_t* name, ase_awk_val_t* v) const ase_char_t* name, ase_awk_val_t* v)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: run.c 391 2008-09-27 09:51:23Z baconevi $ * $Id: run.c 466 2008-12-09 09:50:40Z baconevi $
* *
* {License} * {License}
*/ */
@ -6954,7 +6954,7 @@ ase_char_t* ase_awk_format (
ase_real_t r; ase_real_t r;
ase_char_t* p; ase_char_t* p;
int n; int n;
FMT_CHAR (ASE_T('L')); FMT_CHAR (ASE_T('L'));
FMT_CHAR (fmt[i]); FMT_CHAR (fmt[i]);
@ -6999,7 +6999,12 @@ ase_char_t* ase_awk_format (
run->format.tmp.ptr, run->format.tmp.ptr,
run->format.tmp.len, run->format.tmp.len,
ASE_STR_PTR(fbu), ASE_STR_PTR(fbu),
(long double)r); #if defined(__MINGW32__)
(double)r
#else
(long double)r
#endif
);
if (n == -1) if (n == -1)
{ {

View File

@ -1,5 +1,5 @@
/* /*
* $Id: tree.c 381 2008-09-24 11:07:24Z baconevi $ * $Id: tree.c 466 2008-12-09 09:50:40Z baconevi $
* *
* {License} * {License}
*/ */
@ -264,7 +264,7 @@ static int print_expression (ase_awk_t* awk, ase_awk_nde_t* nde)
{ {
if (((ase_awk_nde_real_t*)nde)->str == ASE_NULL) if (((ase_awk_nde_real_t*)nde)->str == ASE_NULL)
{ {
#if (ASE_SIZEOF_LONG_DOUBLE != 0) #if (ASE_SIZEOF_LONG_DOUBLE != 0) && !defined(__MINGW32__)
awk->prmfns->sprintf ( awk->prmfns->sprintf (
awk->prmfns->data, awk->prmfns->data,
awk->tmp.fmt, ASE_COUNTOF(awk->tmp.fmt), ASE_T("%Lf"), awk->tmp.fmt, ASE_COUNTOF(awk->tmp.fmt), ASE_T("%Lf"),

View File

@ -1,5 +1,5 @@
/* /*
* $Id: val.c 389 2008-09-26 08:01:24Z baconevi $ * $Id: val.c 466 2008-12-09 09:50:40Z baconevi $
* *
* {License} * {License}
*/ */
@ -1178,8 +1178,13 @@ void ase_awk_dprintval (ase_awk_run_t* run, ase_awk_val_t* val)
break; break;
case ASE_AWK_VAL_REAL: case ASE_AWK_VAL_REAL:
#if defined(__MINGW32__)
DPRINTF (DCUSTOM, ASE_T("%Lf"),
(double)((ase_awk_val_real_t*)val)->val);
#else
DPRINTF (DCUSTOM, ASE_T("%Lf"), DPRINTF (DCUSTOM, ASE_T("%Lf"),
(long double)((ase_awk_val_real_t*)val)->val); (long double)((ase_awk_val_real_t*)val)->val);
#endif
break; break;
case ASE_AWK_VAL_STR: case ASE_AWK_VAL_STR: