From d661607c96ebbf2ded18315675482987a9bfddc7 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 16 Oct 2024 15:00:45 +0900 Subject: [PATCH] GH-44364: [C++] Don't export template class (#44365) ### Rationale for this change It works with MSVC but doesn't work with clang-cl. ### What changes are included in this PR? Remove `ARROW_EXPORT` from template classes. ### Are these changes tested? Yes but with only MSVC. We don't have clang-cl CI jobs. ### Are there any user-facing changes? Yes. * GitHub Issue: #44364 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- cpp/src/arrow/array/builder_nested.h | 6 +++--- cpp/src/arrow/compute/row/row_encoder_internal.h | 2 +- cpp/src/arrow/io/concurrency.h | 4 ++-- cpp/src/arrow/scalar.h | 8 ++++---- cpp/src/arrow/type.h | 2 +- cpp/src/arrow/util/basic_decimal.h | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cpp/src/arrow/array/builder_nested.h b/cpp/src/arrow/array/builder_nested.h index 1851ef9122274..d0e5b6d3c0edf 100644 --- a/cpp/src/arrow/array/builder_nested.h +++ b/cpp/src/arrow/array/builder_nested.h @@ -43,7 +43,7 @@ namespace arrow { // VarLengthListLikeBuilder template -class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { +class VarLengthListLikeBuilder : public ArrayBuilder { public: using TypeClass = TYPE; using offset_type = typename TypeClass::offset_type; @@ -261,7 +261,7 @@ class ARROW_EXPORT VarLengthListLikeBuilder : public ArrayBuilder { // ListBuilder / LargeListBuilder template -class ARROW_EXPORT BaseListBuilder : public VarLengthListLikeBuilder { +class BaseListBuilder : public VarLengthListLikeBuilder { private: using BASE = VarLengthListLikeBuilder; @@ -401,7 +401,7 @@ class ARROW_EXPORT LargeListBuilder : public BaseListBuilder { // ListViewBuilder / LargeListViewBuilder template -class ARROW_EXPORT BaseListViewBuilder : public VarLengthListLikeBuilder { +class BaseListViewBuilder : public VarLengthListLikeBuilder { private: using BASE = VarLengthListLikeBuilder; diff --git a/cpp/src/arrow/compute/row/row_encoder_internal.h b/cpp/src/arrow/compute/row/row_encoder_internal.h index 4d6cc34af2342..c3275283d5a66 100644 --- a/cpp/src/arrow/compute/row/row_encoder_internal.h +++ b/cpp/src/arrow/compute/row/row_encoder_internal.h @@ -137,7 +137,7 @@ struct ARROW_EXPORT DictionaryKeyEncoder : FixedWidthKeyEncoder { }; template -struct ARROW_EXPORT VarLengthKeyEncoder : KeyEncoder { +struct VarLengthKeyEncoder : KeyEncoder { using Offset = typename T::offset_type; void AddLength(const ExecValue& data, int64_t batch_length, int32_t* lengths) override { diff --git a/cpp/src/arrow/io/concurrency.h b/cpp/src/arrow/io/concurrency.h index 43ceb8debcecb..35c2aac6a7e15 100644 --- a/cpp/src/arrow/io/concurrency.h +++ b/cpp/src/arrow/io/concurrency.h @@ -89,7 +89,7 @@ class ARROW_EXPORT SharedExclusiveChecker { // wrappers between those two classes. template -class ARROW_EXPORT InputStreamConcurrencyWrapper : public InputStream { +class InputStreamConcurrencyWrapper : public InputStream { public: Status Close() final { auto guard = lock_.exclusive_guard(); @@ -159,7 +159,7 @@ class ARROW_EXPORT InputStreamConcurrencyWrapper : public InputStream { }; template -class ARROW_EXPORT RandomAccessFileConcurrencyWrapper : public RandomAccessFile { +class RandomAccessFileConcurrencyWrapper : public RandomAccessFile { public: Status Close() final { auto guard = lock_.exclusive_guard(); diff --git a/cpp/src/arrow/scalar.h b/cpp/src/arrow/scalar.h index 7a273c46c1991..7ef37301203bc 100644 --- a/cpp/src/arrow/scalar.h +++ b/cpp/src/arrow/scalar.h @@ -134,7 +134,7 @@ namespace internal { constexpr auto kScalarScratchSpaceSize = sizeof(int64_t) * 2; template -struct ARROW_EXPORT ArraySpanFillFromScalarScratchSpace { +struct ArraySpanFillFromScalarScratchSpace { // 16 bytes of scratch space to enable ArraySpan to be a view onto any // Scalar- including binary scalars where we need to create a buffer // that looks like two 32-bit or 64-bit offsets. @@ -163,7 +163,7 @@ struct ARROW_EXPORT PrimitiveScalarBase : public Scalar { }; template -struct ARROW_EXPORT PrimitiveScalar : public PrimitiveScalarBase { +struct PrimitiveScalar : public PrimitiveScalarBase { using PrimitiveScalarBase::PrimitiveScalarBase; using TypeClass = T; using ValueType = CType; @@ -464,7 +464,7 @@ struct ARROW_EXPORT Date64Scalar : public DateScalar { }; template -struct ARROW_EXPORT TimeScalar : public TemporalScalar { +struct TimeScalar : public TemporalScalar { using TemporalScalar::TemporalScalar; TimeScalar(typename TemporalScalar::ValueType value, TimeUnit::type unit) @@ -543,7 +543,7 @@ struct ARROW_EXPORT DurationScalar : public TemporalScalar { }; template -struct ARROW_EXPORT DecimalScalar : public internal::PrimitiveScalarBase { +struct DecimalScalar : public internal::PrimitiveScalarBase { using internal::PrimitiveScalarBase::PrimitiveScalarBase; using TypeClass = TYPE_CLASS; using ValueType = VALUE_TYPE; diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h index 3d7786bd37e09..53207bb9da8a6 100644 --- a/cpp/src/arrow/type.h +++ b/cpp/src/arrow/type.h @@ -548,7 +548,7 @@ ARROW_EXPORT void PrintTo(const Field& field, std::ostream* os); namespace detail { template -class ARROW_EXPORT CTypeImpl : public BASE { +class CTypeImpl : public BASE { public: static constexpr Type::type type_id = TYPE_ID; using c_type = C_TYPE; diff --git a/cpp/src/arrow/util/basic_decimal.h b/cpp/src/arrow/util/basic_decimal.h index fac40a46da8f6..9c1f2e479c712 100644 --- a/cpp/src/arrow/util/basic_decimal.h +++ b/cpp/src/arrow/util/basic_decimal.h @@ -40,7 +40,7 @@ enum class DecimalStatus { }; template -class ARROW_EXPORT GenericBasicDecimal { +class GenericBasicDecimal { protected: struct LittleEndianArrayTag {};