diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-04 12:33:07 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-11-04 12:33:07 +0900 |
| commit | d6cb4f9cf2027eb20f67238aa6c051448602e7e6 (patch) | |
| tree | c025d53534298097aadc3d7699de964bd8a7225f /src/dump.c | |
| parent | 388d26d77027feaa3e107abf7209e2681868bbe6 (diff) | |
| parent | a751f7f196e35cf85ac6f5c0d855edeb68b2bf53 (diff) | |
| download | mruby-d6cb4f9cf2027eb20f67238aa6c051448602e7e6.tar.gz mruby-d6cb4f9cf2027eb20f67238aa6c051448602e7e6.zip | |
Merge branch 'pandax381-mrb_without_float'
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dump.c b/src/dump.c index 71d2f7184..df1e171e4 100644 --- a/src/dump.c +++ b/src/dump.c @@ -15,11 +15,13 @@ #define FLAG_BYTEORDER_NATIVE 2 #define FLAG_BYTEORDER_NONATIVE 0 +#ifndef MRB_WITHOUT_FLOAT #ifdef MRB_USE_FLOAT #define MRB_FLOAT_FMT "%.8e" #else #define MRB_FLOAT_FMT "%.16e" #endif +#endif static size_t get_irep_record_size_1(mrb_state *mrb, mrb_irep *irep); @@ -131,6 +133,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep) } break; +#ifndef MRB_WITHOUT_FLOAT case MRB_TT_FLOAT: str = mrb_float_to_str(mrb, irep->pool[pool_no], MRB_FLOAT_FMT); { @@ -139,6 +142,7 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep) size += (size_t)len; } break; +#endif case MRB_TT_STRING: { @@ -177,10 +181,12 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, uint8_t *buf) str = mrb_fixnum_to_str(mrb, irep->pool[pool_no], 10); break; +#ifndef MRB_WITHOUT_FLOAT case MRB_TT_FLOAT: cur += uint8_to_bin(IREP_TT_FLOAT, cur); /* data type */ str = mrb_float_to_str(mrb, irep->pool[pool_no], MRB_FLOAT_FMT); break; +#endif case MRB_TT_STRING: cur += uint8_to_bin(IREP_TT_STRING, cur); /* data type */ |
