diff options
author | Peter Foley <pefoley2@pefoley.com> | 2014-09-25 14:24:03 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-09-26 05:03:01 -0400 |
commit | ec84284b008858b240b6c5b2a581408f6351a0a3 (patch) | |
tree | afd0fff5a01b34b82c271a4b64de75cb0bc9bc0f /tools/include | |
parent | 8e2faea877eb24511c8e71b88e803e22c6bf235e (diff) |
tools: add more endian.h macros
Add some more macros to tools/endian.h to allow mpssd to be compiled
against glibc < 2.9.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Cc: rdunlap@infradead.org
Cc: linux-doc@vger.kernel.org
Cc: sudeep.dutt@intel.com
Cc: nikhil.rao@intel.com
Cc: ashutosh.dixit@intel.com
Cc: akpm@linux-foundation.org
Cc: gregkh@linuxfoundation.org
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/tools/endian.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/include/tools/endian.h b/tools/include/tools/endian.h index 5d42e20ab83d..8001194008da 100644 --- a/tools/include/tools/endian.h +++ b/tools/include/tools/endian.h | |||
@@ -15,6 +15,18 @@ | |||
15 | #define htole64(x) (x) | 15 | #define htole64(x) (x) |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | #ifndef le16toh | ||
19 | #define le16toh(x) (x) | ||
20 | #endif | ||
21 | |||
22 | #ifndef le32toh | ||
23 | #define le32toh(x) (x) | ||
24 | #endif | ||
25 | |||
26 | #ifndef le64toh | ||
27 | #define le64toh(x) (x) | ||
28 | #endif | ||
29 | |||
18 | #else /* __BYTE_ORDER */ | 30 | #else /* __BYTE_ORDER */ |
19 | 31 | ||
20 | #ifndef htole16 | 32 | #ifndef htole16 |
@@ -27,6 +39,18 @@ | |||
27 | #define htole64(x) __bswap_64(x) | 39 | #define htole64(x) __bswap_64(x) |
28 | #endif | 40 | #endif |
29 | 41 | ||
42 | #ifndef le16toh | ||
43 | #define le16toh(x) __bswap_16(x) | ||
44 | #endif | ||
45 | |||
46 | #ifndef le32toh | ||
47 | #define le32toh(x) __bswap_32(x) | ||
48 | #endif | ||
49 | |||
50 | #ifndef le64toh | ||
51 | #define le64toh(x) __bswap_64(x) | ||
52 | #endif | ||
53 | |||
30 | #endif | 54 | #endif |
31 | 55 | ||
32 | #endif /* _TOOLS_ENDIAN_H */ | 56 | #endif /* _TOOLS_ENDIAN_H */ |