Re: BUG #17967: [msvc-x86] Failed to build with error LNK2019: unresolved external symbol __BitScanReverse64 referen

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Mo Youmiu <moyoumiu@outlook.com>
Cc: David Rowley <dgrowleyml@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2023-06-12T10:54:38Z
Lists: pgsql-bugs
Hello Mo Youmiu,

On 2023-Jun-08, Mo Youmiu wrote:

> Thanks for your replies and corrections, and apologies for the confusing version I mentioned.
> 
> For this commit, PostgreSQL was successfully built with msvc on both x86 and amd64.
> 
> Glad my report was helpful.

You know what else would be extremely helpful?  A buildfarm animal that
runs with this configuration.  We should have noticed this problem as
soon as that problematic commit was introduced; a buildfarm animal would
have alerted us to it pretty much immediately rather than four months
after the fact.  Would you be in a position to running one?  It's a
moderately easy task, you just need to keep a machine (or VM) running
permanently.  You can find instructions here:
https://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto

Regards

-- 
Álvaro Herrera



Commits

  1. Don't use _BitScanForward64/_BitScanReverse64 on 32-bit MSVC builds

  2. Remove newly added asserts from pg_bitutils.h

  3. Add MSVC support for pg_leftmost_one_pos32() and friends