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

Re: need advice on library interface



* Glenn Maynard (g_deb@zewt.org) wrote:
> I suppose you could make the functions always take 64-bit integer types.
> That is, roll your own off64_t type if one doesn't exist, and always take
> that type even if you can't honor it.  Then the ABI would only change if
> it, for some reason, can't find a 64-bit integer type on one install and
> can later.

This was my initial idea.  The problem is that there is no reasonably
portable 64-bit type that I know of.

> > > 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.
> > 
> > It is more than just a pain: it is a violation of the ABI.  It also makes
> > it impossible to mix libraries in some cases (like the
> > libsndfile/wxWindows case that I mentioned).
> 
> That's why I'm suggesting (always) using _LARGEFILE64_SOURCE instead of
> _FILE_OFFSET_BITS: it doesn't change any interfaces, it just makes
> explicit 64-bit ones available.

AFAICS, _FILE_OFFSET_BITS vs. _LARGEFILE64_SOURCE is rather
inconsequential since it will only affect interaction between libsndfile
and libc.  I only care about interaction between client programs and
libsndfile.

Unless you are proposing that libsndfile also recognize these symbols and
treat them the way libc does.  I hope we can avoid that path.

Josh

-- 
Joshua Haberman  <joshua@haberman.com>



Reply to: