Add pragma pack directive
Related to https://github.com/open-source-parsers/jsoncpp/issues/458
diff --git a/include/json/allocator.h b/include/json/allocator.h
index 9d8b9fc..2492758 100644
--- a/include/json/allocator.h
+++ b/include/json/allocator.h
@@ -9,6 +9,8 @@
#include <cstring>
#include <memory>
+#pragma pack(push, 8)
+
namespace Json {
template<typename T>
class SecureAllocator {
@@ -91,4 +93,6 @@
} //namespace Json
+#pragma pack(pop)
+
#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
diff --git a/include/json/features.h b/include/json/features.h
index 1bb7bb6..de45248 100644
--- a/include/json/features.h
+++ b/include/json/features.h
@@ -10,6 +10,8 @@
#include "forwards.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
+#pragma pack(push, 8)
+
namespace Json {
/** \brief Configuration passed to reader and writer.
@@ -54,4 +56,6 @@
} // namespace Json
+#pragma pack(pop)
+
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
diff --git a/include/json/reader.h b/include/json/reader.h
index caf8727..6ab5bdb 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -23,6 +23,8 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma pack(push, 8)
+
namespace Json {
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
@@ -397,6 +399,8 @@
} // namespace Json
+#pragma pack(pop)
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
diff --git a/include/json/value.h b/include/json/value.h
index f2eb3f3..c39f423 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -42,6 +42,8 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma pack(push, 8)
+
/** \brief JSON (JavaScript Object Notation).
*/
namespace Json {
@@ -859,6 +861,7 @@
inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
}
+#pragma pack(pop)
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
diff --git a/include/json/writer.h b/include/json/writer.h
index 2c1e65b..d0944ee 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -20,6 +20,8 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma pack(push, 8)
+
namespace Json {
class Value;
@@ -324,6 +326,8 @@
} // namespace Json
+#pragma pack(pop)
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)