Skip to content

Commit 762ad0f

Browse files
authored
Merge pull request open-source-parsers#557 from sergiy80/master
Add pragma pack directive resolves open-source-parsers#458
2 parents a691cb1 + d6e666f commit 762ad0f

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

include/json/allocator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <cstring>
1010
#include <memory>
1111

12+
#pragma pack(push, 8)
13+
1214
namespace Json {
1315
template<typename T>
1416
class SecureAllocator {
@@ -91,4 +93,6 @@ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
9193

9294
} //namespace Json
9395

96+
#pragma pack(pop)
97+
9498
#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED

include/json/features.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "forwards.h"
1111
#endif // if !defined(JSON_IS_AMALGAMATION)
1212

13+
#pragma pack(push, 8)
14+
1315
namespace Json {
1416

1517
/** \brief Configuration passed to reader and writer.
@@ -54,4 +56,6 @@ class JSON_API Features {
5456

5557
} // namespace Json
5658

59+
#pragma pack(pop)
60+
5761
#endif // CPPTL_JSON_FEATURES_H_INCLUDED

include/json/reader.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#pragma warning(disable : 4251)
2424
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
2525

26+
#pragma pack(push, 8)
27+
2628
namespace Json {
2729

2830
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
@@ -397,6 +399,8 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
397399

398400
} // namespace Json
399401

402+
#pragma pack(pop)
403+
400404
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
401405
#pragma warning(pop)
402406
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)

include/json/value.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#pragma warning(disable : 4251)
4343
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
4444

45+
#pragma pack(push, 8)
46+
4547
/** \brief JSON (JavaScript Object Notation).
4648
*/
4749
namespace Json {
@@ -859,6 +861,7 @@ template<>
859861
inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
860862
}
861863

864+
#pragma pack(pop)
862865

863866
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
864867
#pragma warning(pop)

include/json/writer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#pragma warning(disable : 4251)
2121
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
2222

23+
#pragma pack(push, 8)
24+
2325
namespace Json {
2426

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

325327
} // namespace Json
326328

329+
#pragma pack(pop)
330+
327331
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
328332
#pragma warning(pop)
329333
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)

0 commit comments

Comments
 (0)