moved IsBigEndian into it's own file

This commit is contained in:
fourtf 2018-06-27 13:03:38 +02:00
parent c22052afdd
commit 6a93aa412e
3 changed files with 16 additions and 13 deletions

View file

@ -383,7 +383,8 @@ HEADERS += \
src/widgets/StreamView.hpp \
src/widgets/TooltipWidget.hpp \
src/widgets/Window.hpp \
src/providers/twitch/TwitchCommon.hpp
src/providers/twitch/TwitchCommon.hpp \
src/util/IsBigEndian.hpp
RESOURCES += \
resources/resources.qrc \

View file

@ -16,24 +16,13 @@
#include "singletons/SettingsManager.hpp"
#include "singletons/ThemeManager.hpp"
#include "singletons/WindowManager.hpp"
#include "util/IsBigEndian.hpp"
#include "util/PostToThread.hpp"
#include <atomic>
namespace chatterino {
namespace {
bool isBigEndian()
{
int test = 1;
char *p = reinterpret_cast<char *>(&test);
return p[0] == 0;
}
} // namespace
static std::atomic<bool> isAppConstructed{false};
static std::atomic<bool> isAppInitialized{false};

13
src/util/IsBigEndian.hpp Normal file
View file

@ -0,0 +1,13 @@
#pragma once
namespace chatterino {
bool isBigEndian()
{
int test = 1;
char *p = reinterpret_cast<char *>(&test);
return p[0] == 0;
}
} // namespace chatterino