From 075747c418a036d74b25696f1ccde56c57f9150a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 9 Aug 2018 20:18:42 -1000 Subject: [PATCH] Remove cyclic include --- include/athena/Dir.hpp | 1 + include/athena/Global.hpp | 1 - include/athena/IStreamReader.hpp | 1 + include/athena/IStreamWriter.hpp | 2 ++ include/athena/Utility.hpp | 2 ++ src/athena/Dir.cpp | 1 + src/athena/Global.cpp | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) 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