Skip to content

Commit

Permalink
MONGOCRYPT-534 Fix type detection: No trying to guess the type of 'ui…
Browse files Browse the repository at this point in the history
…nt64_t' (#567)

* No dancing around 'long' vs 'long long'

* (Debian packaging) Drop remove-builtin.patch, integrated upstream

---------

Co-authored-by: Kyle Kloberdanz <kyle.kloberdanz@mongodb.com>
  • Loading branch information
2 people authored and rcsanchez97 committed Feb 10, 2023
1 parent b0eb466 commit 64f93f1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 37 deletions.
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 <kyle.kloberdanz@mongodb.com> 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 <kevin.albertson@mongodb.com>,
Kyle Kloberdanz <kyle.kloberdanz@mongodb.com>
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

0 comments on commit 64f93f1

Please sign in to comment.