diff options
Diffstat (limited to 'libgcobol/libgcobol.cc')
-rw-r--r-- | libgcobol/libgcobol.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libgcobol/libgcobol.cc b/libgcobol/libgcobol.cc index 224c5f2..c163e2c 100644 --- a/libgcobol/libgcobol.cc +++ b/libgcobol/libgcobol.cc @@ -49,6 +49,8 @@ #include <dirent.h> #include <sys/resource.h> +#include "config.h" + #include "ec.h" #include "common-defs.h" #include "io.h" @@ -66,6 +68,30 @@ #include "exceptl.h" +#if !defined (HAVE_STRFROMF32) +# if __FLT_MANT_DIG__ == 24 && __FLT_MAX_EXP__ == 128 +static int +strfromf32 (char *s, size_t n, const char *f, float v) +{ + return snprintf (s, n, f, (double) v); +} +# else +# error "It looks like float on this platform is not IEEE754" +# endif +#endif + +#if !defined (HAVE_STRFROMF64) +# if __DBL_MANT_DIG__ == 53 && __DBL_MAX_EXP__ == 1024 +static int +strfromf64 (char *s, size_t n, const char *f, double v) +{ + return snprintf (s, n, f, v); +} +# else +# error "It looks like double on this platform is not IEEE754" +# endif +#endif + // This couldn't be defined in symbols.h because it conflicts with a LEVEL66 // in parse.h #define LEVEL66 (66) |