Newer glibc has letoh16 and friends, so use them if available
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20128 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
79967c7a49
commit
e1d80522cf
1 changed files with 7 additions and 0 deletions
|
@ -43,6 +43,8 @@ const int nb_settings = 0;
|
|||
(((unsigned long)(x) & 0xff0000ul) >> 8) | \
|
||||
(((unsigned long)(x) & 0xff00ul) << 8) | \
|
||||
((unsigned long)(x) << 24)))
|
||||
|
||||
#ifndef letoh16
|
||||
unsigned short letoh16(unsigned short x)
|
||||
{
|
||||
unsigned short n = 0x1234;
|
||||
|
@ -56,7 +58,9 @@ unsigned short letoh16(unsigned short x)
|
|||
return SWAP_16(x);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef letoh32
|
||||
unsigned short letoh32(unsigned short x)
|
||||
{
|
||||
unsigned short n = 0x1234;
|
||||
|
@ -70,7 +74,9 @@ unsigned short letoh32(unsigned short x)
|
|||
return SWAP_32(x);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef htole32
|
||||
unsigned int htole32(unsigned int x)
|
||||
{
|
||||
unsigned short n = 0x1234;
|
||||
|
@ -84,6 +90,7 @@ unsigned int htole32(unsigned int x)
|
|||
return SWAP_32(x);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int read_line(int fd, char* buffer, int buffer_size)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue