26#if defined (__PURE_CNAME)
68#ifndef _RWSTD_NO_LIBC_EXCEPTION_SPEC
69# define LIBC_THROWS() throw ()
77#ifdef _RWSTD_NO_STRTOF
78# ifndef _RWSTD_NO_STRTOF_IN_LIBC
80# undef _RWSTD_NO_STRTOF
87#ifdef _RWSTD_NO_STRTOD
88# ifndef _RWSTD_NO_STRTOD_IN_LIBC
90# undef _RWSTD_NO_STRTOD
97#ifndef _RWSTD_NO_LONG_DOUBLE
98# ifdef _RWSTD_NO_STRTOLD
99# ifndef _RWSTD_NO_STRTOLD_IN_LIBC
101# undef _RWSTD_NO_STRTOLD
103long double strtold (
const char*,
char**)
LIBC_THROWS ();
112#ifndef _RWSTD_NO_HONOR_STD
113# ifdef _RWSTD_NO_STD_TERMINATE
122template <
class FloatT>
124 const char *macro_name,
const char *fmt,
int prec)
126 if (
'-' == *xstr ||
'0' <= *xstr &&
'9' >= *xstr) {
127 printf (
"#define _RWSTD_%-16s %s", macro_name, xstr);
130 printf (
"#define _RWSTD_%-16s ", macro_name);
136#define DO_STRINGIZE(x) #x
137#define STRINGIZE(x) DO_STRINGIZE (x)
139#define PRINTINT(macro) \
141 printf ("%s", "//"); \
142 printf ("#define _RWSTD_%-16s %6d\n", #macro, (macro))
144#define PRINTFLT(macro, fmt, prec, suffix) \
145 print_float (macro, STRINGIZE (macro), #macro, "%.*" fmt "e" suffix, prec)
155#ifdef _RWSTD_LDBL_PRINTF_PREFIX
156# define LDBL_FMT _RWSTD_LDBL_PRINTF_PREFIX
161#if defined (FLT_ROUNDS)
162 printf (
"#define _RWSTD_%-16s %6d /* %s */\n",
167 : 3 ==
FLT_ROUNDS ?
"round toward negative infinity"
186#ifndef _RWSTD_NO_LONG_DOUBLE
206#ifndef _RWSTD_NO_LONG_DOUBLE
207# if defined (LDBL_MAX)
212#if defined (DBL_EPSILON)
220#if defined (FLT_EPSILON)
228#ifndef _RWSTD_NO_LONG_DOUBLE
229# if defined (LDBL_EPSILON)
233# if defined (LDBL_MIN)
243#ifndef _RWSTD_NO_STRTOF
248 const float f = strtof (
"1.0e-999", (
char**)0);
251 if (f < 0.0 || f > 1.0 || !errno)
252 printf (
"#define _RWSTD_NO_STRTOF_UFLOW\n");
254 printf (
"// #define _RWSTD_NO_STRTOF_UFLOW // %d%s\n",
255 errno,
ERANGE == errno ?
" (ERANGE)" :
"");
259#ifndef _RWSTD_NO_STRTOD
264 const double d = strtod (
"1.0e-999", (
char**)0);
267 if (d < 0.0 || d > 1.0 || !errno)
268 printf (
"#define _RWSTD_NO_STRTOD_UFLOW\n");
270 printf (
"// #define _RWSTD_NO_STRTOD_UFLOW // %d%s\n",
271 errno,
ERANGE == errno ?
" (ERANGE)" :
"");
275#ifndef _RWSTD_NO_LONG_DOUBLE
276# ifndef _RWSTD_NO_STRTOLD
280# if !defined (__hpux) || !defined (_LONG_DOUBLE)
288 const long double ld = strtold (
"1.0e-9999", (
char**)0);
297 ldu.data = strtold (
"1.0e-9999", (
char**)0);
298 const long double ld = ldu.ld;
302 if (ld < 0.0 || ld > 1.0 || !errno)
303 printf (
"#define _RWSTD_NO_STRTOLD_UFLOW\n");
305 printf (
"// #define _RWSTD_NO_STRTOLD_UFLOW // %d%s\n",
306 errno,
ERANGE == errno ?
" (ERANGE)" :
"");
IMPORT_C SInt32 printf(const Char *,...)
void print_float(FloatT x, const char *xstr, const char *macro_name, const char *fmt, int prec)
#define PRINTFLT(macro, fmt, prec, suffix)