openbsd-ports/misc/openbabel/patches/patch-include_openbabel_fingerprint_h
brad e2b3c7c7cf Pull in a patch from the openbabel source repo to remove
the unconditional use of __builtin_popcount if using GCC.
Eliminates the need for a newer GCC version.

ok ajacoutot@
2008-09-01 08:51:03 +00:00

17 lines
817 B
Plaintext

$OpenBSD: patch-include_openbabel_fingerprint_h,v 1.1 2008/09/01 08:51:03 brad Exp $
--- include/openbabel/fingerprint.h.orig Sun Aug 31 22:58:48 2008
+++ include/openbabel/fingerprint.h Sun Aug 31 23:01:45 2008
@@ -90,7 +90,11 @@ const char* TypeID() (public)
int andfp = vec1[i] & p2[i];
int orfp = vec1[i] | p2[i];
// Count bits
-#ifdef __GNUC__
+ /* GCC 3.4 supports a "population count" builtin, which on many targets is
+ implemented with a single instruction. There is a fallback definition
+ in libgcc in case a target does not have one, which should be just as
+ good as the static function below. */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
andbits += __builtin_popcount(andfp);
orbits += __builtin_popcount(orfp);
#else