[AC_LANG_SAVE
AC_LANG_C
AC_TRY_RUN([
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
int fd;
int main () {
- fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != MAP_FAILED);}],
+ fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != (int) MAP_FAILED);}],
ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no)
AC_LANG_RESTORE
])
if test "$ac_cv_func_mmap_file" = yes; then
- AC_DEFINE(HAVE_MMAP_FILE)
+ AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
AC_SUBST(MMAP_FILE,[yes])
fi
])
AC_LANG_RESTORE
])
if test "$ac_cv_header_mmap_anon" = yes; then
- AC_DEFINE(HAVE_MMAP_ANONYMOUS)
+ AC_DEFINE([HAVE_MMAP_ANONYMOUS],[],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
fi
])
[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
+])