Skip to content

Commit

Permalink
Adds json/document-wrapper.h (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen authored and minggo committed Nov 2, 2016
1 parent 0841ee2 commit 5e6c30e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions json/document-wrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

// Wrapper file for document.h to fix the crash bug (https://github.com/cocos2d/cocos2d-x/issues/16492)

// Bug in gcc 4.9.0 on ARM with ARM instruction set, -O2 causes the bug
// This gcc version cannot use #pragma GCC push_options/pop_options as well. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59884

#include "json/rapidjson.h"

#if defined(__arm__) && defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,9,0) && RAPIDJSON_GNUC < RAPIDJSON_VERSION_CODE(5,0,0)
#pragma GCC optimize ("O1")
#endif
#include "document.h"
#if defined(__arm__) && defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,9,0) && RAPIDJSON_GNUC < RAPIDJSON_VERSION_CODE(5,0,0)
#pragma GCC reset_options
#endif

0 comments on commit 5e6c30e

Please sign in to comment.