Skip to content

Commit 0034a04

Browse files
committed
fixed_width: Fix linker errors
1 parent 56a8b40 commit 0034a04

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

‎cpp/src/arrow/util/fixed_width_internal.cc‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ bool IsFixedWidthLike(const ArraySpan& source, bool force_null_count,
4040
});
4141
}
4242

43-
namespace internal {
44-
45-
int64_t FixedWidthInBytesFallback(const FixedSizeListType& fixed_size_list_type) {
43+
static int64_t FixedWidthInBytesFallback(const FixedSizeListType& fixed_size_list_type) {
4644
auto* fsl = &fixed_size_list_type;
4745
int64_t list_size = fsl->list_size();
4846
for (auto type = fsl->value_type().get();;) {
@@ -62,8 +60,6 @@ int64_t FixedWidthInBytesFallback(const FixedSizeListType& fixed_size_list_type)
6260
return -1;
6361
}
6462

65-
} // namespace internal
66-
6763
int64_t FixedWidthInBytes(const DataType& type) {
6864
auto type_id = type.id();
6965
if (is_fixed_width(type_id)) {
@@ -72,7 +68,7 @@ int64_t FixedWidthInBytes(const DataType& type) {
7268
}
7369
if (type_id == Type::FIXED_SIZE_LIST) {
7470
auto& fsl = ::arrow::internal::checked_cast<const FixedSizeListType&>(type);
75-
return internal::FixedWidthInBytesFallback(fsl);
71+
return FixedWidthInBytesFallback(fsl);
7672
}
7773
return -1;
7874
}
@@ -148,6 +144,8 @@ Status PreallocateFixedWidthArrayData(::arrow::compute::KernelContext* ctx,
148144
return Status::Invalid("PreallocateFixedWidthArrayData: Invalid type: ", *type);
149145
}
150146

147+
} // namespace internal
148+
151149
/// \pre same as OffsetPointerOfFixedWidthValues
152150
/// \pre source.type->id() != Type::BOOL
153151
static const uint8_t* OffsetPointerOfFixedWidthValuesFallback(const ArraySpan& source) {
@@ -181,8 +179,6 @@ static const uint8_t* OffsetPointerOfFixedWidthValuesFallback(const ArraySpan& s
181179
return value_width < 0 ? nullptr : array->GetValues<uint8_t>(1, offset_in_bytes);
182180
}
183181

184-
} // namespace internal
185-
186182
const uint8_t* OffsetPointerOfFixedWidthValues(const ArraySpan& source) {
187183
auto type_id = source.type->id();
188184
if (is_fixed_width(type_id)) {
@@ -194,7 +190,7 @@ const uint8_t* OffsetPointerOfFixedWidthValues(const ArraySpan& source) {
194190
}
195191
return source.GetValues<uint8_t>(1, 0) + source.offset * source.type->byte_width();
196192
}
197-
return internal::OffsetPointerOfFixedWidthValuesFallback(source);
193+
return OffsetPointerOfFixedWidthValuesFallback(source);
198194
}
199195

200196
/// \brief Get the mutable pointer to the fixed-width values of an array

‎cpp/src/arrow/util/fixed_width_internal.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ inline bool IsFixedWidthLike(const ArraySpan& source, bool force_null_count,
246246
/// \return The fixed-byte width of the values or -1 if the type is BOOL or not
247247
/// fixed-width like. 0 is a valid return value as fixed-size-lists
248248
/// and fixed-size-binary with size 0 are allowed.
249-
int64_t FixedWidthInBytes(const DataType& type);
249+
ARROW_EXPORT int64_t FixedWidthInBytes(const DataType& type);
250250

251251
/// \brief Get the fixed-width in bits of a type if it is a fixed-width like
252252
/// type.
253253
///
254254
/// \return The bit-width of the values or -1
255255
/// \see FixedWidthInBytes
256-
int64_t FixedWidthInBits(const DataType& type);
256+
ARROW_EXPORT int64_t FixedWidthInBits(const DataType& type);
257257

258258
namespace internal {
259259

@@ -291,7 +291,7 @@ ARROW_EXPORT Status PreallocateFixedWidthArrayData(::arrow::compute::KernelConte
291291
/// is_fixed_width(*mutable_array->type) SHOULD be true
292292
/// \return The pointer to the fixed-width values of an array or NULLPTR
293293
/// if pre-conditions are not satisfied.
294-
const uint8_t* OffsetPointerOfFixedWidthValues(const ArraySpan& source);
294+
ARROW_EXPORT const uint8_t* OffsetPointerOfFixedWidthValues(const ArraySpan& source);
295295

296296
/// \brief Get the mutable pointer to the fixed-width values of an array
297297
/// allocated by PreallocateFixedWidthArrayData.
@@ -302,6 +302,6 @@ const uint8_t* OffsetPointerOfFixedWidthValues(const ArraySpan& source);
302302
/// is_fixed_width(*mutable_array->type) MUST be true
303303
/// \return The mutable pointer to the fixed-width byte blocks of the array. If
304304
/// pre-conditions are not satisfied, the return values is undefined.
305-
uint8_t* MutableFixedWidthValuesPointer(ArrayData* mutable_array);
305+
ARROW_EXPORT uint8_t* MutableFixedWidthValuesPointer(ArrayData* mutable_array);
306306

307307
} // namespace arrow::util

0 commit comments

Comments
 (0)