Permalink
Browse files

define `MRB_PRI?` that map to `PRI?NN` depending on the size of `mrb_…

…int`
  • Loading branch information...
kazuho committed Jan 6, 2016
1 parent 9145aed commit cd131d18a7cc56682378dba5418a14a3710c2aa5
Showing with 9 additions and 0 deletions.
  1. +9 −0 include/mruby/value.h
View
@@ -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

0 comments on commit cd131d1

Please sign in to comment.