Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Error building ipodpatcher

Re: Error building ipodpatcher

From: Rafaël Carré <rafael.carre_at_gmail.com>
Date: Thu, 11 Jun 2009 23:39:32 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Thu, 11 Jun 2009 22:20:29 +0100,
Dave Chapman <dave_at_dchapman.com> a écrit :

> 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.

I found the following in features.h :

#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
     !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
          !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
               !defined _BSD_SOURCE && !defined _SVID_SOURCE)
# define _BSD_SOURCE 1
# define _SVID_SOURCE 1
#endif

#ifdef _BSD_SOURCE
# define __USE_BSD 1
#endif


> 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.

Looks much simpler.

> Also, I don't think checking "#ifndef htole16" will prove reliable -
> it may not be implemented as a macro on all platforms.

Sorry for my mistake, I though #ifndef would work even if htole16 is
not a macro, but it isn't the case.

> Note that ipodpatcher has been successfully tested on BSD variants in
> the past, but probably not since the fat32format.c code was added.
>
> Dave.



- --
Rafaël Carré
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoxeZQACgkQYWCeGMCv8Q/S1gCfYEq1rzetYVYSl3VmeNF4UTPR
adgAoKinULwvRMWgzjF8ZkW6FviXnhLI
=1Tve
-----END PGP SIGNATURE-----
Received on 2009-06-11

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy