summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-10-15 13:20:29 +0200
committerBruno Haible <bruno@clisp.org>2011-10-15 13:20:29 +0200
commit8f9c414718161f157f9970b3c97b977d0343093e (patch)
tree0575eef60cadb5f33789b18daa5e25d476691dc1 /m4
parent3e89323b7976e230cc01744c046b825d049c7fa6 (diff)
downloadgnulib-8f9c414718161f157f9970b3c97b977d0343093e.tar.gz
vasnprintf: Optimize bit search operation.
* lib/vasnprintf.c (divide): Use optimizations from integer_length.c. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF): Require gl_DOUBLE_EXPONENT_LOCATION. * modules/vasnprintf (Files): Add m4/exponentd.m4. * modules/unistdio/u8-vasnprintf (Files): Likewise. * modules/unistdio/u8-u8-vasnprintf (Files): Likewise. * modules/unistdio/u16-vasnprintf (Files): Likewise. * modules/unistdio/u16-u16-vasnprintf (Files): Likewise. * modules/unistdio/u32-vasnprintf (Files): Likewise. * modules/unistdio/u32-u32-vasnprintf (Files): Likewise. * modules/unistdio/ulc-vasnprintf (Files): Likewise. * m4/isnand.m4 (gl_PREREQ_ISNAND): Use AC_REQUIRE.
Diffstat (limited to 'm4')
-rw-r--r--m4/isnand.m44
-rw-r--r--m4/vasnprintf.m45
2 files changed, 6 insertions, 3 deletions
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index 2b18b0ac6d..48f1a48078 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,4 +1,4 @@
-# isnand.m4 serial 10
+# isnand.m4 serial 11
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -43,7 +43,7 @@ AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM],
dnl Prerequisites of replacement isnand definition. It does not need -lm.
AC_DEFUN([gl_PREREQ_ISNAND],
[
- gl_DOUBLE_EXPONENT_LOCATION
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
])
dnl Test whether isnand() can be used with libm.
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 749d708d9e..da0a6d9efc 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 33
+# vasnprintf.m4 serial 34
dnl Copyright (C) 2002-2004, 2006-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -64,6 +64,9 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+ dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+ dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
dnl We can avoid a lot of code by assuming that snprintf's return value
dnl conforms to ISO C99. So check that.
AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])