Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: cgpt/endian.h

Issue 2719008: Nearly complete rewrite of cgpt tool. (Closed) Base URL: ssh://git@chromiumos-git//vboot_reference.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cgpt/cmd_show.c ('k') | tests/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef VBOOT_REFERENCE_UTILITY_CGPT_ENDIAN_H_
2 #define VBOOT_REFERENCE_UTILITY_CGPT_ENDIAN_H_
3
4 // Newer distros already have this. For those that don't, we add it here.
5 #include <endian.h>
6
7 #ifndef le16toh
8
9 # include <byteswap.h>
10
11 # if __BYTE_ORDER == __LITTLE_ENDIAN
12 # define htobe16(x) __bswap_16 (x)
13 # define htole16(x) (x)
14 # define be16toh(x) __bswap_16 (x)
15 # define le16toh(x) (x)
16
17 # define htobe32(x) __bswap_32 (x)
18 # define htole32(x) (x)
19 # define be32toh(x) __bswap_32 (x)
20 # define le32toh(x) (x)
21
22 # define htobe64(x) __bswap_64 (x)
23 # define htole64(x) (x)
24 # define be64toh(x) __bswap_64 (x)
25 # define le64toh(x) (x)
26 # else
27 # define htobe16(x) (x)
28 # define htole16(x) __bswap_16 (x)
29 # define be16toh(x) (x)
30 # define le16toh(x) __bswap_16 (x)
31
32 # define htobe32(x) (x)
33 # define htole32(x) __bswap_32 (x)
34 # define be32toh(x) (x)
35 # define le32toh(x) __bswap_32 (x)
36
37 # define htobe64(x) (x)
38 # define htole64(x) __bswap_64 (x)
39 # define be64toh(x) (x)
40 # define le64toh(x) __bswap_64 (x)
41 # endif
42
43 #endif
44 #endif // VBOOT_REFERENCE_UTILITY_CGPT_ENDIAN_H_
OLDNEW
« no previous file with comments | « cgpt/cmd_show.c ('k') | tests/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698