diff options
| author | Yuichiro MASUI <[email protected]> | 2013-01-21 23:21:16 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2013-01-21 23:21:16 +0900 |
| commit | 2b2051ebb1d4b40066a6fd79e2d3e18963bee174 (patch) | |
| tree | 232286093413216fe99993532ecb711f8d17e85e /include | |
| parent | cc2e4e73deea917ffd0c9ce6ad2840455df7b60b (diff) | |
| download | mruby-2b2051ebb1d4b40066a6fd79e2d3e18963bee174.tar.gz mruby-2b2051ebb1d4b40066a6fd79e2d3e18963bee174.zip | |
Fixed MRB_INT64 warning
Diffstat (limited to 'include')
| -rw-r--r-- | include/mrbconf.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h index 066c040f6..6a6d2a9b6 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -76,7 +76,7 @@ typedef int32_t mrb_int; # define MRB_INT_MIN INT32_MIN # define MRB_INT_MAX INT32_MAX -# define mrb_int_to_str(buf, i) sprintf((buf), "%d", (i)) +# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId32, (i)) # define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10) # endif #else @@ -84,13 +84,13 @@ typedef int64_t mrb_int; # define MRB_INT_MIN INT64_MIN # define MRB_INT_MAX INT64_MAX -# define mrb_int_to_str(buf, i) sprintf((buf), "%ld", (i)) +# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId64, (i)) # define str_to_mrb_int(buf) (mrb_int)strtoll((buf), NULL, 10) # else - typedef int mrb_int; -# define MRB_INT_MIN INT_MIN -# define MRB_INT_MAX INT_MAX -# define mrb_int_to_str(buf, i) sprintf((buf), "%d", (i)) + typedef int32_t mrb_int; +# define MRB_INT_MIN INT32_MIN +# define MRB_INT_MAX INT32_MAX +# define mrb_int_to_str(buf, i) sprintf((buf), "%" PRId32, (i)) # define str_to_mrb_int(buf) (mrb_int)strtol((buf), NULL, 10) # endif #endif @@ -131,6 +131,10 @@ typedef short mrb_sym; # define isnan _isnan # define isinf(n) (!_finite(n) && !_isnan(n)) # define strtoll _strtoi64 +# define PRId32 "I32d" +# define PRId32 "I64d" +#else +# include <inttypes.h> #endif #endif /* MRUBYCONF_H */ |
