Rework byteswap.h inclusion.
This header is not available on e.g. FreeBSD so detect it's presence in configure.ac and only include it if appropriate. Then, if byte order manipulation macros are not defined (old glibc like the one provided by Debian GNU/Linux) define them.
This commit is contained in:
parent
8b2de449c7
commit
62ddf57c53
2 changed files with 7 additions and 1 deletions
|
|
@ -20,8 +20,11 @@
|
|||
#ifndef __FREEFARE_INTERNAL_H__
|
||||
#define __FREEFARE_INTERNAL_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined(HAVE_BYTESWAP_H)
|
||||
#include <byteswap.h>
|
||||
#if !defined(le32toh) || !defined(htole32)
|
||||
#include <byteswap.h>
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define le32toh(x) (x)
|
||||
#define htole32(x) bswap_32(x)
|
||||
|
|
@ -30,6 +33,7 @@
|
|||
#define htole32(x) (x)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
struct mad_sector_0x00;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue