2 dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_FFS],
9 AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
11 dnl We can't use AC_CHECK_FUNC here, because ffs() is defined as a
12 dnl static inline function when compiling for Android 4.2 or older.
13 dnl But require that ffs() is declared; otherwise we may be using
14 dnl the GCC built-in function, which leads to warnings
15 dnl "warning: implicit declaration of function 'ffs'".
16 AC_CACHE_CHECK([for ffs], [gl_cv_func_ffs],
19 [[#include <strings.h>
22 [[int (*func) (int) = ffs;
29 if test $gl_cv_func_ffs = no; then