diff options
author | jan Iversen <jani@libreoffice.org> | 2017-11-22 14:48:03 +0100 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-11-22 14:49:31 +0100 |
commit | 7329b4423c0d348d0af0ab5b5b7bfcdc25bc7618 (patch) | |
tree | 992c4f3c92a563cd20b0017a3222252d8f25105e /tools/source/misc | |
parent | 57768926f344e516c039db9417d2cfd4c5e6b303 (diff) |
cpuid is only for x86 processors.
clang for macOS did not like cpuid when compiling for arm cpu.
Change-Id: Iede658a524e5c3e1aa2d33137ed399679b021987
Diffstat (limited to 'tools/source/misc')
-rw-r--r-- | tools/source/misc/cpuid.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/source/misc/cpuid.cxx b/tools/source/misc/cpuid.cxx index e3ba82dffda5..ee5093ce1892 100644 --- a/tools/source/misc/cpuid.cxx +++ b/tools/source/misc/cpuid.cxx @@ -25,11 +25,18 @@ void getCpuId(uint32_t array[4]) __cpuid(reinterpret_cast<int*>(array), 1); } #else +#if (defined(__i386__) || defined(__x86_64__)) #include <cpuid.h> void getCpuId(uint32_t array[4]) { __get_cpuid(1, array + 0, array + 1, array + 2, array + 3); } +#else +void getCpuId(uint32_t array[4]) +{ + array[0] = array[1] = array[2] = array[3] = 0; +} +#endif #endif } |