summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-20 22:50:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-20 22:58:09 +0900
commit6876aa38f607cdd6fb24910e54143d9110d025c9 (patch)
tree5d4a52dff4ca6e654e2eecee3172803b736fcf3c /ruby.c
parent1fea3a7636cfaf25baba1e9f208c68a8a8ba52cc (diff)
Added `FEATURE_SET_RESTORE` macro
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 60c57d6..dae928a 100644
--- a/ruby.c
+++ b/ruby.c
@@ -144,6 +144,7 @@ rb_feature_set_to(ruby_features_t *feat, unsigned int bit_mask, unsigned int bit
#define FEATURE_SET_TO(feat, bit_mask, bit_set) \
rb_feature_set_to(&(feat), bit_mask, bit_set)
#define FEATURE_SET(feat, bits) FEATURE_SET_TO(feat, bits, bits)
+#define FEATURE_SET_RESTORE(feat, save) FEATURE_SET_TO(feat, (save).mask, (save).set & (save).mask)
#define FEATURE_SET_P(feat, bits) ((feat).set & (bits))
struct ruby_cmdline_options {
@@ -1582,7 +1583,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
opt->ext.enc.name = ext_enc_name;
if (int_enc_name)
opt->intern.enc.name = int_enc_name;
- FEATURE_SET_TO(opt->features, feat.mask, feat.set & feat.mask);
+ FEATURE_SET_RESTORE(opt->features, feat);
}
if (opt->src.enc.name)