Skip to content

Commit

Permalink
Merge pull request open-source-parsers#557 from sergiy80/master
Browse files Browse the repository at this point in the history
Add pragma pack directive

resolves open-source-parsers#458
  • Loading branch information
cdunn2001 authored Dec 5, 2016
2 parents a691cb1 + d6e666f commit 762ad0f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/json/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <cstring>
#include <memory>

#pragma pack(push, 8)

namespace Json {
template<typename T>
class SecureAllocator {
Expand Down Expand Up @@ -91,4 +93,6 @@ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {

} //namespace Json

#pragma pack(pop)

#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
4 changes: 4 additions & 0 deletions include/json/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -54,4 +56,6 @@ class JSON_API Features {

} // namespace Json

#pragma pack(pop)

#endif // CPPTL_JSON_FEATURES_H_INCLUDED
4 changes: 4 additions & 0 deletions include/json/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -397,6 +399,8 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);

} // namespace Json

#pragma pack(pop)

#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
Expand Down
3 changes: 3 additions & 0 deletions include/json/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -859,6 +861,7 @@ template<>
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)
Expand Down
4 changes: 4 additions & 0 deletions include/json/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#pragma warning(disable : 4251)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)

#pragma pack(push, 8)

namespace Json {

class Value;
Expand Down Expand Up @@ -324,6 +326,8 @@ JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);

} // namespace Json

#pragma pack(pop)

#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
Expand Down

0 comments on commit 762ad0f

Please sign in to comment.