diff --git a/src/bitutils.c b/src/bitutils.c index 8e24c99..a83776d 100644 --- a/src/bitutils.c +++ b/src/bitutils.c @@ -31,8 +31,10 @@ #define BIT_TARGET_CLONES #endif -/* Use built-ins when possible for inlining */ -#if defined(HAVE__BUILTIN_POPCOUNT) && (defined(HAVE_LONG_INT_64) || SIZEOF_LONG == 8) +/* Use built-ins when possible for Postgres < 19 for inlining */ +#if PG_VERSION_NUM >= 190000 +#define popcount64(x) pg_popcount64(x) +#elif defined(HAVE__BUILTIN_POPCOUNT) && (defined(HAVE_LONG_INT_64) || SIZEOF_LONG == 8) #define popcount64(x) __builtin_popcountl(x) #elif defined(HAVE__BUILTIN_POPCOUNT) && (defined(HAVE_LONG_LONG_INT_64) || SIZEOF_LONG_LONG == 8) #define popcount64(x) __builtin_popcountll(x)