Browse Source

64-bit typedef fix, broke debug dump of type sizes

Make debug dumping of 64-bit type sizes conditional as it of course
won't work on platforms without 64-bit types.
pull/30/head
Sami Vaarala 11 years ago
parent
commit
bcee5d5a4b
  1. 10
      src/duk_features.h.in
  2. 4
      src/duk_heap_alloc.c

10
src/duk_features.h.in

@ -760,11 +760,17 @@ typedef duk_int16_t duk_int_fast16_t;
typedef duk_uint32_t duk_uint_fast32_t;
typedef duk_int32_t duk_int_fast32_t;
#if defined(DUK_F_HAVE_64BIT)
typedef duk_int64_t duk_intmax_t;
typedef duk_uint64_t duk_uint_least64_t;
typedef duk_int64_t duk_int_least64_t;
typedef duk_uint64_t duk_uint_fast64_t;
typedef duk_int64_t duk_int_fast64_t;
#endif
#if defined(DUK_F_HAVE_64BIT)
typedef duk_uint64_t duk_uintmax_t;
typedef duk_int64_t duk_intmax_t;
#else
typedef duk_int32_t duk_intmax_t;
typedef duk_uint32_t duk_uintmax_t;
typedef duk_int32_t duk_intmax_t;
#endif
/* This detection is not very reliable. */

4
src/duk_heap_alloc.c

@ -408,16 +408,20 @@ static void duk__dump_type_sizes(void) {
DUK__DUMPSZ(duk_int_least16_t);
DUK__DUMPSZ(duk_uint_least32_t);
DUK__DUMPSZ(duk_int_least32_t);
#if defined(DUK_USE_64BIT_OPS)
DUK__DUMPSZ(duk_uint_least64_t);
DUK__DUMPSZ(duk_int_least64_t);
#endif
DUK__DUMPSZ(duk_uint_fast8_t);
DUK__DUMPSZ(duk_int_fast8_t);
DUK__DUMPSZ(duk_uint_fast16_t);
DUK__DUMPSZ(duk_int_fast16_t);
DUK__DUMPSZ(duk_uint_fast32_t);
DUK__DUMPSZ(duk_int_fast32_t);
#if defined(DUK_USE_64BIT_OPS)
DUK__DUMPSZ(duk_uint_fast64_t);
DUK__DUMPSZ(duk_int_fast64_t);
#endif
DUK__DUMPSZ(duk_uintptr_t);
DUK__DUMPSZ(duk_intptr_t);
DUK__DUMPSZ(duk_uintmax_t);

Loading…
Cancel
Save