diff options
| author | Josh Ferrell <josh@vector35.com> | 2022-11-18 14:56:50 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2022-11-27 13:43:45 -0500 |
| commit | b195e2c1aa0481ae77358492c60035e37a693ee8 (patch) | |
| tree | ad378b9b1851dba3657be0d61c685e4f1d0c1aba /rapidjson/document.h | |
| parent | 6e0d2963a3a4712d22ea83b87a8dc472e06b9ad9 (diff) | |
Add workaround from https://github.com/Tencent/rapidjson/pull/1877
Diffstat (limited to 'rapidjson/document.h')
| -rw-r--r-- | rapidjson/document.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rapidjson/document.h b/rapidjson/document.h index b42dd096..5ae54685 100644 --- a/rapidjson/document.h +++ b/rapidjson/document.h @@ -44,6 +44,16 @@ RAPIDJSON_DIAG_OFF(terminate) // ignore throwing RAPIDJSON_ASSERT in RAPIDJSON_N #endif #endif // __GNUC__ +#ifdef GetObject +// see https://github.com/Tencent/rapidjson/issues/1448 +// a former included windows.h might have defined a macro called GetObject, which affects +// GetObject defined here. This ensures the macro does not get applied +#pragma push_macro("GetObject") +#define RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#undef GetObject +#endif + + #ifndef RAPIDJSON_NOMEMBERITERATORCLASS #include <iterator> // std::iterator, std::random_access_iterator_tag #endif @@ -1469,7 +1479,9 @@ public: } Object GetObject() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } + Object GetObj() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } ConstObject GetObject() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } + ConstObject GetObj() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } //@} @@ -2590,4 +2602,9 @@ private: RAPIDJSON_NAMESPACE_END RAPIDJSON_DIAG_POP +#ifdef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#pragma pop_macro("GetObject") +#undef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#endif + #endif // RAPIDJSON_DOCUMENT_H_ |
