Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c - Mailing list pgsql-committers

From Alvaro Herrera
Subject Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c
Date
Msg-id 20190215170034.GA28311@alvherre.pgsql
Whole thread Raw
In response to pgsql: Fix compiler builtin usage in new pg_bitutils.c  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Hmm, this should fix the build, but I'm rushing out to lunch -- maybe
I'm missing something.

diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c
index 97bfcebe4e1..e0198f3ab35 100644
--- a/src/port/pg_bitutils.c
+++ b/src/port/pg_bitutils.c
@@ -90,9 +90,11 @@ pg_popcount_available(void)
 static int
 pg_popcount32_choose(uint32 word)
 {
+#if defined(HAVE__GET_CPUID) || defined(HAVE__CPUID)
     if (pg_popcount_available())
         pg_popcount32 = pg_popcount32_hw;
     else
+#endif
         pg_popcount32 = pg_popcount32_builtin;
 
     return pg_popcount32(word);
@@ -178,9 +180,11 @@ pg_popcount(const char *buf, int bytes)
 static int
 pg_popcount64_choose(uint64 word)
 {
+#if defined(HAVE__GET_CPUID) || defined(HAVE__CPUID)
     if (pg_popcount_available())
         pg_popcount64 = pg_popcount64_hw;
     else
+#endif
         pg_popcount64 = pg_popcount64_builtin;
 
     return pg_popcount64(word);

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Fix compiler builtin usage in new pg_bitutils.c
Next
From: Tom Lane
Date:
Subject: pgsql: Refactor index cost estimation functions in view ofIndexClause