Skip to content

fix: support both CUPS 2.x and CUPS 3.x in cupsArrayNew (fixes #30) - #31

Merged
tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
AdeshDeshmukh:fix/cups2-compat-cupsArrayNew
Nov 24, 2026
Merged

tillkamppeter merged 1 commit into
OpenPrinting:masterfrom
AdeshDeshmukh:fix/cups2-compat-cupsArrayNew

Conversation

@AdeshDeshmukh

Copy link
Copy Markdown
Contributor

Summary

Fixes #30 by restoring backward compatibility with CUPS 2.x.

In CUPS 2.x, cupsArrayNew accepts 2 arguments (cups_array_func_t f, void *d), whereas in CUPS 3.x the signature was updated to 6 arguments (cups_array_func_t f, void *d, cups_ahash_func_t hf, int hsize, cups_acopy_func_t cf, cups_afree_func_t ff).

Wrapping the cupsArrayNew calls with #if CUPS_VERSION_MAJOR >= 3 ensures the application builds cleanly on both legacy CUPS 2.x systems (such as Arch/Artix/Debian/Ubuntu stable) and modern CUPS 3.x installations.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 02:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

Build fails with ghostscript-printer-app.c:152:26: error: too many arguments to function ‘cupsArrayNew’; expected 2, have 6.

3 participants