Fix version.sh compatiblity with Solaris
[xz/debian.git] / src / liblzma / common / hardware_cputhreads.c
blob4ce852b42c3da36252b8a8e99f4aa62182c4a299
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file hardware_cputhreads.c
6 /// \brief Get the number of CPU threads or cores
7 //
8 // Author: Lasse Collin
9 //
10 ///////////////////////////////////////////////////////////////////////////////
12 #include "common.h"
14 #include "tuklib_cpucores.h"
17 #ifdef HAVE_SYMBOL_VERSIONS_LINUX
18 // This is for compatibility with binaries linked against liblzma that
19 // has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7.
20 LZMA_SYMVER_API("lzma_cputhreads@XZ_5.2.2",
21 uint32_t, lzma_cputhreads_522)(void) lzma_nothrow
22 __attribute__((__alias__("lzma_cputhreads_52")));
24 LZMA_SYMVER_API("lzma_cputhreads@@XZ_5.2",
25 uint32_t, lzma_cputhreads_52)(void) lzma_nothrow;
27 #define lzma_cputhreads lzma_cputhreads_52
28 #endif
29 extern LZMA_API(uint32_t)
30 lzma_cputhreads(void)
32 return tuklib_cpucores();