summaryrefslogtreecommitdiff
path: root/src/utils/cpu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-24 22:58:07 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-24 23:37:03 +0300
commit3480f3ad939e2ae5d0191ed739a57e834658c32e (patch)
tree268acbda26a8a4e4849362f681e95ed8b4a6de16 /src/utils/cpu.cpp
parentc3699037bc32dd43ae1b5501261808eb3425697c (diff)
downloadmv-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.gz
mv-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.bz2
mv-3480f3ad939e2ae5d0191ed739a57e834658c32e.tar.xz
mv-3480f3ad939e2ae5d0191ed739a57e834658c32e.zip
Switch in replaceSColor into using custom despatcher.
Diffstat (limited to 'src/utils/cpu.cpp')
-rw-r--r--src/utils/cpu.cpp18
1 files changed, 15 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;
+}