This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new 57667044e ORC-1455: [C++] Fix build with unused macro in
CpuInfoUtil.cc (#1551)
57667044e is described below
commit 57667044e7003b13d2323ddfe88fd07bcea82f7b
Author: Gang Wu <[email protected]>
AuthorDate: Mon Jun 26 01:38:31 2023 +0900
ORC-1455: [C++] Fix build with unused macro in CpuInfoUtil.cc (#1551)
### 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, the 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 {