[llvm-commits] CVS: llvm/autoconf/aclocal.m4 configure.ac
John Criswell
criswell at cs.uiuc.edu
Mon Oct 13 11:23:03 PDT 2003
Changes in directory llvm/autoconf:
aclocal.m4 updated: 1.6 -> 1.7
configure.ac updated: 1.41 -> 1.42
---
Log message:
Added a macro and code that checks for the %a format string in sprintf().
---
Diffs of the changes: (+32 -0)
Index: llvm/autoconf/aclocal.m4
diff -u llvm/autoconf/aclocal.m4:1.6 llvm/autoconf/aclocal.m4:1.7
--- llvm/autoconf/aclocal.m4:1.6 Wed Oct 8 16:45:58 2003
+++ llvm/autoconf/aclocal.m4 Mon Oct 13 11:22:00 2003
@@ -6166,4 +6166,33 @@
[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1,${srcdir}/autoconf/mkinstalldirs `dirname $1`)
])
+#
+# Determine if the printf() functions have the %a format character.
+# This is modified from:
+# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
+AC_DEFUN([AC_C_PRINTF_A],
+[
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_RUN_IFELSE(
+ AC_LANG_PROGRAM([#include <stdio.h>
+ #include <stdlib.h>],
+ [[[
+ volatile double A, B;
+ char Buffer[100];
+ A = 1;
+ A /= 10.0;
+ sprintf(Buffer, "%a", A);
+ B = atof(Buffer);
+ if (A != B)
+ return (1);
+ if (A != 0x1.999999999999ap-4)
+ return (1);
+ return (0);]]]),
+ ac_c_printf_a=yes,ac_c_printf_a=no)
+ AC_LANG_RESTORE
+ if test "$ac_c_printf_a" = "yes"; then
+ AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
+ fi
+])
Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.41 llvm/autoconf/configure.ac:1.42
--- llvm/autoconf/configure.ac:1.41 Fri Oct 10 12:04:43 2003
+++ llvm/autoconf/configure.ac Mon Oct 13 11:22:00 2003
@@ -455,6 +455,9 @@
AC_HEADER_TIME
AC_STRUCT_TM
+dnl Check for various C features
+AC_C_PRINTF_A
+
dnl Check for C++ extensions
AC_CXX_HAVE_EXT_HASH_MAP
AC_CXX_HAVE_EXT_HASH_SET
More information about the llvm-commits
mailing list