diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-24 22:58:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-24 23:37:03 +0300 |
commit | 3480f3ad939e2ae5d0191ed739a57e834658c32e (patch) | |
tree | 268acbda26a8a4e4849362f681e95ed8b4a6de16 /src/utils | |
parent | c3699037bc32dd43ae1b5501261808eb3425697c (diff) | |
download | manaplus-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.gz manaplus-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.bz2 manaplus-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.xz manaplus-3480f3ad939e2ae5d0191ed739a57e834658c32e.zip |
Switch in replaceSColor into using custom despatcher.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/cpu.cpp | 18 | ||||
-rw-r--r-- | src/utils/cpu.h | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/utils/cpu.cpp b/src/utils/cpu.cpp index e57956c06..91f49f5a7 100644 --- a/src/utils/cpu.cpp +++ b/src/utils/cpu.cpp @@ -32,7 +32,10 @@ #include "debug.h" -int mCpuFlags = 0; +namespace +{ + uint32_t mCpuFlags; +} // namespace void Cpu::detect() { @@ -99,16 +102,20 @@ void Cpu::detect() } } fclose(file); - logger->log("cpu features was not detected"); + if (logger) + logger->log("cpu features was not detected"); #else // OTHER - logger->log("cpu features not supported"); + if (logger) + logger->log("cpu features not supported"); #endif // (defined(__amd64__) || defined(__i386__)) && defined(__GNUC__) // && (GCC_VERSION >= 40800) && !defined(ANDROID) } void Cpu::printFlags() { + if (!logger) + return; std::string str("CPU features:"); if (mCpuFlags & FEATURE_MMX) str.append(" mmx"); @@ -128,3 +135,8 @@ void Cpu::printFlags() str.append(" avx2"); logger->log(str); } + +uint32_t Cpu::getFlags() +{ + return mCpuFlags; +} diff --git a/src/utils/cpu.h b/src/utils/cpu.h index 2780795bd..8be6ccbc3 100644 --- a/src/utils/cpu.h +++ b/src/utils/cpu.h @@ -41,6 +41,8 @@ namespace Cpu void detect(); void printFlags(); + + uint32_t getFlags(); } // namespace Cpu #endif // UTILS_CPU_H |