Skip to content

Add pragma pack directive #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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