Use __builtin_ffs instead of ffs (#554)
authorMartin Storsjö <martin@martin.st>
Sun, 26 Apr 2020 01:59:35 +0000 (04:59 +0300)
committerGitHub <noreply@github.com>
Sun, 26 Apr 2020 01:59:35 +0000 (21:59 -0400)
commit15d3ea31a53bd0e5b828c90a9f7c4285c58f73e1
tree2e36f85a1eca7d4661bf8abd5f7da2916ed51f6c
parentc06468fa6674d3783a0edb1d0fae9afc8bc28513
Use __builtin_ffs instead of ffs (#554)

USE_BUILTIN_FFS is defined to 1 within __GNUC__, and the __builtin_ffs
function is available since GCC 3.x at least, while the ffs function
only exists on some OSes.

This fixes compilation for non-x86 mingw platforms. For x86,
USE_BUILTIN_FFS is explicitly disabled for windows targets - but
if USE_BUILTIN_FFS is enabled based on __GNUC__, it should also use
the builtin which actually is available correspondingly, not dependent
on the target OS.
src/dlmalloc.c