Skip to content

Commit 60365ff

Browse files
MONGOCRYPT-534 Fix type detection: No trying to guess the type of 'uint64_t' (#567)
* No dancing around 'long' vs 'long long' * (Debian packaging) Drop remove-builtin.patch, integrated upstream --------- Co-authored-by: Kyle Kloberdanz <[email protected]>
1 parent 00b0f73 commit 60365ff

File tree

5 files changed

+11
-37
lines changed

5 files changed

+11
-37
lines changed

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
libmongocrypt (1.7.1-3) UNRELEASED; urgency=medium
2+
3+
* Drop remove-builtin.patch, integrated upstream
4+
5+
-- Kyle Kloberdanz <[email protected]> Fri, 10 Feb 2023 09:33:24 -0600
6+
17
libmongocrypt (1.7.1-2) unstable; urgency=medium
28

39
* Remove builtin which causes 32-bit ARM builds to fail

debian/control

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Uploaders: Kevin Albertson <[email protected]>,
66
Kyle Kloberdanz <[email protected]>
77
Build-Depends: debhelper (>= 10),
88
cmake,
9-
quilt,
109
libssl-dev,
1110
pkg-config,
1211
libintelrdfpmath-dev (>= 2.0u2-6),

debian/patches/remove-builtin.patch

-26
This file was deleted.

debian/patches/series

-1
This file was deleted.

src/mc-range-edge-generation-private.h

+5-9
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,17 @@ mc_edges_t *
8888
mc_getEdgesDecimal128 (mc_getEdgesDecimal128_args_t args,
8989
mongocrypt_status_t *status);
9090

91+
BSON_STATIC_ASSERT2 (ull_is_u64,
92+
sizeof (uint64_t) == sizeof (unsigned long long));
9193

9294
// count_leading_zeros_u64 returns the number of leading 0 bits of `in`.
9395
static inline size_t
9496
mc_count_leading_zeros_u64 (uint64_t in)
9597
{
9698
#ifdef __has_builtin
97-
#if __has_builtin(__builtin_clzl)
98-
// Pointer-cast to ensure we are speaking the right type
99-
#if defined(__APPLE__) || defined(__ILP32__)
100-
unsigned long long *p = &in;
101-
return (size_t) (in ? __builtin_clzll (*p) : 64);
102-
#else
103-
unsigned long *p = &in;
104-
return (size_t) (in ? __builtin_clzl (*p) : 64);
105-
#endif
99+
#if __has_builtin(__builtin_clzll)
100+
unsigned long long ull = in;
101+
return (size_t) (in ? __builtin_clzll (ull) : 64);
106102
#endif
107103
#endif
108104
uint64_t bit = UINT64_C (1) << 63;

0 commit comments

Comments
 (0)