File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 30
30
*/
31
31
#define _FILE_OFFSET_BITS 64
32
32
#include <ctype.h>
33
- #include <endian.h>
34
33
#include <errno.h>
35
34
#include <inttypes.h>
36
35
#include <stdbool.h>
39
38
#include <string.h>
40
39
#include <unistd.h>
41
40
41
+ #if defined(__APPLE__ )
42
+ #include <machine/endian.h>
43
+ #include <libkern/OSByteOrder.h>
44
+
45
+ #define htobe16 (x ) OSSwapHostToBigInt16(x)
46
+ #define htole16 (x ) OSSwapHostToLittleInt16(x)
47
+ #define be16toh (x ) OSSwapBigToHostInt16(x)
48
+ #define le16toh (x ) OSSwapLittleToHostInt16(x)
49
+
50
+ #define htobe32 (x ) OSSwapHostToBigInt32(x)
51
+ #define htole32 (x ) OSSwapHostToLittleInt32(x)
52
+ #define be32toh (x ) OSSwapBigToHostInt32(x)
53
+ #define le32toh (x ) OSSwapLittleToHostInt32(x)
54
+
55
+ #define htobe64 (x ) OSSwapHostToBigInt64(x)
56
+ #define htole64 (x ) OSSwapHostToLittleInt64(x)
57
+ #define be64toh (x ) OSSwapBigToHostInt64(x)
58
+ #define le64toh (x ) OSSwapLittleToHostInt64(x)
59
+ #else
60
+ #include <endian.h>
61
+ #endif
62
+
42
63
#include "sparse.h"
43
64
44
65
int sparse_header_parse (int fd , sparse_header_t * sparse_header )
You can’t perform that action at this time.
0 commit comments