"Maciej W. Rozycki" <[EMAIL PROTECTED]> writes: > On Mon, 22 Sep 2003, Hrvoje Niksic wrote: > >> > Well, using off_t and AC_SYS_LARGEFILE seems to be the recommended >> > practice. >> >> Recommended for POSIX systems, perhaps, but not really portable to >> older machines. And it doesn't solve the portable printing problem >> either, so in effect it's about as portable as unconditionally using >> `long long', which is mandated by C99. > > I doubt any system that does not support off_t does support LFS.
As I mentioned in the first message, LFS is not the only thing you need large values for. Think download quota or the sum of downloaded bytes. You should be able to specify `--quota=10G' on systems without LFS. As for the hassle, remember that Wget caters to systems with much less features than LFS on a regular basis. For example, we suppose pre-ANSI C compilers, libc's without snprintf, strptime or, for that matter, basic C89 functions like memcpy or strstr. So yes, I'd say pre-LFS systems are worth the hassle. Perhaps a good compromise would be to use off_t for variables whose 64-bitness doesn't matter without LFS, and a `large_number_t' typedef that points to either `double' or `long long' for others. Since the others are quite rare, printing them won't be a problem in practice, just like it's not for VERY_LONG_TYPE right now. > And even if it does, it's probably not worth the hassle. To handle > ordinary old systems, you just call: > > AC_CHECK_TYPE(off_t, long) > > before calling AC_SYS_LARGEFILE. That still doesn't explain how to print off_t on systems that don't natively support it. (Or that do, for that matter.)