ports/multimedia/pHash/files/patch-src_pHash.cpp
Jan Beich 47471a2a82 multimedia/pHash: add new port
PR:		202635
Submitted by:	Naram Qashat <cyberbotx@cyberbotx.com>

pHash is an open source software library released under the GPLv3 license that
implements several perceptual hashing algorithms, and provides a C-like API to
use those functions in your own programs. pHash itself is written in C++.

http://phash.org/
2015-09-11 23:27:46 +00:00

22 lines
408 B
C++

--- src/pHash.cpp.orig 2013-04-13 17:23:12 UTC
+++ src/pHash.cpp
@@ -34,14 +34,18 @@
int ph_num_threads()
{
int numCPU = 1;
-#ifdef __GLIBC__
+#ifdef _SC_NPROCESSORS_ONLN
numCPU = sysconf( _SC_NPROCESSORS_ONLN );
#else
int mib[2];
size_t len;
mib[0] = CTL_HW;
+#ifdef HW_AVAILCPU
mib[1] = HW_AVAILCPU;
+#else
+ mib[1] = HW_NCPU;
+#endif
sysctl(mib, 2, &numCPU, &len, NULL, 0);