From dbdf9097a42a4d637e9818e238a8805b77cd86ff Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 11 Jul 2022 09:05:28 -0700 Subject: [PATCH] app/lib: fixed c++98 compliance issues --- app/vector3edit.cpp | 1 + lib/common.h | 4 ++++ lib/core.cpp | 2 ++ lib/core.h | 1 + lib/interleaf.cpp | 6 +++--- lib/object.h | 2 +- lib/types.h | 5 +++-- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/vector3edit.cpp b/app/vector3edit.cpp index c049bb3..416efe1 100644 --- a/app/vector3edit.cpp +++ b/app/vector3edit.cpp @@ -1,5 +1,6 @@ #include "vector3edit.h" +#include #include #include diff --git a/lib/common.h b/lib/common.h index b3b5fdd..aa87d0d 100644 --- a/lib/common.h +++ b/lib/common.h @@ -7,7 +7,11 @@ #define LIBWEAVER_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop)) #endif +#ifdef _MSC_VER #define LIBWEAVER_EXPORT __declspec(dllexport) +#else +#define LIBWEAVER_EXPORT +#endif #if defined(_WIN32) #define LIBWEAVER_OS_WINDOWS diff --git a/lib/core.cpp b/lib/core.cpp index 98ceabd..14cf2d0 100644 --- a/lib/core.cpp +++ b/lib/core.cpp @@ -1,5 +1,7 @@ #include "core.h" +#include + namespace si { Core::Core() diff --git a/lib/core.h b/lib/core.h index e48d894..de11c41 100644 --- a/lib/core.h +++ b/lib/core.h @@ -4,6 +4,7 @@ #include #include "common.h" +#include "types.h" namespace si { diff --git a/lib/interleaf.cpp b/lib/interleaf.cpp index f3e1305..b3cfffb 100644 --- a/lib/interleaf.cpp +++ b/lib/interleaf.cpp @@ -74,11 +74,11 @@ bool Interleaf::ParseStream(Chunk *chunk) Chunk *list = static_cast(chunk->GetChildAt(1)); if (list) { - using ChunkMap = std::map >; + typedef std::map ChunkMap; ChunkMap data; - for (Core *chunk : list->GetChildren()) { - Chunk *mxch = static_cast(chunk); + for (Children::const_iterator it=list->GetChildren().begin(); it!=list->GetChildren().end(); it++) { + Chunk *mxch = static_cast(*it); if (mxch->id() == Chunk::TYPE_pad_) { // Ignore this chunk } else if (mxch->id() == Chunk::TYPE_MxCh) { diff --git a/lib/object.h b/lib/object.h index 1bd60e2..6f0fe62 100644 --- a/lib/object.h +++ b/lib/object.h @@ -10,7 +10,7 @@ namespace si { class Object : public Core { public: - using ChunkedData = std::vector; + typedef std::vector ChunkedData; Object(); diff --git a/lib/types.h b/lib/types.h index db84c2c..dbb2d5e 100644 --- a/lib/types.h +++ b/lib/types.h @@ -1,6 +1,7 @@ #ifndef TYPES_H #define TYPES_H +#include #include #include #include @@ -24,7 +25,7 @@ namespace si { class bytearray : public std::vector { public: - bytearray() = default; + bytearray(){} template T *cast() { return reinterpret_cast(data()); } @@ -138,7 +139,7 @@ private: }; -using DataMap = std::map; +typedef std::map DataMap; }