aboutsummaryrefslogtreecommitdiffstats
path: root/missing
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-14 14:33:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-07-14 18:35:23 +0900
commitbc8cc68aeff7ae3be1353f4077633cda4d30b54b (patch)
treefe7a837988c61903e92d0165c32d20b7f34c82f3 /missing
parentcfc564ac40496a392f463658ea33954ea76d6b11 (diff)
downloadruby-bc8cc68aeff7ae3be1353f4077633cda4d30b54b.tar.gz
Make dtoa.c buildable alone
Diffstat (limited to 'missing')
-rw-r--r--missing/dtoa.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/missing/dtoa.c b/missing/dtoa.c
index b7a8302875..bce2cb22a1 100644
--- a/missing/dtoa.c
+++ b/missing/dtoa.c
@@ -183,7 +183,10 @@
#undef Long
#undef ULong
+#include <assert.h>
#include <limits.h>
+#include <stddef.h>
+#include <stdint.h>
#if (INT_MAX >> 30) && !(INT_MAX >> 31)
#define Long int
@@ -195,7 +198,7 @@
#error No 32bit integer
#endif
-#if HAVE_LONG_LONG
+#if defined(HAVE_LONG_LONG) && (HAVE_LONG_LONG)
#define Llong LONG_LONG
#else
#define NO_LONG_LONG
@@ -221,12 +224,12 @@
#ifdef MALLOC
extern void *MALLOC(size_t);
#else
-#define MALLOC xmalloc
+#define MALLOC malloc
#endif
#ifdef FREE
extern void FREE(void*);
#else
-#define FREE xfree
+#define FREE free
#endif
#ifndef NO_SANITIZE
#define NO_SANITIZE(x, y) y
@@ -502,7 +505,7 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
#endif
#ifndef ATOMIC_PTR_CAS
-#define ATOMIC_PTR_CAS(var, old, new) ((var) = (new), (old))
+#define ATOMIC_PTR_CAS(var, old, new) ((var) = (new), (void *)(old))
#endif
#ifndef LIKELY
#define LIKELY(x) (x)