Skip to content

Commit

Permalink
define MRB_PRI? that map to PRI?NN depending on the size of `mrb_…
Browse files Browse the repository at this point in the history
…int`
  • Loading branch information
kazuho committed Jan 6, 2016
1 parent 9145aed commit cd131d1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/mruby/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,25 @@ struct mrb_state;
# define MRB_INT_BIT 64
# define MRB_INT_MIN (INT64_MIN>>MRB_FIXNUM_SHIFT)
# define MRB_INT_MAX (INT64_MAX>>MRB_FIXNUM_SHIFT)
# define MRB_PRIo PRIo64
# define MRB_PRId PRId64
# define MRB_PRIx PRIx64
#elif defined(MRB_INT16)
typedef int16_t mrb_int;
# define MRB_INT_BIT 16
# define MRB_INT_MIN (INT16_MIN>>MRB_FIXNUM_SHIFT)
# define MRB_INT_MAX (INT16_MAX>>MRB_FIXNUM_SHIFT)
# define MRB_PRIo PRIo16
# define MRB_PRId PRId16
# define MRB_PRIx PRIx16
#else
typedef int32_t mrb_int;
# define MRB_INT_BIT 32
# define MRB_INT_MIN (INT32_MIN>>MRB_FIXNUM_SHIFT)
# define MRB_INT_MAX (INT32_MAX>>MRB_FIXNUM_SHIFT)
# define MRB_PRIo PRIo32
# define MRB_PRId PRId32
# define MRB_PRIx PRIx32
#endif

#ifdef MRB_USE_FLOAT
Expand Down

0 comments on commit cd131d1

Please sign in to comment.