diff options
| -rw-r--r-- | src/bplist.c | 12 | ||||
| -rw-r--r-- | src/plist.c | 18 |
2 files changed, 14 insertions, 16 deletions
diff --git a/src/bplist.c b/src/bplist.c index 93f0bc6..1216974 100644 --- a/src/bplist.c +++ b/src/bplist.c | |||
| @@ -168,15 +168,13 @@ union plist_uint_ptr | |||
| 168 | 168 | ||
| 169 | #define get_real_bytes(x) ((x) == (float) (x) ? sizeof(float) : sizeof(double)) | 169 | #define get_real_bytes(x) ((x) == (float) (x) ? sizeof(float) : sizeof(double)) |
| 170 | 170 | ||
| 171 | #if (defined(__LITTLE_ENDIAN__) \ | 171 | #if (defined(__BIG_ENDIAN__) && !defined(__FLOAT_WORD_ORDER__)) \ |
| 172 | && !defined(__FLOAT_WORD_ORDER__)) \ | 172 | || (defined(__FLOAT_WORD_ORDER__) && __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__) |
| 173 | || (defined(__FLOAT_WORD_ORDER__) \ | ||
| 174 | && __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__) | ||
| 175 | #define float_bswap64(x) bswap64(x) | ||
| 176 | #define float_bswap32(x) bswap32(x) | ||
| 177 | #else | ||
| 178 | #define float_bswap64(x) (x) | 173 | #define float_bswap64(x) (x) |
| 179 | #define float_bswap32(x) (x) | 174 | #define float_bswap32(x) (x) |
| 175 | #else | ||
| 176 | #define float_bswap64(x) bswap64(x) | ||
| 177 | #define float_bswap32(x) bswap32(x) | ||
| 180 | #endif | 178 | #endif |
| 181 | 179 | ||
| 182 | #ifndef __has_builtin | 180 | #ifndef __has_builtin |
diff --git a/src/plist.c b/src/plist.c index 79448db..0d4e077 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -82,26 +82,26 @@ static int plist_debug = 0; | |||
| 82 | #endif | 82 | #endif |
| 83 | 83 | ||
| 84 | #ifndef le16toh | 84 | #ifndef le16toh |
| 85 | #ifdef __LITTLE_ENDIAN__ | 85 | #ifdef __BIG_ENDIAN__ |
| 86 | #define le16toh(x) (x) | ||
| 87 | #else | ||
| 88 | #define le16toh(x) bswap16(x) | 86 | #define le16toh(x) bswap16(x) |
| 87 | #else | ||
| 88 | #define le16toh(x) (x) | ||
| 89 | #endif | 89 | #endif |
| 90 | #endif | 90 | #endif |
| 91 | 91 | ||
| 92 | #ifndef le32toh | 92 | #ifndef le32toh |
| 93 | #ifdef __LITTLE_ENDIAN__ | 93 | #ifdef __BIG_ENDIAN__ |
| 94 | #define le32toh(x) (x) | ||
| 95 | #else | ||
| 96 | #define le32toh(x) bswap32(x) | 94 | #define le32toh(x) bswap32(x) |
| 95 | #else | ||
| 96 | #define le32toh(x) (x) | ||
| 97 | #endif | 97 | #endif |
| 98 | #endif | 98 | #endif |
| 99 | 99 | ||
| 100 | #ifndef le64toh | 100 | #ifndef le64toh |
| 101 | #ifdef __LITTLE_ENDIAN__ | 101 | #ifdef __BIG_ENDIAN__ |
| 102 | #define le64toh(x) (x) | ||
| 103 | #else | ||
| 104 | #define le64toh(x) bswap64(x) | 102 | #define le64toh(x) bswap64(x) |
| 103 | #else | ||
| 104 | #define le64toh(x) (x) | ||
| 105 | #endif | 105 | #endif |
| 106 | #endif | 106 | #endif |
| 107 | 107 | ||
