You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2023/06/25 16:39:18 UTC

[orc] branch branch-1.9 updated: ORC-1455: [C++] Fix build with unused macro in CpuInfoUtil.cc (#1552)

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

dongjoon pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.9 by this push:
     new 0abd47bcf ORC-1455: [C++] Fix build with unused macro in CpuInfoUtil.cc (#1552)
0abd47bcf is described below

commit 0abd47bcf59d93739901b4262a0dcd5084c2fd7f
Author: Gang Wu <us...@gmail.com>
AuthorDate: Mon Jun 26 01:39:12 2023 +0900

    ORC-1455: [C++] Fix build with unused macro in CpuInfoUtil.cc (#1552)
    
    ### What changes were proposed in this pull request?
    Move UNUSED macro under the definition of CPUINFO_ARCH_X86 in order to avoid unused macro error.
    
    ### Why are the changes needed?
    Without this patch, old C++(Clang 13 and older) build fails on MacOS and other non-x86 machines.
    
    ### How was this patch tested?
    It builds successfully and passes all tests on my laptop.
---
 c++/src/CpuInfoUtil.cc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/c++/src/CpuInfoUtil.cc b/c++/src/CpuInfoUtil.cc
index 482187f3d..7e6958dee 100644
--- a/c++/src/CpuInfoUtil.cc
+++ b/c++/src/CpuInfoUtil.cc
@@ -55,16 +55,15 @@
 
 #if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
 #define CPUINFO_ARCH_X86
+#ifndef ORC_HAVE_RUNTIME_AVX512
+#define UNUSED(x) (void)(x)
+#endif
 #elif defined(_M_ARM64) || defined(__aarch64__) || defined(__arm64__)
 #define CPUINFO_ARCH_ARM
 #elif defined(__PPC64__) || defined(__PPC64LE__) || defined(__ppc64__) || defined(__powerpc64__)
 #define CPUINFO_ARCH_PPC
 #endif
 
-#ifndef ORC_HAVE_RUNTIME_AVX512
-#define UNUSED(x) (void)(x)
-#endif
-
 namespace orc {
 
   namespace {