2N/A# stdio_h.m4 serial 31
2N/Adnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
2N/Adnl This file is free software; the Free Software Foundation
2N/Adnl gives unlimited permission to copy and/or distribute it,
2N/Adnl with or without modifications, as long as this notice is preserved.
2N/A
2N/AAC_DEFUN([gl_STDIO_H],
2N/A[
2N/A AC_REQUIRE([gl_STDIO_H_DEFAULTS])
2N/A AC_REQUIRE([AC_C_INLINE])
2N/A AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
2N/A gl_CHECK_NEXT_HEADERS([stdio.h])
2N/A dnl No need to create extra modules for these functions. Everyone who uses
2N/A dnl <stdio.h> likely needs them.
2N/A GNULIB_FPRINTF=1
2N/A GNULIB_PRINTF=1
2N/A GNULIB_VFPRINTF=1
2N/A GNULIB_VPRINTF=1
2N/A GNULIB_FPUTC=1
2N/A GNULIB_PUTC=1
2N/A GNULIB_PUTCHAR=1
2N/A GNULIB_FPUTS=1
2N/A GNULIB_PUTS=1
2N/A GNULIB_FWRITE=1
2N/A dnl This ifdef is just an optimization, to avoid performing a configure
2N/A dnl check whose result is not used. It does not make the test of
2N/A dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
2N/A m4_ifdef([gl_SIGNAL_SIGPIPE], [
2N/A gl_SIGNAL_SIGPIPE
2N/A if test $gl_cv_header_signal_h_SIGPIPE != yes; then
2N/A REPLACE_STDIO_WRITE_FUNCS=1
2N/A AC_LIBOBJ([stdio-write])
2N/A fi
2N/A ])
2N/A
2N/A dnl Check for declarations of anything we want to poison if the
2N/A dnl corresponding gnulib module is not in use, and which is not
2N/A dnl guaranteed by C89.
2N/A gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
2N/A ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
2N/A snprintf tmpfile vdprintf vsnprintf])
2N/A])
2N/A
2N/AAC_DEFUN([gl_STDIO_MODULE_INDICATOR],
2N/A[
2N/A dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
2N/A AC_REQUIRE([gl_STDIO_H_DEFAULTS])
2N/A gl_MODULE_INDICATOR_SET_VARIABLE([$1])
2N/A dnl Define it also as a C macro, for the benefit of the unit tests.
2N/A gl_MODULE_INDICATOR_FOR_TESTS([$1])
2N/A])
2N/A
2N/AAC_DEFUN([gl_STDIO_H_DEFAULTS],
2N/A[
2N/A GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
2N/A GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
2N/A GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
2N/A GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
2N/A GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
2N/A GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
2N/A GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
2N/A GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
2N/A GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
2N/A GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
2N/A GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
2N/A GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
2N/A GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
2N/A GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
2N/A GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
2N/A GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
2N/A GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
2N/A GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
2N/A GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
2N/A GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
2N/A GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
2N/A GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
2N/A GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
2N/A GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
2N/A GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
2N/A GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
2N/A GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
2N/A GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
2N/A GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
2N/A GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
2N/A GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
2N/A GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
2N/A GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
2N/A GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
2N/A GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
2N/A GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
2N/A GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
2N/A GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
2N/A GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
2N/A GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
2N/A GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
2N/A dnl Assume proper GNU behavior unless another module says otherwise.
2N/A HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
2N/A HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
2N/A HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
2N/A HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
2N/A HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
2N/A HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
2N/A HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
2N/A HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
2N/A HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
2N/A HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
2N/A HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
2N/A HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
2N/A REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
2N/A REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
2N/A REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
2N/A REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
2N/A REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
2N/A REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
2N/A REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
2N/A REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
2N/A REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
2N/A REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
2N/A REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
2N/A REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
2N/A REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
2N/A REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
2N/A REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
2N/A REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
2N/A REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
2N/A REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
2N/A REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
2N/A REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
2N/A REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
2N/A REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
2N/A REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
2N/A REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
2N/A REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
2N/A REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
2N/A REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
2N/A REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
2N/A REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
2N/A REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
2N/A])
2N/A
2N/Adnl Code shared by fseeko and ftello. Determine if large files are supported,
2N/Adnl but stdin does not start as a large file by default.
2N/AAC_DEFUN([gl_STDIN_LARGE_OFFSET],
2N/A [
2N/A AC_CACHE_CHECK([whether stdin defaults to large file offsets],
2N/A [gl_cv_var_stdin_large_offset],
2N/A [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
2N/A[[#if defined __SL64 && defined __SCLE /* cygwin */
2N/A /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
2N/A fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
2N/A it is easier to do a version check than building a runtime test. */
2N/A# include <cygwin/version.h>
2N/A# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
2N/A choke me
2N/A# endif
2N/A#endif]])],
2N/A [gl_cv_var_stdin_large_offset=yes],
2N/A [gl_cv_var_stdin_large_offset=no])])
2N/A])