Skip to content

Commit 1cb9449

Browse files
authored
fix popcnt for msvc on arm64 compilation
1 parent 354660a commit 1cb9449

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/bgsegm/src/bgfg_gsoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const float LSBPtau = 0.05f;
7070
inline int LSBPDist32(unsigned n) {
7171
#if defined(__GNUC__) || defined(__clang__)
7272
return __builtin_popcount(n);
73-
#elif defined(_MSC_VER)
73+
#elif defined(_MSC_VER) && !(defined(_M_ARM) || (defined(_M_ARM64) && _MSC_VER < 1941))
7474
return __popcnt(n);
7575
#else
7676
// Taken from http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

0 commit comments

Comments
 (0)