Skip to content

Commit

Permalink
ORC-1455: [C++] Fix build with unused macro in CpuInfoUtil.cc (#1552)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
wgtmac committed Jun 25, 2023
1 parent 4a8abf6 commit 0abd47b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions c++/src/CpuInfoUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0abd47b

Please sign in to comment.