Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix name mismatch: item vs context #1340

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

dukesook
Copy link
Contributor

Many of the function declarations in heif_items.h didn't match EXACTLY to their implementations in heif_items.cc, causing runtime errors: 'undefined reference to function`

heif_context_get_item_data() had two different implementations. I'm not sure if both are needed.

@farindk
Copy link
Contributor

farindk commented Oct 15, 2024

Sorry, it should be the other way round. It should mimic an object oriented programming style. The first parameter is the object. Thus, if the first argument is a heif_context, the function name should also start with heif_context_.

@farindk
Copy link
Contributor

farindk commented Oct 15, 2024

I'll do the fix.

@farindk
Copy link
Contributor

farindk commented Oct 15, 2024

Ok the problem is that the heif_items.h file was already present in the v1.18.2 release. That means we cannot change the names without breaking the binary compatibility.

I would propose that we rename it, but also keep the old names as deprecated duplicates.

@farindk
Copy link
Contributor

farindk commented Oct 15, 2024

No, we take your PR. It makes more sense. The heif_context*, heif_item_id pair in the function arguments are logically like a item object (we don't have an heif_item). In that sense, the naming with heif_item_* is consistent.

@farindk farindk merged commit 289befa into strukturag:master Oct 15, 2024
34 of 35 checks passed
@farindk
Copy link
Contributor

farindk commented Oct 15, 2024

@fancycode Does that work in the packaging? In v1.18.2, we had public API functions named heif_item_*foo* in heif_items.h, but these were not implemented because the functions had the different prefix heif_context_*foo* in heif_items.cc (without any public API declaration).

Now, for v1.19.0, the implementation will use the correct function name from the header (heif_item_*foo*).

@fancycode
Copy link
Member

@farindk that should not be a problem. As there was a mismatch between the (exported through LIBHEIF_API) name in the header and the name in the implementation, the implementation was not exported and thus was not a public symbol in the resulting library. If this is now fixed for the next version, the correct symbols will be exported and will be available to consumers of the API starting with the next version.

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.

3 participants