Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-02-01 09:23:37


At 04:33 AM 2/1/2004, Momchil Velikov wrote:

> All files must be compiled with the same _FILE_OFFSET_BITS. You
>don't want to get binary incompatible objects just because one
>happened to include the above header[1] and the other didn't.
>
>~velco
>
>[1] The program may have reasons to use struct stat independed of the
>presence of boost.

Hum... Perhaps mistakenly, I assumed stat() was a macro that expanded to
call stat64() if _FILE_OFFSET_BITS=64 was defined. Put another way, is a
program linking these two files OK?

file_a.cpp
   #define _FILE_OFFSET_BITS=64
   #include <sty/stat.h>
   long long func_a()
   {
     struct stat s;
     if ( stat( "foo", &s ) != 0 ) { throw ... }
     return s.st_size;
   }

file_b.cpp
   #include <sty/stat.h>
   long func_b()
   {
     struct stat s;
     if ( stat( "bar", &s ) != 0 ) { throw ... }
     return s.st_size;
   }

If that causes an ABI clash, then we would have to use the explicit 64-bit
stat64() interface if available, and otherwise default to stat(). Is there
a de facto standard feature availability macro to determine if
_LARGEFILE64_SOURCE is supported?

Thanks,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk