Skip to content

Commit 5b6a759

Browse files
committed
Another place
1 parent 632cb49 commit 5b6a759

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cpp/src/arrow/util/align_util.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,15 @@ struct BitmapWordAlignParams {
4444
template <uint64_t ALIGN_IN_BYTES>
4545
inline BitmapWordAlignParams BitmapWordAlign(const uint8_t* data, int64_t bit_offset,
4646
int64_t length) {
47+
// TODO: We can remove this condition once CRAN upgrades its macOS
48+
// SDK from 11.3.
49+
#if defined(__clang__) && !defined(__cpp_lib_bitops)
50+
static_assert((ALIGN_IN_BYTES != 0) && ((ALIGN_IN_BYTES & (ALIGN_IN_BYTES - 1)) == 0),
51+
"ALIGN_IN_BYTES should be a positive power of two");
52+
#else
4753
static_assert(std::has_single_bit(ALIGN_IN_BYTES),
4854
"ALIGN_IN_BYTES should be a positive power of two");
55+
#endif
4956
constexpr uint64_t ALIGN_IN_BITS = ALIGN_IN_BYTES * 8;
5057

5158
BitmapWordAlignParams p;

0 commit comments

Comments
 (0)