From 7a228db08cee2ccdde6bb6a9b0059a903677672e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 28 Feb 2011 15:10:55 -0800 Subject: [PATCH] stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello * m4/fseeko.m4 (gl_STDIN_LARGE_OFFSET): Moved here, from ... * m4/stdio_h.m4 (gl_STDIN_LARGE_OFFSET): ... here, because * modules/ftello (Files): Add m4/fseeko.m4, for gl_STDIN_LARGE_OFFSET. --- ChangeLog | 7 +++++++ m4/fseeko.m4 | 22 +++++++++++++++++++++- m4/stdio_h.m4 | 22 +--------------------- modules/ftello | 1 + 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f7bd50d3..115b6dc68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-02-28 Paul Eggert + + stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello + * m4/fseeko.m4 (gl_STDIN_LARGE_OFFSET): Moved here, from ... + * m4/stdio_h.m4 (gl_STDIN_LARGE_OFFSET): ... here, because + * modules/ftello (Files): Add m4/fseeko.m4, for gl_STDIN_LARGE_OFFSET. + 2011-02-28 Bruno Haible localcharset: Assume ANSI C behaviour of free(). diff --git a/m4/fseeko.m4 b/m4/fseeko.m4 index 4a672606a..76507d128 100644 --- a/m4/fseeko.m4 +++ b/m4/fseeko.m4 @@ -1,4 +1,4 @@ -# fseeko.m4 serial 10 +# fseeko.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, @@ -53,3 +53,23 @@ AC_DEFUN([gl_REPLACE_FSEEKO], dnl If we are also using the fseek module, then fseek needs replacing, too. m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK]) ]) + +dnl Code shared by fseeko and ftello. Determine if large files are supported, +dnl but stdin does not start as a large file by default. +AC_DEFUN([gl_STDIN_LARGE_OFFSET], + [ + AC_CACHE_CHECK([whether stdin defaults to large file offsets], + [gl_cv_var_stdin_large_offset], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if defined __SL64 && defined __SCLE /* cygwin */ + /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and + it is easier to do a version check than building a runtime test. */ +# include +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) + choke me +# endif +#endif]])], + [gl_cv_var_stdin_large_offset=yes], + [gl_cv_var_stdin_large_offset=no])]) +]) diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index b6163d680..2d4375937 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 32 +# stdio_h.m4 serial 33 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, @@ -139,23 +139,3 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) ]) - -dnl Code shared by fseeko and ftello. Determine if large files are supported, -dnl but stdin does not start as a large file by default. -AC_DEFUN([gl_STDIN_LARGE_OFFSET], - [ - AC_CACHE_CHECK([whether stdin defaults to large file offsets], - [gl_cv_var_stdin_large_offset], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[#if defined __SL64 && defined __SCLE /* cygwin */ - /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making - fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and - it is easier to do a version check than building a runtime test. */ -# include -# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) - choke me -# endif -#endif]])], - [gl_cv_var_stdin_large_offset=yes], - [gl_cv_var_stdin_large_offset=no])]) -]) diff --git a/modules/ftello b/modules/ftello index 99c70972b..0cf160c98 100644 --- a/modules/ftello +++ b/modules/ftello @@ -4,6 +4,7 @@ ftello() function: Retrieve the position of a FILE stream. Files: lib/ftello.c lib/stdio-impl.h +m4/fseeko.m4 m4/ftello.m4 Depends-on: -- 2.11.0