aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-22 11:05:17 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-28 11:06:43 +0200
commit3fa11becc5b88b2ff2099721d0d6834ba273309e (patch)
tree26f39ca5182748684afacfec2b47783a8d95582f
parentb24508f10b9a24b01bd41289f440942ff79b197e (diff)
downloadsparse-dev-3fa11becc5b88b2ff2099721d0d6834ba273309e.tar.gz
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 <luc.vanoostenryck@gmail.com>
-rw-r--r--compat-bsd.c14
-rw-r--r--compat-solaris.c34
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 <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 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 <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"