Fix the extension build on current Ruby#58
Merged
Conversation
Data_Wrap_Struct and Data_Get_Struct no longer exist in current Ruby. Parser-owned nodes use a free-less data type whose parent is the node type, so a single accessor still fetches either kind of node. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The taint API was removed from current Ruby. Fall back to no-ops where it is missing, keeping the existing calls valid on older versions that still ship it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Current Ruby builds extensions with -std=gnu23, which rejects the old K&R function definition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Ruby no longer builds this extension. The untyped Data API (Data_Wrap_Struct and Data_Get_Struct) and the taint API (OBJ_TAINT and OBJ_TAINTED) have both been removed, and extensions are now compiled with -std=gnu23 which rejects old K&R function definitions.
Every wrapper now uses the TypedData API. Parser-owned nodes use a free-less data type whose parent is the node type so a single accessor handles both kinds. OBJ_TAINT and OBJ_TAINTED fall back to no-ops where Ruby no longer defines them. The K&R definition of syck_yaml2byte_handler is rewritten as a prototype.
Verified the build and the full test suite on Ruby head, 3.4, and 2.4.