File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,7 @@ static inline uint64_t default_bswap64(uint64_t val)
35
35
#undef bswap32
36
36
#undef bswap64
37
37
38
- #if defined(__has_builtin ) && __has_builtin (__builtin_bswap64 )
39
-
40
- #define bswap32 (x ) __builtin_bswap32((x))
41
- #define bswap64 (x ) __builtin_bswap64((x))
42
-
43
- #elif defined(__GNUC__ ) && (defined(__i386__ ) || defined(__x86_64__ ))
38
+ #if defined(__GNUC__ ) && (defined(__i386__ ) || defined(__x86_64__ ))
44
39
45
40
#define bswap32 git_bswap32
46
41
static inline uint32_t git_bswap32 (uint32_t x )
@@ -79,6 +74,11 @@ static inline uint64_t git_bswap64(uint64_t x)
79
74
}
80
75
#endif
81
76
77
+ #elif defined(__has_builtin ) && __has_builtin (__builtin_bswap64 ) /* for clang arm64; gcc only added this in gcc 10 */
78
+
79
+ #define bswap32 (x ) __builtin_bswap32((x))
80
+ #define bswap64 (x ) __builtin_bswap64((x))
81
+
82
82
#elif defined(_MSC_VER ) && (defined(_M_IX86 ) || defined(_M_X64 ) || defined(_M_ARM64 ))
83
83
84
84
#include <stdlib.h>
You can’t perform that action at this time.
0 commit comments