Resurrect a deprecated code for fixing tests for now
Revert "Remove deprecated code to fix RUBY_DEBUG build failures" This reverts commit 9614bea2cd59902a051a7387e354e23a52fe5396. And changed 3.4 to 3.5. To be fixed properly later.
This commit is contained in:
parent
596db9c1f4
commit
a164a34110
36
process.c
36
process.c
@ -900,6 +900,27 @@ pst_bitand(VALUE st1, VALUE st2)
|
||||
if (mask < 0) {
|
||||
rb_raise(rb_eArgError, "negative mask value: %d", mask);
|
||||
}
|
||||
#define WARN_SUGGEST(suggest) \
|
||||
rb_warn_deprecated_to_remove_at(3.5, "Process::Status#&", suggest)
|
||||
|
||||
switch (mask) {
|
||||
case 0x80:
|
||||
WARN_SUGGEST("Process::Status#coredump?");
|
||||
break;
|
||||
case 0x7f:
|
||||
WARN_SUGGEST("Process::Status#signaled? or Process::Status#termsig");
|
||||
break;
|
||||
case 0xff:
|
||||
WARN_SUGGEST("Process::Status#exited?, Process::Status#stopped? or Process::Status#coredump?");
|
||||
break;
|
||||
case 0xff00:
|
||||
WARN_SUGGEST("Process::Status#exitstatus or Process::Status#stopsig");
|
||||
break;
|
||||
default:
|
||||
WARN_SUGGEST("other Process::Status predicates");
|
||||
break;
|
||||
}
|
||||
#undef WARN_SUGGEST
|
||||
status &= mask;
|
||||
|
||||
return INT2NUM(status);
|
||||
@ -934,6 +955,21 @@ pst_rshift(VALUE st1, VALUE st2)
|
||||
if (places < 0) {
|
||||
rb_raise(rb_eArgError, "negative shift value: %d", places);
|
||||
}
|
||||
#define WARN_SUGGEST(suggest) \
|
||||
rb_warn_deprecated_to_remove_at(3.5, "Process::Status#>>", suggest)
|
||||
|
||||
switch (places) {
|
||||
case 7:
|
||||
WARN_SUGGEST("Process::Status#coredump?");
|
||||
break;
|
||||
case 8:
|
||||
WARN_SUGGEST("Process::Status#exitstatus or Process::Status#stopsig");
|
||||
break;
|
||||
default:
|
||||
WARN_SUGGEST("other Process::Status attributes");
|
||||
break;
|
||||
}
|
||||
#undef WARN_SUGGEST
|
||||
status >>= places;
|
||||
|
||||
return INT2NUM(status);
|
||||
|
Loading…
x
Reference in New Issue
Block a user