2004-09-07 08:56:14 +02:00
|
|
|
#
|
|
|
|
# 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
|
2004-11-25 05:44:46 +01:00
|
|
|
AC_DEFUN([AC_C_PRINTF_A],
|
2004-11-27 22:59:57 +01:00
|
|
|
[AC_CACHE_CHECK([if printf has the %a format character],[llvm_cv_c_printf_a],
|
2004-11-25 05:44:46 +01:00
|
|
|
[AC_LANG_PUSH([C])
|
|
|
|
AC_RUN_IFELSE([
|
|
|
|
AC_LANG_PROGRAM([[
|
2004-09-20 00:31:49 +02:00
|
|
|
#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);]])],
|
2004-11-27 22:59:57 +01:00
|
|
|
llvm_cv_c_printf_a=yes,
|
|
|
|
llvmac_cv_c_printf_a=no,
|
|
|
|
llvmac_cv_c_printf_a=no)
|
2004-11-25 05:44:46 +01:00
|
|
|
AC_LANG_POP([C])])
|
2004-11-27 22:59:57 +01:00
|
|
|
if test "$llvm_cv_c_printf_a" = "yes"; then
|
2004-09-20 00:31:49 +02:00
|
|
|
AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
|
|
|
|
fi
|
2004-09-07 08:56:14 +02:00
|
|
|
])
|