diff m4/strings_h.m4 @ 15390:25fd80a52583

ffs: new module Libvirt wants to use ffs() to avoid dragging in -lm for log2(). * modules/ffs: New file. * m4/ffs.m4: Likewise. * lib/ffs.c: Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_DEFAULTS): Add default. * modules/strings (Makefile.am): Substitute witness. (Depends-on): Add c++defs. * lib/strings.in.h (ffs): Declare. * modules/ffs-tests: New test file. * tests/test-ffs.c: Test new module. * MODULES.html.sh (Integer arithmetic functions): Mention it. * doc/posix-functions/ffs.texi (ffs): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Mon, 11 Jul 2011 17:05:34 -0600
parents 97fc9a21a8fb
children d9061bf1cead
line wrap: on
line diff
--- a/m4/strings_h.m4
+++ b/m4/strings_h.m4
@@ -1,5 +1,5 @@
-# Configure a replacement for <string.h>.
-# serial 3
+# Configure a replacement for <strings.h>.
+# serial 4
 
 # Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -21,7 +21,7 @@
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <strings.h>
-    ]], [strcasecmp strncasecmp])
+    ]], [ffs strcasecmp strncasecmp])
 ])
 
 AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
@@ -33,7 +33,9 @@
 
 AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS],
 [
+  GNULIB_FFS=0;            AC_SUBST([GNULIB_FFS])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_FFS=1;              AC_SUBST([HAVE_FFS])
   HAVE_STRCASECMP=1;       AC_SUBST([HAVE_STRCASECMP])
   HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
 ])