Skip to content

Conversation

@b4n
Copy link
Contributor

@b4n b4n commented Jan 21, 2026

Without those known to cppcheck, it now bails out with something like this:

test/cfg/gtk.c:16:2: error: failed to evaluate #if condition, undefined function-like macro invocation: GLIB_CHECK_VERSION( ... ) [syntaxError]
#if GLIB_CHECK_VERSION(2, 3, 4)
 ^

So define them in a best-effort fashion:

  • Cairo is actually using the real value (not that it's likely to matter)
  • GLib, GTK and ATK make them result to 1 as there's no better alternative than an arbitrary boolean value, and those checks are usually guarding newer or optional code paths, so it conceptually makes more sense to have a truthy value.

b4n added 2 commits January 21, 2026 22:28
Add CAIRO_VERSION_ENCODE() to fix undefined function-like macro error.
Add GLIB_CHECK_VERSION(), GTK_CHECK_VERSION() and ATK_CHECK_VERSION() to
fix undefined function-like macro error.
@b4n b4n force-pushed the cairo-gtk-version-check branch from 4204890 to 3bb7367 Compare January 21, 2026 22:16
@sonarqubecloud
Copy link

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