diff --git a/cpp/src/parquet/column_reader.cc b/cpp/src/parquet/column_reader.cc index 9c314cf81817..8ecb774022f0 100644 --- a/cpp/src/parquet/column_reader.cc +++ b/cpp/src/parquet/column_reader.cc @@ -57,6 +57,11 @@ #include "parquet/thrift_internal.h" // IWYU pragma: keep #include "parquet/windows_fixup.h" // for OPTIONAL +#ifdef _MSC_VER +// disable warning about inheritance via dominance in the diamond pattern +# pragma warning(disable : 4250) +#endif + using arrow::MemoryPool; using arrow::internal::AddWithOverflow; using arrow::internal::checked_cast; diff --git a/cpp/src/parquet/decoder.cc b/cpp/src/parquet/decoder.cc index b6d79665621f..d0a857dd22ac 100644 --- a/cpp/src/parquet/decoder.cc +++ b/cpp/src/parquet/decoder.cc @@ -53,6 +53,11 @@ #include "parquet/schema.h" #include "parquet/types.h" +#ifdef _MSC_VER +// disable warning about inheritance via dominance in the diamond pattern +# pragma warning(disable : 4250) +#endif + namespace bit_util = arrow::bit_util; using arrow::Status; diff --git a/cpp/src/parquet/encoder.cc b/cpp/src/parquet/encoder.cc index 831ddbddab13..f9367555d97f 100644 --- a/cpp/src/parquet/encoder.cc +++ b/cpp/src/parquet/encoder.cc @@ -49,6 +49,11 @@ #include "parquet/schema.h" #include "parquet/types.h" +#ifdef _MSC_VER +// disable warning about inheritance via dominance in the diamond pattern +# pragma warning(disable : 4250) +#endif + namespace bit_util = arrow::bit_util; using arrow::Status; diff --git a/cpp/src/parquet/exception.h b/cpp/src/parquet/exception.h index 46f5595dd125..5c6c9ce8a726 100644 --- a/cpp/src/parquet/exception.h +++ b/cpp/src/parquet/exception.h @@ -26,6 +26,19 @@ #include "arrow/util/string_util.h" #include "parquet/platform.h" +#ifdef _MSC_VER +# pragma warning(push) +// Disable warning for STL types usage in DLL interface +// https://web.archive.org/web/20130317015847/http://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports +# pragma warning(disable : 4275 4251) +// Disable diamond inheritance warnings +# pragma warning(disable : 4250) +// Disable macro redefinition warnings +# pragma warning(disable : 4005) +// Disable extern before exported template warnings +# pragma warning(disable : 4910) +#endif + // PARQUET-1085 #if !defined(ARROW_UNUSED) # define ARROW_UNUSED(x) UNUSED(x) @@ -84,7 +97,7 @@ namespace parquet { -class ParquetException : public std::exception { +class PARQUET_EXPORT ParquetException : public std::exception { public: PARQUET_NORETURN static void EofException(const std::string& msg = "") { static std::string prefix = "Unexpected end of stream"; @@ -156,3 +169,7 @@ void ThrowNotOk(StatusReturnBlock&& b) { } } // namespace parquet + +#ifdef _MSC_VER +# pragma warning(pop) +#endif diff --git a/cpp/src/parquet/hasher.h b/cpp/src/parquet/hasher.h index 519eb459b9ca..9ff41f17b5e6 100644 --- a/cpp/src/parquet/hasher.h +++ b/cpp/src/parquet/hasher.h @@ -22,7 +22,7 @@ namespace parquet { // Abstract class for hash -class Hasher { +class PARQUET_EXPORT Hasher { public: /// Compute hash for 32 bits value by using its plain encoding result. /// diff --git a/cpp/src/parquet/platform.h b/cpp/src/parquet/platform.h index e8d67e225f8f..92849347d4e9 100644 --- a/cpp/src/parquet/platform.h +++ b/cpp/src/parquet/platform.h @@ -28,7 +28,7 @@ #if defined(_WIN32) || defined(__CYGWIN__) -# if defined(_MSC_VER) +# ifdef _MSC_VER # pragma warning(push) // Disable warning for STL types usage in DLL interface // https://web.archive.org/web/20130317015847/http://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports @@ -110,3 +110,7 @@ std::shared_ptr AllocateBuffer( ::arrow::MemoryPool* pool = ::arrow::default_memory_pool(), int64_t size = 0); } // namespace parquet + +#ifdef _MSC_VER +# pragma warning(pop) +#endif diff --git a/cpp/src/parquet/types.cc b/cpp/src/parquet/types.cc index 9f5003b79e5c..7109c3d1c83b 100644 --- a/cpp/src/parquet/types.cc +++ b/cpp/src/parquet/types.cc @@ -39,6 +39,11 @@ #include "generated/parquet_types.h" +#ifdef _MSC_VER +// disable warning about inheritance via dominance in the diamond pattern +# pragma warning(disable : 4250) +#endif + using arrow::internal::checked_cast; using arrow::util::Codec;