This is an automated email from the ASF dual-hosted git repository.

raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8b2336058c GH-47033: [C++][Compute] Never use custom gtest main with 
MSVC (#47049)
8b2336058c is described below

commit 8b2336058c1dd5eba3293ab736cfbe8e0c38dc2b
Author: Sutou Kouhei <[email protected]>
AuthorDate: Thu Jul 10 17:41:25 2025 +0900

    GH-47033: [C++][Compute] Never use custom gtest main with MSVC (#47049)
    
    ### Rationale for this change
    
    If we use custom gtest main with MSVC, it always reports "SEH exception".
    
    ### What changes are included in this PR?
    
    Remove MSVC version check.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    
    * GitHub Issue: #47033
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 cpp/src/arrow/compute/CMakeLists.txt | 2 +-
 cpp/src/arrow/compute/test_env.cc    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpp/src/arrow/compute/CMakeLists.txt 
b/cpp/src/arrow/compute/CMakeLists.txt
index 6d11aa26c0..6f740e86ee 100644
--- a/cpp/src/arrow/compute/CMakeLists.txt
+++ b/cpp/src/arrow/compute/CMakeLists.txt
@@ -48,7 +48,7 @@ if(ARROW_TESTING AND ARROW_COMPUTE)
   add_library(arrow_compute_testing OBJECT ${ARROW_COMPUTE_TESTING_SRCS})
   # Even though this is still just an object library we still need to "link"
   # arrow_compute_core_testing so that is also included correctly
-  if(MSVC AND MSVC_VERSION LESS 1930)
+  if(MSVC)
     target_link_libraries(arrow_compute_testing
                           PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
                           PUBLIC ${ARROW_GTEST_GTEST_MAIN})
diff --git a/cpp/src/arrow/compute/test_env.cc 
b/cpp/src/arrow/compute/test_env.cc
index 901a005647..b035b8ca03 100644
--- a/cpp/src/arrow/compute/test_env.cc
+++ b/cpp/src/arrow/compute/test_env.cc
@@ -35,7 +35,7 @@ class ComputeKernelEnvironment : public 
::testing::Environment {
 
 }  // namespace
 
-#if defined(_MSC_VER) && _MSC_VER < 1930
+#ifdef _MSC_VER
 // Initialize the compute module
 ::testing::Environment* compute_kernels_env =
     ::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
@@ -43,7 +43,7 @@ class ComputeKernelEnvironment : public 
::testing::Environment {
 
 }  // namespace arrow::compute
 
-#if !(defined(_MSC_VER) && _MSC_VER < 1930)
+#ifndef _MSC_VER
 int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);
   ::testing::AddGlobalTestEnvironment(new 
arrow::compute::ComputeKernelEnvironment);

Reply via email to