summaryrefslogtreecommitdiff
path: root/Build/source/extra/xz-4.999.9beta/src/common/cpucores.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/extra/xz-4.999.9beta/src/common/cpucores.h')
-rw-r--r--Build/source/extra/xz-4.999.9beta/src/common/cpucores.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/Build/source/extra/xz-4.999.9beta/src/common/cpucores.h b/Build/source/extra/xz-4.999.9beta/src/common/cpucores.h
deleted file mode 100644
index 704d8a26e54..00000000000
--- a/Build/source/extra/xz-4.999.9beta/src/common/cpucores.h
+++ /dev/null
@@ -1,51 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-/// \file cpucores.h
-/// \brief Get the number of online CPU cores
-//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef CPUCORES_H
-#define CPUCORES_H
-
-#if defined(HAVE_CPUCORES_SYSCONF)
-# include <unistd.h>
-
-#elif defined(HAVE_CPUCORES_SYSCTL)
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# endif
-# ifdef HAVE_SYS_SYSCTL_H
-# include <sys/sysctl.h>
-# endif
-#endif
-
-
-static inline uint32_t
-cpucores(void)
-{
- uint32_t ret = 0;
-
-#if defined(HAVE_CPUCORES_SYSCONF)
- const long cpus = sysconf(_SC_NPROCESSORS_ONLN);
- if (cpus > 0)
- ret = (uint32_t)(cpus);
-
-#elif defined(HAVE_CPUCORES_SYSCTL)
- int name[2] = { CTL_HW, HW_NCPU };
- int cpus;
- size_t cpus_size = sizeof(cpus);
- if (!sysctl(name, &cpus, &cpus_size, NULL, NULL)
- && cpus_size == sizeof(cpus) && cpus > 0)
- ret = (uint32_t)(cpus);
-#endif
-
- return ret;
-}
-
-#endif