Skip to content

Conversation

@hsbt
Copy link
Contributor

@hsbt hsbt commented Jan 16, 2026

Ruby 4.1.0dev couldn't build curb gem.

curb_easy.c:2660:7: error: call to undeclared function 'rb_iterate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2660 |       rb_iterate(rb_each, rb_easy_get("headers"), cb_each_http_header, wrap);

rb_iterate has been removed from ruby HEAD: https://bugs.ruby-lang.org/issues/21768

I replaced that to rb_block_call.

Copilot AI review requested due to automatic review settings January 16, 2026 03:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the curb gem to be compatible with Ruby 4.1.0dev by replacing the deprecated rb_iterate API with rb_block_call. The rb_iterate function was removed from Ruby HEAD (issue #21768), causing build failures. This change maintains functional equivalence while using the modern Ruby C API.

Changes:

  • Replaced 4 occurrences of rb_iterate(rb_each, ...) with rb_block_call(..., rb_intern("each"), ...)
  • Updated calls for headers, proxy_headers, ftp_commands, and resolve list iteration
Comments suppressed due to low confidence (4)

ext/curb_easy.c:2248

  • The comment states this is an 'rb_iterate callback' but the code now uses rb_block_call. Update the comment to reflect that this is an rb_block_call callback or simply a callback function.
/***********************************************
 * This is an rb_iterate callback used to set up http headers.
 */

ext/curb_easy.c:2287

  • The comment states this is an 'rb_iterate callback' but the code now uses rb_block_call. Update the comment to reflect that this is an rb_block_call callback or simply a callback function.
/***********************************************
 * This is an rb_iterate callback used to set up http proxy headers.
 */

ext/curb_easy.c:2323

  • The comment states this is an 'rb_iterate callback' but the code now uses rb_block_call. Update the comment to reflect that this is an rb_block_call callback or simply a callback function.
/***********************************************
 * This is an rb_iterate callback used to set up ftp commands.
 */

ext/curb_easy.c:2341

  • The comment states this is an 'rb_iterate callback' but the code now uses rb_block_call. Update the comment to reflect that this is an rb_block_call callback or simply a callback function.
/***********************************************
 * This is an rb_iterate callback used to set up the resolve list.
 */

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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