Bruno Haible wrote:

2020-08-03  Bruno Haible  <br...@clisp.org>

        integer_length: Optimize for MSVC.
        * lib/integer_length.c: Include <intrin.h>.
        (integer_length): With MSVC, use the _BitScanReverse built-in.

With clang-cl I get link-results like:
 integer_length_l.obj : error LNK2005: _integer_length already defined in 
integer_length.obj
 integer_length_ll.obj : error LNK2005: _integer_length already defined in 
integer_length.obj

Building with 'cl', I see no such problem.

It seems 'clang-cl' and 'cl' handles a 'static inline'
in those 'integer_length*' and 'ffs*' files differently
depending on some other condition; optimize settings?

But why not just drop these copied snippets:
  # include <intrin.h>
  /* Copied from ffs.c.  */
  static inline int
  ffs (int i)

and:
  # include <intrin.h>
  /* Copied from integer_length.c.  */
  static inline int
  integer_length (unsigned int x)

Is an extra call that much slower?

--
--gv

Reply via email to