Skip to content
Open
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
3 changes: 2 additions & 1 deletion cpp/src/arrow/util/align_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ inline BitmapWordAlignParams BitmapWordAlign(const uint8_t* data, int64_t bit_of
int64_t length) {
// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
#if defined(__clang__) && !defined(__cpp_lib_bitops) && !defined(__EMSCRIPTEN__)
// __apple_build_version__ should be defined only on Apple clang
#if defined(__apple_build_version__) && !defined(__cpp_lib_bitops)
static_assert((ALIGN_IN_BYTES != 0) && ((ALIGN_IN_BYTES & (ALIGN_IN_BYTES - 1)) == 0),
"ALIGN_IN_BYTES should be a positive power of two");
#else
Expand Down
7 changes: 4 additions & 3 deletions cpp/src/arrow/util/bit_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ static inline uint64_t TrailingBits(uint64_t v, int num_bits) {
static inline int Log2(uint64_t x) {
// DCHECK_GT(x, 0);

// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
#if defined(__clang__) && !defined(__cpp_lib_bitops) && !defined(__EMSCRIPTEN__)
// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
// __apple_build_version__ should be defined only on Apple clang
#if defined(__apple_build_version__) && !defined(__cpp_lib_bitops)
return std::log2p1(x - 1);
#else
return std::bit_width(x - 1);
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/arrow/util/rle_encoding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,8 @@ TEST(BitRle, Random) {
}
// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
#if defined(__clang__) && !defined(__cpp_lib_bitops) && !defined(__EMSCRIPTEN__)
// __apple_build_version__ should be defined only on Apple clang
#if defined(__apple_build_version__) && !defined(__cpp_lib_bitops)
if (!CheckRoundTrip(values, std::log2p1(values.size()))) {
#else
if (!CheckRoundTrip(values, std::bit_width(values.size()))) {
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/parquet/chunker_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ uint64_t CalculateMask(int64_t min_chunk_size, int64_t max_chunk_size, int norm_
// by taking the floor(log2(target_size))
// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
#if defined(__clang__) && !defined(__cpp_lib_bitops) && !defined(__EMSCRIPTEN__)
// __apple_build_version__ should be defined only on Apple clang
#if defined(__apple_build_version__) && !defined(__cpp_lib_bitops)
auto target_bits = std::log2p1(static_cast<uint64_t>(target_size));
#else
auto target_bits = std::bit_width(static_cast<uint64_t>(target_size));
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/parquet/encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,8 @@ void DeltaBitPackEncoder<DType>::FlushBlock() {
// See overflow comment above.
// TODO: We can remove this condition once CRAN upgrades its macOS
// SDK from 11.3.
#if defined(__clang__) && !defined(__cpp_lib_bitops) && !defined(__EMSCRIPTEN__)
// __apple_build_version__ should be defined only on Apple clang
#if defined(__apple_build_version__) && !defined(__cpp_lib_bitops)
const auto bit_width = bit_width_data[i] =
std::log2p1(static_cast<UT>(max_delta) - static_cast<UT>(min_delta));
#else
Expand Down
Loading