Pick double / long double depending on availability.

This commit is contained in:
Christoffer Lerno
2021-07-16 20:36:46 +02:00
parent 67d09cf7c6
commit 306ce5b39b
2 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@
#if LONG_DOUBLE
typedef long double Real;
#else
typedef double real;
typedef double Real;
#endif
#define MAX_ARRAYINDEX INT64_MAX

View File

@@ -431,7 +431,7 @@ static inline bool scan_hex(Lexer *lexer)
#if LONG_DOUBLE
Real fval = strtold(lexer->lexing_start, &end);
#else
real fval = strtod(lexer->lexing_start, &end);
Real fval = strtod(lexer->lexing_start, &end);
#endif
if (errno == ERANGE)
{
@@ -499,7 +499,7 @@ static inline bool scan_dec(Lexer *lexer)
#if LONG_DOUBLE
Real fval = strtold(lexer->lexing_start, &end);
#else
real fval = strtod(lexer->lexing_start, &end);
Real fval = strtod(lexer->lexing_start, &end);
#endif
if (end != lexer->current)
{