Skip to content

Commit a0d3847

Browse files
author
Edward Thomson
committed
mac: on 32 bit, use __builtin_umull_overflow
1 parent 60c2bf4 commit a0d3847

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/integer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ GIT_INLINE(bool) git__add_uint64_overflow(uint64_t *out, uint64_t one, uint64_t
5555
}
5656

5757
/* Use clang/gcc compiler intrinsics whenever possible */
58-
#if (SIZE_MAX == UINT_MAX) && __has_builtin(__builtin_uadd_overflow)
59-
# define git__add_sizet_overflow(out, one, two) \
60-
__builtin_uadd_overflow(one, two, out)
61-
# define git__multiply_sizet_overflow(out, one, two) \
62-
__builtin_umul_overflow(one, two, out)
63-
#elif (SIZE_MAX == ULONG_MAX) && __has_builtin(__builtin_uaddl_overflow)
58+
#if (SIZE_MAX == ULONG_MAX) && __has_builtin(__builtin_uaddl_overflow)
6459
# define git__add_sizet_overflow(out, one, two) \
6560
__builtin_uaddl_overflow(one, two, out)
6661
# define git__multiply_sizet_overflow(out, one, two) \
6762
__builtin_umull_overflow(one, two, out)
63+
#elif (SIZE_MAX == UINT_MAX) && __has_builtin(__builtin_uadd_overflow)
64+
# define git__add_sizet_overflow(out, one, two) \
65+
__builtin_uadd_overflow(one, two, out)
66+
# define git__multiply_sizet_overflow(out, one, two) \
67+
__builtin_umul_overflow(one, two, out)
6868
#else
6969

7070
/**

0 commit comments

Comments
 (0)