Skip to content

Commit ff57c02

Browse files
committed
Remove broken MRB_INT16 configuration option.
1 parent 2742ded commit ff57c02

5 files changed

Lines changed: 26 additions & 52 deletions

File tree

doc/guides/mrbconf.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,13 @@ You can use mrbconfs with following ways:
5454
* When defined removes floating point numbers from mruby.
5555
* It makes mruby easier to handle in "Microcontroller without FPU" and "Kernel Space".
5656

57-
`MRB_INT16`
58-
* When defined `int16_t` will be defined as `mrb_int`.
59-
* Conflicts with `MRB_INT32` and `MRB_INT64`.
60-
6157
`MRB_INT32`
62-
* When defined, or both `MRB_INT16` and `MRB_INT64` are not defined on 32-bit CPU mode, `int32_t` will be defined as `mrb_int`.
63-
* Conflicts with `MRB_INT16` and `MRB_INT64`.
58+
* When defined, or `MRB_INT64` are not defined on 32-bit CPU mode, `mrb_int` will be defined as `int32_t`.
59+
* Conflicts with `MRB_INT64`.
6460

6561
`MRB_INT64`
66-
* When defined, or both `MRB_INT16` and `MRB_INT32` are not defined on 64-bit CPU mode, `int64_t` will be defined as `mrb_int`.
67-
* Conflicts with `MRB_INT16` and `MRB_INT32`.
62+
* When defined, or `MRB_INT32` are not defined on 64-bit CPU mode, `mrb_int` will be defined as `int64_t`.
63+
* Conflicts with `MRB_INT32`.
6864

6965
## Garbage collector configuration.
7066

include/mrbconf.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,16 @@
4040
/* no MRB_METHOD_T_STRUCT requires highest 2 bits of function pointers to be zero */
4141
//#define MRB_METHOD_T_STRUCT
4242

43-
/* add -DMRB_INT16 to use 16bit integer for mrb_int; conflict with MRB_INT32 and MRB_INT64 */
44-
//#define MRB_INT16
45-
46-
/* add -DMRB_INT32 to use 32bit integer for mrb_int; conflict with MRB_INT16 and MRB_INT64;
43+
/* add -DMRB_INT32 to use 32bit integer for mrb_int; conflict with MRB_INT64;
4744
Default for 32-bit CPU mode. */
4845
//#define MRB_INT32
4946

50-
/* add -DMRB_INT64 to use 64bit integer for mrb_int; conflict with MRB_INT16 and MRB_INT32;
47+
/* add -DMRB_INT64 to use 64bit integer for mrb_int; conflict with MRB_INT32;
5148
Default for 64-bit CPU mode. */
5249
//#define MRB_INT64
5350

5451
/* if no specific integer type is chosen */
55-
#if !defined(MRB_INT16) && !defined(MRB_INT32) && !defined(MRB_INT64)
52+
#if !defined(MRB_INT32) && !defined(MRB_INT64)
5653
# if defined(MRB_64BIT) && !defined(MRB_NAN_BOXING)
5754
/* Use 64bit integers on 64bit architecture (without MRB_NAN_BOXING) */
5855
# define MRB_INT64

include/mruby/boxing_word.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#ifndef MRUBY_BOXING_WORD_H
88
#define MRUBY_BOXING_WORD_H
99

10-
#if defined(MRB_INT16)
11-
# error MRB_INT16 is too small for MRB_WORD_BOXING.
12-
#endif
13-
1410
#if defined(MRB_INT64) && !defined(MRB_64BIT)
1511
#error MRB_INT64 cannot be used with MRB_WORD_BOXING in 32-bit mode.
1612
#endif

include/mruby/value.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ typedef uint32_t mrb_sym;
3434
typedef uint8_t mrb_bool;
3535
struct mrb_state;
3636

37-
#if defined(MRB_INT16) && defined(MRB_INT64)
38-
# error "You can't define MRB_INT16 and MRB_INT64 at the same time."
39-
#endif
40-
4137
#if defined _MSC_VER && _MSC_VER < 1800
4238
# define PRIo64 "llo"
4339
# define PRId64 "lld"
@@ -63,14 +59,6 @@ struct mrb_state;
6359
# define MRB_PRIo PRIo64
6460
# define MRB_PRId PRId64
6561
# define MRB_PRIx PRIx64
66-
#elif defined(MRB_INT16)
67-
typedef int16_t mrb_int;
68-
# define MRB_INT_BIT 16
69-
# define MRB_INT_MIN (INT16_MIN>>MRB_FIXNUM_SHIFT)
70-
# define MRB_INT_MAX (INT16_MAX>>MRB_FIXNUM_SHIFT)
71-
# define MRB_PRIo PRIo16
72-
# define MRB_PRId PRId16
73-
# define MRB_PRIx PRIx16
7462
#else
7563
typedef int32_t mrb_int;
7664
# define MRB_INT_BIT 32

tasks/gitlab.rake

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,25 @@ task :gitlab_config do
6363
configs = []
6464
[true, false].each do |mode_32|
6565
['', 'MRB_USE_FLOAT'].each do |float_conf|
66-
['', 'MRB_INT16', 'MRB_INT64'].each do |int_conf|
67-
['', 'MRB_NAN_BOXING', 'MRB_WORD_BOXING'].each do |boxing_conf|
68-
['', 'MRB_UTF8_STRING'].each do |utf8_conf|
69-
next if (float_conf == 'MRB_USE_FLOAT') && (boxing_conf == 'MRB_NAN_BOXING')
70-
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_NAN_BOXING')
71-
next if (int_conf == 'MRB_INT16') && (boxing_conf == 'MRB_WORD_BOXING')
72-
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_WORD_BOXING') && mode_32
73-
env = [float_conf, int_conf, boxing_conf, utf8_conf].map do |conf|
74-
conf == '' ? nil : "-D#{conf}=1"
75-
end.compact.join(' ')
76-
bit = mode_32 ? '-m32 ' : ''
77-
_info = ''
78-
_info += mode_32 ? '32bit ' : '64bit '
79-
_info += float_conf['USE'] ? 'float ' : ''
80-
_info += int_conf['16'] ? 'int16 ' : ''
81-
_info += int_conf['64'] ? 'int64 ' : ''
82-
_info += boxing_conf['NAN'] ? 'nan ' : ''
83-
_info += boxing_conf['WORD'] ? 'word ' : ''
84-
_info += utf8_conf['UTF8'] ? 'utf8 ' : ''
85-
_info = _info.gsub(/ +/, ' ').strip.tr(' ', '_')
86-
configs << { '_info' => _info, 'CFLAGS' => "#{bit}#{env}", 'LDFLAGS' => bit.strip.to_s }
87-
end
66+
['', 'MRB_NAN_BOXING', 'MRB_WORD_BOXING'].each do |boxing_conf|
67+
['', 'MRB_UTF8_STRING'].each do |utf8_conf|
68+
next if (float_conf == 'MRB_USE_FLOAT') && (boxing_conf == 'MRB_NAN_BOXING')
69+
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_NAN_BOXING')
70+
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_WORD_BOXING') && mode_32
71+
env = [float_conf, int_conf, boxing_conf, utf8_conf].map do |conf|
72+
conf == '' ? nil : "-D#{conf}=1"
73+
end.compact.join(' ')
74+
bit = mode_32 ? '-m32 ' : ''
75+
_info = ''
76+
_info += mode_32 ? '32bit ' : '64bit '
77+
_info += float_conf['USE'] ? 'float ' : ''
78+
_info += int_conf['16'] ? 'int16 ' : ''
79+
_info += int_conf['64'] ? 'int64 ' : ''
80+
_info += boxing_conf['NAN'] ? 'nan ' : ''
81+
_info += boxing_conf['WORD'] ? 'word ' : ''
82+
_info += utf8_conf['UTF8'] ? 'utf8 ' : ''
83+
_info = _info.gsub(/ +/, ' ').strip.tr(' ', '_')
84+
configs << { '_info' => _info, 'CFLAGS' => "#{bit}#{env}", 'LDFLAGS' => bit.strip.to_s }
8885
end
8986
end
9087
end

0 commit comments

Comments
 (0)