From 3fa11becc5b88b2ff2099721d0d6834ba273309e Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 22 Dec 2018 11:05:17 +0100 Subject: remove unneeded BSD & Solaris compatibility layer None of the BSDs need "compat-bsd.c" anymore. Same for Solaris and "compat-solaris.c", even for Solaris 10. The only problem was lacking C99's strtold() but it seems that this was solved many years ago and they're all doing quite fine with "compat-linux.c". So, simply replace the content of these file by an include of "compat-linux.c". Signed-off-by: Luc Van Oostenryck --- compat-bsd.c | 14 +------------- compat-solaris.c | 34 +--------------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/compat-bsd.c b/compat-bsd.c index d8acf40b..43c716ca 100644 --- a/compat-bsd.c +++ b/compat-bsd.c @@ -21,16 +21,4 @@ * THE SOFTWARE. */ -#include -#include - -#include "lib.h" -#include "allocate.h" -#include "token.h" - -#include "compat/mmap-blob.c" - -long double string_to_ld(const char *nptr, char **endptr) -{ - return strtod(nptr, endptr); -} +#include "compat-linux.c" diff --git a/compat-solaris.c b/compat-solaris.c index 7253a892..58bc4338 100644 --- a/compat-solaris.c +++ b/compat-solaris.c @@ -1,33 +1 @@ -#include "lib.h" -#include "allocate.h" - -#include "compat/mmap-blob.c" - -#include -#include -#include - -long double string_to_ld(const char *str, char **endptr) -{ - long double res; - decimal_record dr; - enum decimal_string_form form; - decimal_mode dm; - fp_exception_field_type excp; - char *echar; - - string_to_decimal ((char **)&str, INT_MAX, 0, - &dr, &form, &echar); - if (endptr) *endptr = (char *)str; - - if (form == invalid_form) { - errno = EINVAL; - return 0.0; - } - - dm.rd = fp_nearest; - decimal_to_quadruple (&res, &dm, &dr, &excp); - if (excp & ((1 << fp_overflow) | (1 << fp_underflow))) - errno = ERANGE; - return res; -} +#include "compat-linux.c" -- cgit 1.2.3-korg