diff mbox series

remove unneeded BSD & Solaris compatibility layer

Message ID 20200628090904.69011-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series remove unneeded BSD & Solaris compatibility layer | expand

Commit Message

Luc Van Oostenryck June 28, 2020, 9:09 a.m. UTC
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 <luc.vanoostenryck@gmail.com>
---
 compat-bsd.c     | 14 +-------------
 compat-solaris.c | 34 +---------------------------------
 2 files changed, 2 insertions(+), 46 deletions(-)
diff mbox series

Patch

diff --git a/compat-bsd.c b/compat-bsd.c
index d8acf40b1dcb..43c716ca2f87 100644
--- a/compat-bsd.c
+++ b/compat-bsd.c
@@ -21,16 +21,4 @@ 
  * THE SOFTWARE.
  */
 
-#include <sys/types.h>
-#include <string.h>
-
-#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 7253a892d50d..58bc43387c60 100644
--- a/compat-solaris.c
+++ b/compat-solaris.c
@@ -1,33 +1 @@ 
-#include "lib.h"
-#include "allocate.h"
-
-#include "compat/mmap-blob.c"
-
-#include <floatingpoint.h>
-#include <limits.h>
-#include <errno.h>
-
-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"