This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] add 64 bit off_t for linux/i686 (and maybe some others)


On Sun, Jul 04, 2004 at 08:30:07PM -0500, Bud Davis wrote:
> 2004-07-04  Bud Davis  <bdavis9659@comcast.net>
> 
> 	* configure.ac: Add check for LFS support. 
> 	* configure: Regenerate

> + # Check for LFS support
> + AC_TRY_LINK(
> +       [#include <unistd.h>],
> +       [fopen64("t", "w");
> +       lseek64(1, 0, SEEK_CUR);],
> +       [AC_DEFINE([_FILE_OFFSET_BITS],[64],["Define to 64 if LFS is supported"] )])
> + 

This is a bad test.
-D_FILE_OFFSET_BITS=64 makes fopen, lseek etc. transparently 64-bit, while
whether *64 alternatives exist is a matter of a different macro in glibc
(-D_LARGEFILE64_SOURCE).  Also, fopen64 is prototyped in stdio.h, not
unistd.h.
You should IMHO use AC_SYS_LARGEFILE autoconf macro instead.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]