[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module 'fseeko'
From: |
Bruno Haible |
Subject: |
Re: new module 'fseeko' |
Date: |
Thu, 26 Apr 2007 11:41:56 +0200 |
User-agent: |
KMail/1.5.4 |
Eric Blake wrote:
> > Btw, what is AC_FUNC_FSEEKO good for?
>
> AC_FUNC_FSEEKO turns on large file support, if necessary.
Actually, it doesn't. Paul explained it: AC_FUNC_FSEEKO makes the fseeko()
and ftello() declarations visible (and all the *64 struct and function
declarations) but does *not* do what AC_SYS_LARGEFILE does.
> > 2007-04-25 Bruno Haible <address@hidden>
> >
> > * modules/fseeko: New file.
> ...
> > + #if @GNULIB_FSEEKO@
> > + # if address@hidden@
> > + /* Assume 'off_t' is the same type as 'long'. */
> > + # define fseeko fseek
> > + # endif
>
> Is that assumption safe, or should we also find the size of long and off_t
> to verify that situation?
Verifying it cannot hurt. I commit the appended patch. Thanks for the
suggestion.
> > + #else
> > + # undef fseeko
> > + # define fseeko(f,o,w) \
> > + (GL_LINK_WARNING ("fseeko is unportable - " \
> > + "use gnulib module fseeko for portability"), \
> > + fseeko (f, o, w))
> > + #endif
>
> Should we also add a link warning for programs that use fseek/ftell
> instead of fseeko/ftello, telling the user they are potentially
> artificially limited by not using off_t?
Good idea! Can you do this?
Bruno
2007-04-26 Bruno Haible <address@hidden>
* lib/stdio_.h (fseeko, ftello): Check that off_t has the same size as
'long' when we assume it.
Suggested by Eric Blake.
*** lib/stdio_.h 25 Apr 2007 09:14:49 -0000 1.20
--- lib/stdio_.h 26 Apr 2007 09:36:47 -0000
***************
*** 38,44 ****
#include <stdarg.h>
#include <stddef.h>
! #if @GNULIB_FFLUSH@ && @REPLACE_FFLUSH@
/* Get off_t. */
# include <sys/types.h>
#endif
--- 38,44 ----
#include <stdarg.h>
#include <stddef.h>
! #if (@GNULIB_FFLUSH@ && @REPLACE_FFLUSH@) || (@GNULIB_FSEEKO@ &&
address@hidden@) || (@GNULIB_FTELLO@ && address@hidden@)
/* Get off_t. */
# include <sys/types.h>
#endif
***************
*** 220,225 ****
--- 220,226 ----
#elif @GNULIB_FSEEKO@
# if address@hidden@
/* Assume 'off_t' is the same type as 'long'. */
+ typedef int verify_fseeko_types[2 * (sizeof (off_t) == sizeof (long)) - 1];
# define fseeko fseek
# endif
#else
***************
*** 233,238 ****
--- 234,240 ----
#if @GNULIB_FTELLO@
# if address@hidden@
/* Assume 'off_t' is the same type as 'long'. */
+ typedef int verify_ftello_types[2 * (sizeof (off_t) == sizeof (long)) - 1];
# define ftello ftell
# endif
#else
- Re: operations on FILE streams, (continued)
- Re: operations on FILE streams, Paul Eggert, 2007/04/13
- Re: operations on FILE streams, Bruno Haible, 2007/04/13
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/16
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/23
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/23
- new module 'fseeko', Bruno Haible, 2007/04/25
- Re: new module 'fseeko', Eric Blake, 2007/04/25
- Re: new module 'fseeko',
Bruno Haible <=
- Re: new module 'fseeko', Bruno Haible, 2007/04/28
- Re: new module 'fseeko', Paul Eggert, 2007/04/25
- Re: new module 'fseeko', Bruno Haible, 2007/04/26
- new module 'ftello', Bruno Haible, 2007/04/25
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/25
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/25
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/26
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/26
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/25