how to check for a struct in multiple headers?

Tanner Lovelace clubjuggler at gmail.com
Fri Mar 31 07:52:53 CEST 2006


On 3/30/06, Benjamin Reed <rangerrick at gmail.com> wrote:
> I need to make the test for statfs try sys/mount.h, currently I get
> the following when compiling kdecore:
>
---(snip!)---

> What I really want is for HAVE_STRUCT_STATFS to be set if struct
> statfs is in sys/statfs.h *or* sys/mount.h.

Actually, not even that will work due to how the code is written.
kmountpoint.cpp has this:

#if defined(HAVE_STRUCT_STATVFS)
    struct statvfs *mounted;
#elif defined(HAVE_STRUCT_STATFS)
    struct statfs *mounted;
#endif

So, even if it finds HAVE_STRUCT_STATFS it won't be
used because HAVE_STRUCT_STATVFS was found first
and it assumes it will use it, which isn't the case in OS X.
I just verified that by fixing the test for HAVE_STRUCT_STATFS
and still having the compile fail. :-(

My guess is we need a test about what type of parameter
getmntinfo takes.  Suggestions?

Cheers,
Tanner

--
Tanner Lovelace
clubjuggler at gmail dot com
http://wtl.wayfarer.org/
(fieldless) In fess two roundels in pale, a billet fesswise and an
increscent, all sable.


More information about the Kde-buildsystem mailing list