diff options
author | Claes Nästén <pekdon@gmail.com> | 2025-02-19 00:04:06 +0100 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-02-19 00:04:06 +0100 |
commit | 20ad6f765ed229411bb0b26c3cebcaa03346e739 (patch) | |
tree | 9bfdb26153eafc70be46f80b03869bf8733c629a /src/prefsparser.cc | |
parent | 7a595afa37423b99f79efbbbb2241090cb56653a (diff) |
Fix build on Solaris 10 and old gcc 4.0.1
Remove extra semicolons and commas, as well as isinf() so it builds and
runs on Solaris 10.
Also add extra fixes for non C++11 courtesy of Sevan Janiyan, making
Dillo compile and run on OS X 10.4 PowerPC with GCC 4.0.1 and 8.5.
Co-authored-by: Sevan Janiyan <venture37@geeklan.co.uk>
Diffstat (limited to 'src/prefsparser.cc')
-rw-r--r-- | src/prefsparser.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/prefsparser.cc b/src/prefsparser.cc index b5ab1b17..dd4e2ac3 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -18,7 +18,7 @@ #include <sys/types.h> #include <stdlib.h> #include <locale.h> /* for setlocale */ -#include <math.h> /* for isinf */ +#include <math.h> /* for HUGE_VAL */ #include <limits.h> #include "prefs.h" @@ -112,12 +112,11 @@ static int parseOption(char *name, char *value, case PREFS_FRACTION_100: { double d = strtod (value, NULL); - if (isinf(d)) { - if (d > 0) - *(int*)node->pref = INT_MAX; - else - *(int*)node->pref = INT_MIN; - } else + if (d == HUGE_VAL) + *(int*)node->pref = INT_MAX; + else if (d == -HUGE_VAL) + *(int*)node->pref = INT_MIN; + else *(int*)node->pref = 100 * d; } break; |