public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-libs/pcc-libs/files: pcc-libs-1.0.0-check-builtin.patch
@ 2012-06-11  0:29 Richard Yao (ryao)
  0 siblings, 0 replies; only message in thread
From: Richard Yao (ryao) @ 2012-06-11  0:29 UTC (permalink / raw
  To: gentoo-commits

ryao        12/06/11 00:29:04

  Added:                pcc-libs-1.0.0-check-builtin.patch
  Log:
  keyword ~amd64-fbsd, fix clang build failure (bug #420609)
  
  (Portage version: 2.1.10.49/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-libs/pcc-libs/files/pcc-libs-1.0.0-check-builtin.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/pcc-libs/files/pcc-libs-1.0.0-check-builtin.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/pcc-libs/files/pcc-libs-1.0.0-check-builtin.patch?rev=1.1&content-type=text/plain

Index: pcc-libs-1.0.0-check-builtin.patch
===================================================================
diff --git a/libpcc/bitcnt.c b/libpcc/bitcnt.c
index 26ecc01..c3bd54e 100644
--- a/libpcc/bitcnt.c
+++ b/libpcc/bitcnt.c
@@ -1,9 +1,22 @@
+// Only use __has_builtin in compilers that support it.
+#ifndef __has_builtin
+	#define __has_builtin(x) 0
+#endif
 
+#if !__has_builtin(__builtin_clz)
 int __builtin_clz(unsigned int);
+#endif
+#if !__has_builtin(__builtin_ctz)
 int __builtin_ctz(unsigned int);
+#endif
+#if !__has_builtin(__builtin_clzl)
 int __builtin_clzl(unsigned long);
+#endif
+#if !__has_builtin(__builtin_ctzl)
 int __builtin_ctzl(unsigned long);
+#endif
 
+#if !__has_builtin(__builtin_clz)
 int
 __builtin_clz(unsigned int v)
 {
@@ -14,7 +27,9 @@ __builtin_clz(unsigned int v)
 			break;
 	return i;
 }
+#endif
 
+#if !__has_builtin(__builtin_ctz)
 int
 __builtin_ctz(unsigned int v)
 {
@@ -25,7 +40,9 @@ __builtin_ctz(unsigned int v)
 			break;
 	return i;
 }
+#endif
 
+#if !__has_builtin(__builtin_clzl)
 int
 __builtin_clzl(unsigned long v)
 {
@@ -37,7 +54,9 @@ __builtin_clzl(unsigned long v)
 			break;
 	return i;
 }
+#endif
 
+#if !__has_builtin(__builtin_ctzl)
 int
 __builtin_ctzl(unsigned long v)
 {
@@ -48,3 +67,4 @@ __builtin_ctzl(unsigned long v)
 			break;
 	return i;
 }
+#endif






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-11  0:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-11  0:29 [gentoo-commits] gentoo-x86 commit in dev-libs/pcc-libs/files: pcc-libs-1.0.0-check-builtin.patch Richard Yao (ryao)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox