Skip to content

MONGOCRYPT-534 Fix type detection: No trying to guess the type of 'uint64_t' #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
libmongocrypt (1.7.1-3) UNRELEASED; urgency=medium

* Drop remove-builtin.patch, integrated upstream

-- Kyle Kloberdanz <[email protected]> Fri, 10 Feb 2023 09:33:24 -0600

libmongocrypt (1.7.1-2) unstable; urgency=medium

* Remove builtin which causes 32-bit ARM builds to fail
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Uploaders: Kevin Albertson <[email protected]>,
Kyle Kloberdanz <[email protected]>
Build-Depends: debhelper (>= 10),
cmake,
quilt,
libssl-dev,
pkg-config,
libintelrdfpmath-dev (>= 2.0u2-6),
Expand Down
26 changes: 0 additions & 26 deletions debian/patches/remove-builtin.patch

This file was deleted.

1 change: 0 additions & 1 deletion debian/patches/series

This file was deleted.

14 changes: 5 additions & 9 deletions src/mc-range-edge-generation-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,17 @@ mc_edges_t *
mc_getEdgesDecimal128 (mc_getEdgesDecimal128_args_t args,
mongocrypt_status_t *status);

BSON_STATIC_ASSERT2 (ull_is_u64,
sizeof (uint64_t) == sizeof (unsigned long long));

// count_leading_zeros_u64 returns the number of leading 0 bits of `in`.
static inline size_t
mc_count_leading_zeros_u64 (uint64_t in)
{
#ifdef __has_builtin
#if __has_builtin(__builtin_clzl)
// Pointer-cast to ensure we are speaking the right type
#if defined(__APPLE__) || defined(__ILP32__)
unsigned long long *p = &in;
return (size_t) (in ? __builtin_clzll (*p) : 64);
#else
unsigned long *p = &in;
return (size_t) (in ? __builtin_clzl (*p) : 64);
#endif
#if __has_builtin(__builtin_clzll)
unsigned long long ull = in;
return (size_t) (in ? __builtin_clzll (ull) : 64);
#endif
#endif
uint64_t bit = UINT64_C (1) << 63;
Expand Down