Rafaël Carré wrote:
The problem is htole16 and htole32 are defined in endian.h (under ifdef
__USE_BSD)
I believe this is a bug in Ubuntu, but if other OS (BSD?) provide these
functions they should be under #ifndef htole16 ?
I don't think this is a Ubuntu problem - those macros were added with
glibc 2.9.
As you say, they're defined under a #ifdef __USE_BSD - so one solution
is to pass the relevant options in CFLAGS to ensure __USE_BSD isn't defined.
But maybe we should simply rename htole16 and htole32 functions to
something else - that code is simple and not speed-critical, so IMO
there's no real reason to go to the trouble of checking glibc versions.
Also, I don't think checking "#ifndef htole16" will prove reliable - it
may not be implemented as a macro on all platforms.
Note that ipodpatcher has been successfully tested on BSD variants in
the past, but probably not since the fat32format.c code was added.
Dave.