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

kou 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 dbbe0ee148 GH-48139: [C++] Allow compilation for QNX versions up to 8 
(#48140)
dbbe0ee148 is described below

commit dbbe0ee148f6859d41e77035df842cf5b1f6843c
Author: feuillatte <[email protected]>
AuthorDate: Mon Nov 17 16:26:59 2025 -0800

    GH-48139: [C++] Allow compilation for QNX versions up to 8 (#48140)
    
    ### Rationale for this change
    
    The endianness header inclusion preprocessor selection logic in 
`cpp/src/arrow/util/endian.h` currently prevents compling Arrow C++ libraries 
for the QNX operating system. Modern QNX operating system toolchains are 
detectable via the preprocessor defines  `__QNXNTO__` (versions 5 - 7) and 
`__QNX__` (version 8), which are not currently considered, but the basis for 
the logic is already implemented for AIX.
    
    ### What changes are included in this PR?
    
    Extend the current preprocessor `!defined()` check for AIX with the 
equivalent for QNX in `cpp/src/arrow/util/endian.h`.
    
    ### Are these changes tested?
    
    The change is verified using the proprietary QNX SDP 7.1 GCC 8 based 
toolchain and tested on QNX 7. Applying the patch allows building for QNX.
    
    ### Are there any user-facing changes?
    
    No; the changes purely relate to OS-specific toolchain detection.
    
    * GitHub Issue: #48139
    
    Authored-by: Lilja Tamminen <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/util/endian.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/arrow/util/endian.h b/cpp/src/arrow/util/endian.h
index fcc138828e..1edb828f9b 100644
--- a/cpp/src/arrow/util/endian.h
+++ b/cpp/src/arrow/util/endian.h
@@ -24,7 +24,7 @@
 #    include <machine/endian.h>  // IWYU pragma: keep
 #  elif defined(sun) || defined(__sun)
 #    include <sys/byteorder.h>  // IWYU pragma: keep
-#  elif !defined(_AIX)
+#  elif !defined(_AIX) && !defined(__QNXNTO__) && !defined(__QNX__)
 #    include <endian.h>  // IWYU pragma: keep
 #  endif
 #

Reply via email to