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

[flann] Fix pop_t is not defined under non-gunc platform. #32468

Merged
merged 5 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/flann/fix_undefined_pot_t.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/cpp/flann/algorithms/dist.h b/src/cpp/flann/algorithms/dist.h
index 4e6eb73..bbcdda1 100644
--- a/src/cpp/flann/algorithms/dist.h
+++ b/src/cpp/flann/algorithms/dist.h
@@ -519,7 +519,7 @@ struct HammingPopcnt
#else
HammingLUT lut;
result = lut(reinterpret_cast<const unsigned char*> (a),
- reinterpret_cast<const unsigned char*> (b), size * sizeof(pop_t));
+ reinterpret_cast<const unsigned char*> (b), size);
Copy link
Member

Choose a reason for hiding this comment

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

This seems broken as the linked PR suggests that pop_t should be either unsigned long or unsigned long long, which means size will be too small with this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I see, so the patch is correct because the original code was bogus, and the comment is wrong.

#endif
return result;
}
3 changes: 2 additions & 1 deletion ports/flann/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
fix-build-error.patch
fix-dependency-hdf5.patch
fix_undefined_pot_t.patch # https://github.com/opencv/opencv/pull/13270/
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down Expand Up @@ -37,6 +38,6 @@ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

vcpkg_fixup_pkgconfig()
2 changes: 1 addition & 1 deletion ports/flann/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flann",
"version-date": "2019-04-07",
"port-version": 6,
"port-version": 7,
"description": "Fast Library for Approximate Nearest Neighbors",
"homepage": "https://github.com/mariusmuja/flann",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,7 @@
},
"flann": {
"baseline": "2019-04-07",
"port-version": 6
"port-version": 7
},
"flash-runtime-extensions": {
"baseline": "2.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/flann.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "827bba7345ec924adeee28bacb5b0a79f705920d",
"version-date": "2019-04-07",
"port-version": 7
},
{
"git-tree": "300415ad416640a5b4a4f0895a3250b306726181",
"version-date": "2019-04-07",
Expand Down