diff --git a/include/athena/Dir.hpp b/include/athena/Dir.hpp index bbd4549..8ad8186 100644 --- a/include/athena/Dir.hpp +++ b/include/athena/Dir.hpp @@ -3,6 +3,7 @@ #include "athena/FileInfo.hpp" #include +#include #if _WIN32 typedef int mode_t; diff --git a/include/athena/Global.hpp b/include/athena/Global.hpp index 14da238..18bd991 100644 --- a/include/athena/Global.hpp +++ b/include/athena/Global.hpp @@ -3,7 +3,6 @@ #include #include "athena/Types.hpp" -#include "athena/Utility.hpp" #ifdef _MSC_VER #pragma warning(disable : 4996) diff --git a/include/athena/IStreamReader.hpp b/include/athena/IStreamReader.hpp index 92cf45a..c7247a5 100644 --- a/include/athena/IStreamReader.hpp +++ b/include/athena/IStreamReader.hpp @@ -4,6 +4,7 @@ #include #include #include "utf8proc.h" +#include "Utility.hpp" #include "IStream.hpp" namespace athena::io diff --git a/include/athena/IStreamWriter.hpp b/include/athena/IStreamWriter.hpp index 2fdce5a..60e6893 100644 --- a/include/athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -3,7 +3,9 @@ #include "utf8proc.h" #include "IStream.hpp" +#include "Utility.hpp" #include +#include namespace athena::io { diff --git a/include/athena/Utility.hpp b/include/athena/Utility.hpp index eed3b9b..b260def 100644 --- a/include/athena/Utility.hpp +++ b/include/athena/Utility.hpp @@ -13,6 +13,8 @@ namespace athena::utility { inline bool isEmpty(atInt8* buf, atUint32 size) {return !memcmp(buf, buf + 1, size - 1);} constexpr bool isSystemBigEndian() {return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__;} +inline constexpr ::athena::Endian SystemEndian = isSystemBigEndian() ? Big : Little; +inline constexpr ::athena::Endian NotSystemEndian = isSystemBigEndian() ? Little : Big; inline atInt16 swap16(atInt16 val) { diff --git a/src/athena/Dir.cpp b/src/athena/Dir.cpp index 7dba45a..74b0389 100644 --- a/src/athena/Dir.cpp +++ b/src/athena/Dir.cpp @@ -4,6 +4,7 @@ #include #define __STDC_FORMAT_MACROS #include +#include "athena/Utility.hpp" #ifndef _WIN32 #include diff --git a/src/athena/Global.cpp b/src/athena/Global.cpp index 92fcb83..3a37cd8 100644 --- a/src/athena/Global.cpp +++ b/src/athena/Global.cpp @@ -1,4 +1,5 @@ #include "athena/Global.hpp" +#include "athena/Utility.hpp" #include #include #include