Try to use __builtin_ffsl if ffsl is unavailable.

Some platforms (like those using Newlib) don't have ffs/ffsl.  This
commit adds a check to configure.ac for __builtin_ffsl if ffsl isn't
found.  __builtin_ffsl performs the same function as ffsl, and has the
added benefit of being available on any platform utilizing
Gcc-compatible compiler.

This change does not address the used of ffs in the MALLOCX_ARENA()
macro.
This commit is contained in:
Richard Diamond
2014-05-28 21:37:02 -05:00
committed by Jason Evans
parent 0b5c92213f
commit 9c3a10fdf6
9 changed files with 71 additions and 17 deletions

View File

@@ -15,11 +15,13 @@
#else
# include <sys/param.h>
# include <sys/mman.h>
# include <sys/syscall.h>
# if !defined(SYS_write) && defined(__NR_write)
# define SYS_write __NR_write
# if !defined(__pnacl__) && !defined(__native_client__)
# include <sys/syscall.h>
# if !defined(SYS_write) && defined(__NR_write)
# define SYS_write __NR_write
# endif
# include <sys/uio.h>
# endif
# include <sys/uio.h>
# include <pthread.h>
# include <errno.h>
#endif