Skip to content

Fix to replace deprecated macro APIs with Ruby-prefixed ones#34

Open
gemmaro wants to merge 6 commits into
silverhammermba:gh-pagesfrom
gemmaro:fix/deprecated-macro
Open

Fix to replace deprecated macro APIs with Ruby-prefixed ones#34
gemmaro wants to merge 6 commits into
silverhammermba:gh-pagesfrom
gemmaro:fix/deprecated-macro

Conversation

@gemmaro

@gemmaro gemmaro commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Hello,

This replaces deprecated macro APIs like Qnil with newer Ruby-prefixed ones like RUBY_Qnil.

The scope of this pull request is: FIXNUM_P, IMMEDIATE_P, NIL_P, SPECIAL_CONST_P, STATIC_SYM_P, Qfalse, Qnil, Qtrue, and Qundef. They has been deprecated at the following commit:

b0a7c0dfd04ac51b621c016387d5f65cfe3ecf5a
Author:     卜部昌平 <shyouhei@ruby-lang.org>
AuthorDate: Fri Jan 15 16:34:34 2021 +0900
Commit:     卜部昌平 <shyouhei@ruby-lang.org>
CommitDate: Fri Sep 10 20:00:06 2021 +0900

Parent:     818fabfcd9 include/ruby/internal/stdalign.h: add doxygen
Contained:  master mkmf/deterministic
Follows:    v3_0_0_rc2 (3095)
Precedes:   v3_1_0_preview1 (1943)

include/ruby/internal/special_consts.h: add doxygen

Must not be a bad idea to improve documents. [ci skip]

And the current EOL version of Ruby is 3.1.7, so I think this changeset is natural.

(There is a full list of deprecated macro APIs, but this PR doesn't cover them all.)

RSpec tests pass with Ruby 3.4 locally:

$ RUBYLIB=_test/lib rspec _test
..............

Finished in 3.87 seconds (files took 0.06831 seconds to load)
14 examples, 0 failures

with the following patch:

diff --git a/_config.yml b/_config.yml
index b22869f..0136226 100644
--- a/_config.yml
+++ b/_config.yml
@@ -5,4 +5,4 @@ markdown: kramdown
 permalink: /:categories/:title/
 kramdown:
   parse_block_html: true
-rbversion: 3.0
+rbversion: 3.4
diff --git a/_test/lib/c_api.rb b/_test/lib/c_api.rb
index 575476a..fe7d6d0 100644
--- a/_test/lib/c_api.rb
+++ b/_test/lib/c_api.rb
@@ -1,7 +1,7 @@
 require 'open3'
 require 'tempfile'
 
-BUILD_VERSION = "3.0"
+BUILD_VERSION = "3.4"
 
 module CAPI
   class Result

Thank you,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant