Skip to content

Commit bc8cc68

Browse files
committed
Make dtoa.c buildable alone
1 parent cfc564a commit bc8cc68

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎missing/dtoa.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@
183183
#undef Long
184184
#undef ULong
185185

186+
#include <assert.h>
186187
#include <limits.h>
188+
#include <stddef.h>
189+
#include <stdint.h>
187190

188191
#if (INT_MAX >> 30) && !(INT_MAX >> 31)
189192
#define Long int
@@ -195,7 +198,7 @@
195198
#error No 32bit integer
196199
#endif
197200

198-
#if HAVE_LONG_LONG
201+
#if defined(HAVE_LONG_LONG) && (HAVE_LONG_LONG)
199202
#define Llong LONG_LONG
200203
#else
201204
#define NO_LONG_LONG
@@ -221,12 +224,12 @@
221224
#ifdef MALLOC
222225
extern void *MALLOC(size_t);
223226
#else
224-
#define MALLOC xmalloc
227+
#define MALLOC malloc
225228
#endif
226229
#ifdef FREE
227230
extern void FREE(void*);
228231
#else
229-
#define FREE xfree
232+
#define FREE free
230233
#endif
231234
#ifndef NO_SANITIZE
232235
#define NO_SANITIZE(x, y) y
@@ -502,7 +505,7 @@ extern double rnd_prod(double, double), rnd_quot(double, double);
502505
#endif
503506

504507
#ifndef ATOMIC_PTR_CAS
505-
#define ATOMIC_PTR_CAS(var, old, new) ((var) = (new), (old))
508+
#define ATOMIC_PTR_CAS(var, old, new) ((var) = (new), (void *)(old))
506509
#endif
507510
#ifndef LIKELY
508511
#define LIKELY(x) (x)

0 commit comments

Comments
 (0)