[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: need advice on library interface

On Tue, Aug 06, 2002 at 11:54:50AM -0500, Joshua Haberman wrote:
> This caused a problem for me when I tried to link against wxWindows,
> which *also* includes off_t in its interface but *doesn't* compile with

Instead of using _FILE_OFFSET_BITS, define _GNU_SOURCE (or _LARGEFILE64_SOURCE)
to get off64_t and the 64-bit set of functions, and use those instead.  (You'd
need to make a layer for systems without LFS support, though.  Aliasing
off64_t -> off_t, fstat64 -> fstat, etc. with typedefs and #defines should

Standard types that change based on configuration #defines are a pain;
if a library requires _FILE_OFFSET_BITS to match the setting in
applications, it'll cause problems if an application actually wants it
to be left alone for some reason.  (Also, if oyur headers define it, an
app can easily get it defined in some headers but not others, which will
cause problems.)

Glenn Maynard

Reply to: