# HG changeset patch # User mjsousa # Date 1399548108 -3600 # Node ID 499486ece1196e1910020fd8ebb9c1480fff2901 # Parent 5f380b99e95e1660a6fc8817aa336b1eef25b117 Fix compilation error on platforms where real64_t is mapped onto 'long double' diff -r 5f380b99e95e -r 499486ece119 main.hh --- a/main.hh Tue Apr 08 14:35:31 2014 +0100 +++ b/main.hh Thu May 08 12:21:48 2014 +0100 @@ -78,14 +78,16 @@ #include #if (LDBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ - #define long_double long double - #define real64_t long_double /* so we can later use #if (real64_t == long_double) directives in the code! */ + #define real64_tX long_double /* so we can later use #if (real64_t == long_double) directives in the code! */ + #define real64_t long double /* NOTE: no underscore '_' between 'long' and 'double' */ #define REAL64_MAX LDBL_MAX #elif ( DBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ - #define real64_t double + #define real64_tX double + #define real64_t double #define REAL64_MAX DBL_MAX #elif ( FLT_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ - #define real64_t float + #define real64_tX float + #define real64_t float #define REAL64_MAX FLT_MAX #else #error Could not find a 64 bit floating point data type on this platform. Aborting... @@ -93,16 +95,16 @@ #if (LDBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ - #ifndef long_double - #define long_double long double - #endif - #define real32_t long_double /* so we can later use #if (real32_t == long_double) directives in the code! */ + #define real32_tX long_double /* so we can later use #if (real32_t == long_double) directives in the code! */ + #define real32_t long double /* NOTE: no underscore '_' between 'long' and 'double' */ #define REAL32_MAX LDBL_MAX #elif ( DBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ - #define real32_t double + #define real32_tX double + #define real32_t double #define REAL32_MAX DBL_MAX #elif ( FLT_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ - #define real32_t float + #define real32_tX float + #define real32_t float #define REAL32_MAX FLT_MAX #else #error Could not find a 32 bit floating point data type on this platform. Aborting... diff -r 5f380b99e95e -r 499486ece119 stage3/constant_folding.cc --- a/stage3/constant_folding.cc Tue Apr 08 14:35:31 2014 +0100 +++ b/stage3/constant_folding.cc Thu May 08 12:21:48 2014 +0100 @@ -379,14 +379,14 @@ else ERROR; errno = 0; // since strtoXX() may legally return 0, we must set errno to 0 to detect errors correctly! - #if (real64_t == float) + #if (real64_tX == float) ret = strtof(str.c_str(), &endptr); - #elif (real64_t == double) + #elif (real64_tX == double) ret = strtod(str.c_str(), &endptr); - #elif (real64_t == long_double) + #elif (real64_tX == long_double) ret = strtold(str.c_str(), &endptr); #else - #error Could not determine which data type is being used for real64_t (defined in absyntax.hh). Aborting! + #error Could not determine which data type is being used for real64_t (defined in main.hh). Aborting! #endif if (overflow != NULL) *overflow = (errno == ERANGE);