You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2025/10/27 13:46:58 UTC

(arrow) branch main updated: GH-47953: [C++] Remove Windows inclusion from `int_util_overflow.h` (#47950)

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

apitrou 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 57c329f876 GH-47953: [C++] Remove Windows inclusion from `int_util_overflow.h` (#47950)
57c329f876 is described below

commit 57c329f8768208c0196b7d1623219cfa2b5eb89e
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Mon Oct 27 14:46:52 2025 +0100

    GH-47953: [C++] Remove Windows inclusion from `int_util_overflow.h` (#47950)
    
    ### Rationale for this change
    
    In `int_util_overflow.h` we're currently including (indirectly) some Windows header through `windows_compatibility.h`:
    https://github.com/apache/arrow/blob/f669b9fb6b71e74bb41496252709b494233de44d/cpp/src/arrow/util/int_util_overflow.h#L28-L33
    
    This was probably necessary when this was initially committed, but can produce problems when expanding the use of this header in our codebase, due to unwanted macro definitions, here is an [example](https://github.com/apache/arrow/actions/runs/18754865884/job/53504089972?pr=47925):
    ```
    D:/a/arrow/arrow/cpp/src/parquet/arrow/schema.cc:78:45: error: expected unqualified-id
       78 |   return is_nullable ? Repetition::OPTIONAL : Repetition::REQUIRED;
          |                                             ^
    D:/a/arrow/arrow/cpp/src/parquet/arrow/schema.cc:331:45: error: expected unqualified-id
      331 |       if (repetition != Repetition::OPTIONAL) {
          |                                             ^
    2 errors generated.
    ```
    
    ### What changes are included in this PR?
    
    Simply remove the Windows inclusion. This seems to pass our current CI suite.
    
    ### Are these changes tested?
    
    Yes, by existing CI tests.
    
    ### Are there any user-facing changes?
    
    No.
    
    * GitHub Issue: #47953
    
    Authored-by: Antoine Pitrou <an...@python.org>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 cpp/src/arrow/util/int_util_overflow.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cpp/src/arrow/util/int_util_overflow.h b/cpp/src/arrow/util/int_util_overflow.h
index ffe78be247..b48430cd48 100644
--- a/cpp/src/arrow/util/int_util_overflow.h
+++ b/cpp/src/arrow/util/int_util_overflow.h
@@ -26,10 +26,8 @@
 #include "arrow/util/visibility.h"
 
 // "safe-math.h" includes <intsafe.h> from the Windows headers.
-#include "arrow/util/windows_compatibility.h"
 #include "arrow/vendored/portable-snippets/safe-math.h"
 // clang-format off (avoid include reordering)
-#include "arrow/util/windows_fixup.h"
 // clang-format on
 
 namespace arrow {