mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
moved IsBigEndian into it's own file
This commit is contained in:
parent
c22052afdd
commit
6a93aa412e
3 changed files with 16 additions and 13 deletions
|
@ -383,7 +383,8 @@ HEADERS += \
|
||||||
src/widgets/StreamView.hpp \
|
src/widgets/StreamView.hpp \
|
||||||
src/widgets/TooltipWidget.hpp \
|
src/widgets/TooltipWidget.hpp \
|
||||||
src/widgets/Window.hpp \
|
src/widgets/Window.hpp \
|
||||||
src/providers/twitch/TwitchCommon.hpp
|
src/providers/twitch/TwitchCommon.hpp \
|
||||||
|
src/util/IsBigEndian.hpp
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources/resources.qrc \
|
resources/resources.qrc \
|
||||||
|
|
|
@ -16,24 +16,13 @@
|
||||||
#include "singletons/SettingsManager.hpp"
|
#include "singletons/SettingsManager.hpp"
|
||||||
#include "singletons/ThemeManager.hpp"
|
#include "singletons/ThemeManager.hpp"
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
|
#include "util/IsBigEndian.hpp"
|
||||||
#include "util/PostToThread.hpp"
|
#include "util/PostToThread.hpp"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
namespace chatterino {
|
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> isAppConstructed{false};
|
||||||
static std::atomic<bool> isAppInitialized{false};
|
static std::atomic<bool> isAppInitialized{false};
|
||||||
|
|
||||||
|
|
13
src/util/IsBigEndian.hpp
Normal file
13
src/util/IsBigEndian.hpp
Normal 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
|
Loading…
Reference in a new issue