enhanced qse_awk_flt_t handling

This commit is contained in:
hyung-hwan 2013-11-05 02:53:01 +00:00
parent ca1d1ede66
commit 2a5dd843dd
12 changed files with 95 additions and 48 deletions

View File

@ -10,6 +10,7 @@
suffix ".htm" = "text/html"; suffix ".htm" = "text/html";
suffix ".html" = "text/html"; suffix ".html" = "text/html";
suffix ".txt" = "text/plain"; suffix ".txt" = "text/plain";
suffix ".log" = "text/plain";
suffix ".css" = "text/css"; suffix ".css" = "text/css";
suffix ".xml" = "text/xml"; suffix ".xml" = "text/xml";
suffix ".js" = "application/javascript"; suffix ".js" = "application/javascript";

35
qse/configure vendored
View File

@ -839,7 +839,8 @@ enable_syscall
enable_debug enable_debug
enable_cxx enable_cxx
enable_reentrant enable_reentrant
enable_sedtracer enable_awk_fltmax
enable_sed_tracer
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
host_alias host_alias
@ -1497,7 +1498,9 @@ Optional Features:
--enable-cxx build the library for C++ if a C++ compiler is --enable-cxx build the library for C++ if a C++ compiler is
available (default. yes) available (default. yes)
--enable-reentrant add thread options (default. no) --enable-reentrant add thread options (default. no)
--enable-sedtracer enable qse_sed_setexectracer() (default. yes) --enable-awk-fltmax use qse_fltmax_t for floating-point numbers in AWK
(default. no)
--enable-sed-tracer enable qse_sed_setexectracer() (default. yes)
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -21005,17 +21008,33 @@ then
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
fi fi
# Check whether --enable-sedtracer was given. # Check whether --enable-awk-fltmax was given.
if test "${enable_sedtracer+set}" = set; then : if test "${enable_awk_fltmax+set}" = set; then :
enableval=$enable_sedtracer; enable_sedtracer_is=$enableval enableval=$enable_awk_fltmax; enable_awk_fltmax_is=$enableval
else else
enable_sedtracer_is=yes enable_awk_fltmax_is=no
fi fi
if test "${enable_sedtracer_is}" = "yes" if test "${enable_awk_fltmax_is}" = "yes"
then then
$as_echo "#define QSE_ENABLE_SEDTRACER /**/" >>confdefs.h $as_echo "#define QSE_USE_AWK_FLTMAX /**/" >>confdefs.h
fi
# Check whether --enable-sed-tracer was given.
if test "${enable_sed_tracer+set}" = set; then :
enableval=$enable_sed_tracer; enable_sed_tracer_is=$enableval
else
enable_sed_tracer_is=yes
fi
if test "${enable_sed_tracer_is}" = "yes"
then
$as_echo "#define QSE_ENABLE_SED_TRACER /**/" >>confdefs.h
fi fi

View File

@ -560,11 +560,24 @@ then
[CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"] [CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"]
fi fi
AC_ARG_ENABLE([sedtracer], [AS_HELP_STRING([--enable-sedtracer],[enable qse_sed_setexectracer() (default. yes)])], AC_ARG_ENABLE([awk-fltmax],
enable_sedtracer_is=$enableval,enable_sedtracer_is=yes) [AS_HELP_STRING([--enable-awk-fltmax],[use qse_fltmax_t for floating-point numbers in AWK (default. no)])],
if test "${enable_sedtracer_is}" = "yes" enable_awk_fltmax_is=$enableval,
enable_awk_fltmax_is=no
)
if test "${enable_awk_fltmax_is}" = "yes"
then then
AC_DEFINE([QSE_ENABLE_SEDTRACER],[],[enable qse_sed_setexectracer()]) AC_DEFINE([QSE_USE_AWK_FLTMAX],[],[use qse_fltmax_t for floating-point numbers in AWK])
fi
AC_ARG_ENABLE([sed-tracer],
[AS_HELP_STRING([--enable-sed-tracer],[enable qse_sed_setexectracer() (default. yes)])],
enable_sed_tracer_is=$enableval,
enable_sed_tracer_is=yes
)
if test "${enable_sed_tracer_is}" = "yes"
then
AC_DEFINE([QSE_ENABLE_SED_TRACER],[],[enable qse_sed_setexectracer()])
fi fi
AC_MSG_CHECKING([for socklen_t in sys/socket.h]) AC_MSG_CHECKING([for socklen_t in sys/socket.h])

View File

@ -44,9 +44,13 @@ public:
typedef qse_htb_t htb_t; typedef qse_htb_t htb_t;
typedef qse_htb_pair_t pair_t; typedef qse_htb_pair_t pair_t;
/** Defines a primitive handle */ // define a primitive handle
typedef qse_awk_t awk_t; typedef qse_awk_t awk_t;
// redefine flt_t. To access Types::flt_t, use the fully qualified
// name as it's overriding Types::flt_t.
typedef qse_awk_flt_t flt_t;
typedef qse_awk_loc_t loc_t; typedef qse_awk_loc_t loc_t;
typedef qse_awk_errnum_t errnum_t; typedef qse_awk_errnum_t errnum_t;
typedef qse_awk_errstr_t errstr_t; typedef qse_awk_errstr_t errstr_t;

View File

@ -35,8 +35,8 @@
* - consider something like ${1:3,5} => $1, $2, $3, and $5 concatenated * - consider something like ${1:3,5} => $1, $2, $3, and $5 concatenated
*/ */
#if defined(QSE_AWK_USE_FLTMAX_T) #if defined(QSE_USE_AWK_FLTMAX)
typedef qse_flt_t qse_awk_fltmax_t; typedef qse_fltmax_t qse_awk_flt_t;
#else #else
typedef qse_flt_t qse_awk_flt_t; typedef qse_flt_t qse_awk_flt_t;
#endif #endif

View File

@ -716,7 +716,7 @@
#undef QSE_ENABLE_BUNDLED_UNICODE #undef QSE_ENABLE_BUNDLED_UNICODE
/* enable qse_sed_setexectracer() */ /* enable qse_sed_setexectracer() */
#undef QSE_ENABLE_SEDTRACER #undef QSE_ENABLE_SED_TRACER
/* link modules statically into the main library */ /* link modules statically into the main library */
#undef QSE_ENABLE_STATIC_MODULE #undef QSE_ENABLE_STATIC_MODULE
@ -823,6 +823,9 @@
/* sizeof(__int8) */ /* sizeof(__int8) */
#undef QSE_SIZEOF___INT8 #undef QSE_SIZEOF___INT8
/* use qse_fltmax_t for floating-point numbers in AWK */
#undef QSE_USE_AWK_FLTMAX
/* use the syscall() function to invoke a system call */ /* use the syscall() function to invoke a system call */
#undef QSE_USE_SYSCALL #undef QSE_USE_SYSCALL

View File

@ -1168,7 +1168,7 @@ void StdAwk::freeMem (void* ptr)
StdAwk::flt_t StdAwk::pow (flt_t x, flt_t y) StdAwk::flt_t StdAwk::pow (flt_t x, flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_POWQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_POWQ)
return ::powq (x, y); return ::powq (x, y);
#elif defined(HAVE_POWL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_POWL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::powl (x, y); return ::powl (x, y);
@ -1183,7 +1183,7 @@ StdAwk::flt_t StdAwk::pow (flt_t x, flt_t y)
StdAwk::flt_t StdAwk::mod (flt_t x, flt_t y) StdAwk::flt_t StdAwk::mod (flt_t x, flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_FMODQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_FMODQ)
return ::fmodq (x, y); return ::fmodq (x, y);
#elif defined(HAVE_FMODL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_FMODL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::fmodl (x, y); return ::fmodl (x, y);
@ -1198,7 +1198,7 @@ StdAwk::flt_t StdAwk::mod (flt_t x, flt_t y)
StdAwk::flt_t StdAwk::sin (flt_t x) StdAwk::flt_t StdAwk::sin (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_SINQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_SINQ)
return ::sinq (x); return ::sinq (x);
#elif defined(HAVE_SINL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_SINL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::sinl (x); return ::sinl (x);
@ -1213,7 +1213,7 @@ StdAwk::flt_t StdAwk::sin (flt_t x)
StdAwk::flt_t StdAwk::cos (flt_t x) StdAwk::flt_t StdAwk::cos (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_COSQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_COSQ)
return ::cosq (x); return ::cosq (x);
#elif defined(HAVE_COSL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_COSL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::cosl (x); return ::cosl (x);
@ -1228,7 +1228,7 @@ StdAwk::flt_t StdAwk::cos (flt_t x)
StdAwk::flt_t StdAwk::tan (flt_t x) StdAwk::flt_t StdAwk::tan (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_TANQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_TANQ)
return ::tanq (x); return ::tanq (x);
#elif defined(HAVE_TANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_TANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::tanl (x); return ::tanl (x);
@ -1243,7 +1243,7 @@ StdAwk::flt_t StdAwk::tan (flt_t x)
StdAwk::flt_t StdAwk::atan (flt_t x) StdAwk::flt_t StdAwk::atan (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_ATANQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_ATANQ)
return ::atanq (x); return ::atanq (x);
#elif defined(HAVE_ATANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_ATANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::atanl (x); return ::atanl (x);
@ -1258,7 +1258,7 @@ StdAwk::flt_t StdAwk::atan (flt_t x)
StdAwk::flt_t StdAwk::atan2 (flt_t x, flt_t y) StdAwk::flt_t StdAwk::atan2 (flt_t x, flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_ATAN2Q) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_ATAN2Q)
return ::atan2q (x, y); return ::atan2q (x, y);
#elif defined(HAVE_ATAN2L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_ATAN2L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::atan2l (x, y); return ::atan2l (x, y);
@ -1274,7 +1274,7 @@ StdAwk::flt_t StdAwk::atan2 (flt_t x, flt_t y)
StdAwk::flt_t StdAwk::log (flt_t x) StdAwk::flt_t StdAwk::log (flt_t x)
{ {
/* natural logarithm */ /* natural logarithm */
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_LOGQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_LOGQ)
return ::logq (x); return ::logq (x);
#elif defined(HAVE_LOGL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_LOGL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::logl (x); return ::logl (x);
@ -1290,7 +1290,7 @@ StdAwk::flt_t StdAwk::log (flt_t x)
StdAwk::flt_t StdAwk::log10 (flt_t x) StdAwk::flt_t StdAwk::log10 (flt_t x)
{ {
/* common logarithm */ /* common logarithm */
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_LOG10Q) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_LOG10Q)
return ::log10q (x); return ::log10q (x);
#elif defined(HAVE_LOG10L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_LOG10L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::log10l (x); return ::log10l (x);
@ -1305,7 +1305,7 @@ StdAwk::flt_t StdAwk::log10 (flt_t x)
StdAwk::flt_t StdAwk::exp (flt_t x) StdAwk::flt_t StdAwk::exp (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_EXPQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_EXPQ)
return ::expq (x); return ::expq (x);
#elif defined(HAVE_EXPL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_EXPL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::expl (x); return ::expl (x);
@ -1320,7 +1320,7 @@ StdAwk::flt_t StdAwk::exp (flt_t x)
StdAwk::flt_t StdAwk::sqrt (flt_t x) StdAwk::flt_t StdAwk::sqrt (flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_SQRTQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_SQRTQ)
return ::sqrtq (x); return ::sqrtq (x);
#elif defined(HAVE_SQRTL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_SQRTL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return ::sqrtl (x); return ::sqrtl (x);

View File

@ -182,6 +182,13 @@ qse_long_t qse_awk_strxtolong (
* express or implied warranty. * express or implied warranty.
*/ */
/*
* double(64bits) extended(80-bits) quadruple(128-bits)
* exponent 11 bits 15 bits 15 bits
* fraction 52 bits 63 bits 112 bits
* sign 1 bit 1 bit 1 bit
* integer 1 bit
*/
#define MAX_EXPONENT 511 #define MAX_EXPONENT 511
qse_awk_flt_t qse_awk_strtoflt (qse_awk_t* awk, const qse_char_t* str) qse_awk_flt_t qse_awk_strtoflt (qse_awk_t* awk, const qse_char_t* str)
@ -199,10 +206,10 @@ qse_awk_flt_t qse_awk_strtoflt (qse_awk_t* awk, const qse_char_t* str)
qse_awk_flt_t fraction, dbl_exp, * d; qse_awk_flt_t fraction, dbl_exp, * d;
const qse_char_t* p; const qse_char_t* p;
qse_cint_t c; qse_cint_t c;
int exp = 0; /* Esseonent read from "EX" field */ int exp = 0; /* Exponent read from "EX" field */
/* /*
* Esseonent that derives from the fractional part. Under normal * Exponent that derives from the fractional part. Under normal
* circumstatnces, it is the negative of the number of digits in F. * circumstatnces, it is the negative of the number of digits in F.
* However, if I is very long, the last digits of I get dropped * However, if I is very long, the last digits of I get dropped
* (otherwise a long I with a large negative exponent could cause an * (otherwise a long I with a large negative exponent could cause an
@ -391,10 +398,10 @@ qse_awk_flt_t qse_awk_strxtoflt (
qse_awk_flt_t fraction, dbl_exp, * d; qse_awk_flt_t fraction, dbl_exp, * d;
const qse_char_t* p, * end; const qse_char_t* p, * end;
qse_cint_t c; qse_cint_t c;
int exp = 0; /* Esseonent read from "EX" field */ int exp = 0; /* Exponent read from "EX" field */
/* /*
* Esseonent that derives from the fractional part. Under normal * Exponent that derives from the fractional part. Under normal
* circumstatnces, it is the negative of the number of digits in F. * circumstatnces, it is the negative of the number of digits in F.
* However, if I is very long, the last digits of I get dropped * However, if I is very long, the last digits of I get dropped
* (otherwise a long I with a large negative exponent could cause an * (otherwise a long I with a large negative exponent could cause an

View File

@ -7290,7 +7290,7 @@ wp_mod_main:
qse_awk_flt_t r; qse_awk_flt_t r;
int n; int n;
#if defined(QSE_AWK_USE_FLTMAX_T) #if defined(QSE_USE_AWK_FLTMAX)
FMT_CHAR (QSE_T('j')); FMT_CHAR (QSE_T('j'));
#else #else
FMT_CHAR (QSE_T('z')); FMT_CHAR (QSE_T('z'));

View File

@ -160,7 +160,7 @@ static ioattr_t* get_ioattr (qse_htb_t* tab, const qse_char_t* ptr, qse_size_t l
static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_POWQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_POWQ)
return powq (x, y); return powq (x, y);
#elif defined(HAVE_POWL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_POWL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return powl (x, y); return powl (x, y);
@ -175,7 +175,7 @@ static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_fl
static qse_awk_flt_t custom_awk_mod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) static qse_awk_flt_t custom_awk_mod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_FMODQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_FMODQ)
return fmodq (x, y); return fmodq (x, y);
#elif defined(HAVE_FMODL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_FMODL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return fmodl (x, y); return fmodl (x, y);
@ -190,7 +190,7 @@ static qse_awk_flt_t custom_awk_mod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_fl
static qse_awk_flt_t custom_awk_sin (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_sin (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_SINQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_SINQ)
return sinq (x); return sinq (x);
#elif defined(HAVE_SINL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_SINL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return sinl (x); return sinl (x);
@ -205,7 +205,7 @@ static qse_awk_flt_t custom_awk_sin (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_cos (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_cos (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_COSQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_COSQ)
return cosq (x); return cosq (x);
#elif defined(HAVE_COSL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_COSL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return cosl (x); return cosl (x);
@ -220,7 +220,7 @@ static qse_awk_flt_t custom_awk_cos (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_tan (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_tan (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_TANQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_TANQ)
return tanq (x); return tanq (x);
#elif defined(HAVE_TANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_TANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return tanl (x); return tanl (x);
@ -235,7 +235,7 @@ static qse_awk_flt_t custom_awk_tan (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_atan (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_atan (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_ATANQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_ATANQ)
return atanq (x); return atanq (x);
#elif defined(HAVE_ATANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_ATANL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return atanl (x); return atanl (x);
@ -250,7 +250,7 @@ static qse_awk_flt_t custom_awk_atan (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_atan2 (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) static qse_awk_flt_t custom_awk_atan2 (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_ATAN2Q) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_ATAN2Q)
return atan2q (x, y); return atan2q (x, y);
#elif defined(HAVE_ATAN2L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_ATAN2L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return atan2l (x, y); return atan2l (x, y);
@ -265,7 +265,7 @@ static qse_awk_flt_t custom_awk_atan2 (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_
static qse_awk_flt_t custom_awk_log (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_log (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_LOGQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_LOGQ)
return logq (x); return logq (x);
#elif defined(HAVE_LOGL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_LOGL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return logl (x); return logl (x);
@ -280,7 +280,7 @@ static qse_awk_flt_t custom_awk_log (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_log10 (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_log10 (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_LOG10Q) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_LOG10Q)
return log10q (x); return log10q (x);
#elif defined(HAVE_LOG10L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_LOG10L) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return log10l (x); return log10l (x);
@ -295,7 +295,7 @@ static qse_awk_flt_t custom_awk_log10 (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_exp (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_exp (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_EXPQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_EXPQ)
return expq (x); return expq (x);
#elif defined(HAVE_EXPL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_EXPL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return expl (x); return expl (x);
@ -310,7 +310,7 @@ static qse_awk_flt_t custom_awk_exp (qse_awk_t* awk, qse_awk_flt_t x)
static qse_awk_flt_t custom_awk_sqrt (qse_awk_t* awk, qse_awk_flt_t x) static qse_awk_flt_t custom_awk_sqrt (qse_awk_t* awk, qse_awk_flt_t x)
{ {
#if defined(QSE_AWK_USE_FLTMAX_T) && defined(HAVE_SQRTQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_SQRTQ)
return sqrtq (x); return sqrtq (x);
#elif defined(HAVE_SQRTL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE) #elif defined(HAVE_SQRTL) && (QSE_SIZEOF_LONG_DOUBLE > QSE_SIZEOF_DOUBLE)
return sqrtl (x); return sqrtl (x);

View File

@ -345,7 +345,7 @@ static int print_expr (qse_awk_t* awk, qse_awk_nde_t* nde)
qse_strxfmt ( qse_strxfmt (
buf, QSE_COUNTOF(buf), buf, QSE_COUNTOF(buf),
#if defined(QSE_AWK_USE_FLTMAX_T) #if defined(QSE_USE_AWK_FLTMAX)
QSE_T("%jf"), QSE_T("%jf"),
#else #else
QSE_T("%zf"), QSE_T("%zf"),

View File

@ -3999,7 +3999,7 @@ int qse_sed_exec (qse_sed_t* sed, qse_sed_io_impl_t inf, qse_sed_io_impl_t outf)
while (!sed->e.stopreq) while (!sed->e.stopreq)
{ {
#if defined(QSE_ENABLE_SEDTRACER) #if defined(QSE_ENABLE_SED_TRACER)
if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_READ, QSE_NULL); if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_READ, QSE_NULL);
#endif #endif
@ -4020,7 +4020,7 @@ int qse_sed_exec (qse_sed_t* sed, qse_sed_io_impl_t inf, qse_sed_io_impl_t outf)
while (c != &sed->cmd.over) while (c != &sed->cmd.over)
{ {
#if defined(QSE_ENABLE_SEDTRACER) #if defined(QSE_ENABLE_SED_TRACER)
if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_MATCH, c); if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_MATCH, c);
#endif #endif
@ -4034,7 +4034,7 @@ int qse_sed_exec (qse_sed_t* sed, qse_sed_io_impl_t inf, qse_sed_io_impl_t outf)
continue; continue;
} }
#if defined(QSE_ENABLE_SEDTRACER) #if defined(QSE_ENABLE_SED_TRACER)
if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_EXEC, c); if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_EXEC, c);
#endif #endif
j = exec_cmd (sed, c); j = exec_cmd (sed, c);
@ -4053,7 +4053,7 @@ int qse_sed_exec (qse_sed_t* sed, qse_sed_io_impl_t inf, qse_sed_io_impl_t outf)
} }
} }
#if defined(QSE_ENABLE_SEDTRACER) #if defined(QSE_ENABLE_SED_TRACER)
if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_WRITE, QSE_NULL); if (sed->opt.tracer) sed->opt.tracer (sed, QSE_SED_TRACER_WRITE, QSE_NULL);
#endif #endif
if (emit_output (sed, 0) <= -1) { ret = -1; goto done; } if (emit_output (sed, 0) <= -1) { ret = -1; goto done; }